HttpServer server = new HttpServer(root);
server.setRequestTimeoutMillis(1000);
ConnectionUtils.start(server);
IBlockingConnection con = new BlockingConnection("localhost", server.getLocalPort());
con.write("POST / HTTP/1.1\r\n" +
"Host: localhost\r\n" +
"User-Agent: me\r\n" +
"Content-Length: 4\r\n" +
"\r\n" +
"1234");
String header = con.readStringByDelimiter("\r\n\r\n") + "\r\n";
int contentLength = QAUtil.readContentLength(header);
con.readByteBufferByLength(contentLength);
Assert.assertTrue(header.indexOf("200") != -1);
Assert.assertNotNull(filter.getRequest());
Assert.assertTrue(filter.getThreadName().startsWith("xWorker"));
Assert.assertTrue(rh.onRequestThreadname.startsWith("xWorker"));
con.close();
server.close();
}