use of org.apache.http.pool.ConnPoolControl in project maven-resolver by apache.
the class HttpTransporterTest method testConnectionReuse.
@Test
public void testConnectionReuse() throws Exception {
httpServer.addSslConnector();
session.setCache(new DefaultRepositoryCache());
for (int i = 0; i < 3; i++) {
newTransporter(httpServer.getHttpsUrl());
GetTask task = new GetTask(URI.create("repo/file.txt"));
transporter.get(task);
assertEquals("test", task.getDataString());
}
PoolStats stats = ((ConnPoolControl<?>) ((HttpTransporter) transporter).getState().getConnectionManager()).getTotalStats();
assertEquals(stats.toString(), 1, stats.getAvailable());
}
Aggregations