ConnManagerParams.setMaxConnectionsPerRoute(params, new ConnPerRouteBean(1));
ConnManagerParams.setMaxTotalConnections(params, 3);
ThreadSafeClientConnManager mgr = createTSCCM(params, null);
HttpHost target1 = new HttpHost("www.test1.invalid", 80, "http");
HttpRoute route1 = new HttpRoute(target1, null, false);
HttpHost target2 = new HttpHost("www.test2.invalid", 80, "http");
HttpRoute route2 = new HttpRoute(target2, null, false);
HttpHost target3 = new HttpHost("www.test3.invalid", 80, "http");
HttpRoute route3 = new HttpRoute(target3, null, false);
// the first three allocations should pass
ManagedClientConnection conn1 =
getConnection(mgr, route1, 10L, TimeUnit.MILLISECONDS);