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.assertTrue(header.indexOf("200") != -1);
Assert.assertEquals("OK", body);
Assert.assertNotNull(hdl.getRequest());
Assert.assertTrue(hdl.getOnRequestThreadname().startsWith("xServerPool"));
Assert.assertEquals(1, hdl.getCountOnConnect());
Assert.assertTrue(hdl.getOnConnectThreadname().startsWith("xServerPool"));
con.close();
QAUtil.sleep(200);
Assert.assertEquals(1, hdl.getCountOnDisconnect());
Assert.assertTrue(hdl.getOnConnectThreadname().startsWith("xServerPool"));