HttpClient httpClient = new HttpClient();
// send the request header and one chunk
FutureResponseHandler hdl = new FutureResponseHandler();
BodyDataSink bodySink = httpClient.send(new HttpRequestHeader("POST", "http://localhost:" + servletEngine.getLocalPort() + "/"), hdl);
bodySink.write("test");
bodySink.flush();
QAUtil.sleep(1000);
// get the response
IHttpResponse response = hdl.getResponse();
Assert.assertEquals(200, response.getStatus());
Assert.assertEquals("OK", response.getBody().readString());
bodySink.write("test2"); // will be ignored
httpClient.close();
servletEngine.stop();
}