NonBlockingConnectionPool pool = new NonBlockingConnectionPool();
for (int i = 0; i < 5; i++) {
INonBlockingConnection con = pool.getNonBlockingConnection("localhost", server.getLocalPort());
HttpClientConnection httpCon = new HttpClientConnection(con);
IHttpResponse response = httpCon.call(new GetRequest("http://localhost:" + server.getLocalPort()+ "/"));
Assert.assertEquals(200, response.getStatus());
Assert.assertEquals("12", response.getBody().readString());
}
QAUtil.sleep(1000);
Assert.assertEquals(0, pool.getNumActive());
Assert.assertEquals(5, pool.getNumDestroyed());
INonBlockingConnection con = pool.getNonBlockingConnection("localhost", server.getLocalPort());
HttpClientConnection httpCon = new HttpClientConnection(con);
IHttpResponse response = httpCon.call(new GetRequest("http://localhost:" + server.getLocalPort()+ "/"));
Assert.assertEquals(200, response.getStatus());
Assert.assertEquals("12", response.getBody().readString());