public void testResponseTimeoutHandler() throws Exception {
IServer server = new HttpServer(new ServerHandler());
ConnectionUtils.start(server);
HttpClientConnection con = new HttpClientConnection("localhost", server.getLocalPort());
con.setResponseTimeoutMillis(1000);
ResponseHandler respHdl = new ResponseHandler();
HttpRequestHeader reqHdr = new HttpRequestHeader("GET", "/");
reqHdr.setHeader("sleep-time", Integer.toString(1000));
con.send(reqHdr, respHdl);
QAUtil.sleep(1500);
Assert.assertEquals(0, respHdl.getCountIOException());
Assert.assertEquals(1, respHdl.getCountSocketException());
con.close();
server.close();
}