### Question:
NettyHttpServerEngine implements ServerEngine { @Override public void addServant(URL url, NettyHttpHandler handler) { checkRegistedContext(url); if (serverChannel == null) { serverChannel = startServer(); } handler.setName(url.getPath()); String contextName = HttpUriMapper.getContextName(url.getPath()); NettyHttpContextHandler contextHandler = handlerMap.get(contextName); if (contextHandler == null) { contextHandler = new NettyHttpContextHandler(contextName); handlerMap.put(contextName, contextHandler); } contextHandler.addNettyHttpHandler(handler); registedPaths.add(url.getPath()); } NettyHttpServerEngine();  NettyHttpServerEngine(
            String host,
            int port); @PostConstruct void finalizeConfig(); void setTlsServerParameters(TLSServerParameters params); TLSServerParameters getTlsServerParameters(); void setThreadingParameters(ThreadingParameters params); ThreadingParameters getThreadingParameters(); @Override void addServant(URL url, NettyHttpHandler handler); @Override void removeServant(URL url); @Override NettyHttpHandler getServant(URL url); void shutdown(); int getReadIdleTime(); void setReadIdleTime(int readIdleTime); int getWriteIdleTime(); void setWriteIdleTime(int writeIdleTime); boolean isSessionSupport(); void setSessionSupport(boolean session); int getMaxChunkContentSize(); void setMaxChunkContentSize(int maxChunkContentSize); int getPort(); void setPort(int port); void setHost(String host); String getHost(); String getProtocol(); void setProtocol(String protocol); void setBossGroup(EventLoopGroup bossGroup); EventLoopGroup getBossGroup(); void setWorkerGroup(EventLoopGroup workerGroup); EventLoopGroup getWorkerGroup(); EventExecutorGroup getApplicationExecutor(); void setApplicationExecutor(EventExecutorGroup applicationExecutor);  }### Answer:
@Test public void testNettyHttpHandler() throws Exception { String urlStr1 = "http: String urlStr2 = "http: NettyHttpServerEngine engine = factory.createNettyHttpServerEngine(PORT3, "http"); NettyHttpTestHandler handler1 = new NettyHttpTestHandler("test", false); NettyHttpTestHandler handler2 = new NettyHttpTestHandler("test2", false); engine.addServant(new URL(urlStr1), handler1); engine.addServant(new URL(urlStr2), handler2); String response = null; try { response = getResponse(urlStr1 + "/test"); } catch (Exception ex) { fail("Can't get the reponse from the server " + ex); } assertEquals("the netty http handler did not take effect", response, "test"); try { response = getResponse(urlStr2 + "/test"); } catch (Exception ex) { fail("Can't get the reponse from the server " + ex); } assertEquals("the netty http handler did not take effect", response, "test2"); NettyHttpServerEngineFactory.destroyForPort(PORT3); }