HttpServer server = new HttpServer(new RequestHandler());
server.start();
HttpClientConnection con = new HttpClientConnection("localhost", server.getLocalPort());
IFutureResponse futureResponse = con.send(new GetRequest("http://localhost:" + server.getLocalPort() + "/?pauseMillis=500"));
try {
futureResponse.getResponse(100, TimeUnit.MILLISECONDS);
Assert.fail("SocketTimeoutException expected");
} catch (SocketTimeoutException expected) { }