### Question:
HttpDataServer { public HttpDataServer(final InetSocketAddress addr, final DataRetriever retriever) { this.addr = addr; this.factory = new NioServerSocketChannelFactory( Executors.newCachedThreadPool(), Executors.newCachedThreadPool(), Runtime.getRuntime().availableProcessors() * 2); this.bootstrap = new ServerBootstrap(factory); this.bootstrap.setPipelineFactory( new HttpDataServerPipelineFactory(retriever)); this.channelGroup = new DefaultChannelGroup(); } HttpDataServer(final InetSocketAddress addr, 
      final DataRetriever retriever);  HttpDataServer(String bindaddr, DataRetriever retriever); void start(); InetSocketAddress getBindAddress(); void stop();  }### Answer:
@Test public final void testHttpDataServer() throws Exception { Random rnd = new Random(); FileWriter writer = new FileWriter(TEST_DATA+"/"+"testHttp"); String watermark = "test_"+rnd.nextInt(); writer.write(watermark+"\n"); writer.flush(); writer.close(); DataRetriever ret = new DirectoryRetriever(TEST_DATA); HttpDataServer server = new HttpDataServer( NetUtils.createSocketAddr("127.0.0.1:0"), ret); server.start(); InetSocketAddress addr = server.getBindAddress(); URL url = new URL("http: + "/testHttp"); BufferedReader in = new BufferedReader(new InputStreamReader( url.openStream())); String line; boolean found = false; while ((line = in.readLine()) != null) { if (line.equals(watermark)) found = true; } assertTrue(found); in.close(); server.stop(); }