MultithreadedHandler hdl = new MultithreadedHandler();
// start xSocket
Context ctx = new Context("");
ctx.addHandler("/ctx1/*", hdl);
Server server = new HttpServer(ctx);
ConnectionUtils.start(server);
GetRequest req = new GetRequest("http://localhost:" + server.getLocalPort() + "/ctx1/test/test2");
req.setHeader("Host", "localhost");
req.setHeader("User-Agent", "me");
IBlockingConnection con = new BlockingConnection("localhost", server.getLocalPort());
con.write(req.toString());
String header = con.readStringByDelimiter("\r\n\r\n") + "\r\n";
int contentLength = QAUtil.readContentLength(header);
String body = con.readStringByLength(contentLength);
Assert.assertEquals("OK", body);
System.out.println(hdl.getOnRequestThreadname());
Assert.assertTrue(hdl.getOnRequestThreadname().startsWith("xServerPool"));
con.close();
server.close();
}