String watermark2 = "test_"+rnd.nextInt();
writer.write(watermark2);
writer.flush();
writer.close();
InterDataRetriever ret = new InterDataRetriever();
HttpDataServer server = new HttpDataServer(
NetUtils.createSocketAddr("127.0.0.1:0"), ret);
server.start();
ret.register(qid1, qid1Dir.getPath());
ret.register(qid2, qid2Dir.getPath());
InetSocketAddress addr = server.getBindAddress();
assertDataRetrival(qid1, addr.getPort(), watermark1);
assertDataRetrival(qid2, addr.getPort(), watermark2);