use of io.vertx.core.http.ConnectionPoolTooBusyException in project vert.x by eclipse.
the class ConnectionPoolTest method testMaxWaiters.
@Test
public void testMaxWaiters() {
ConnectionManager mgr = new ConnectionManager();
ConnectionPool<Connection> pool = ConnectionPool.pool(mgr, new int[] { 1 }, 5);
EventLoopContext ctx = vertx.createEventLoopContext();
for (int i = 0; i < (5); i++) {
pool.acquire(ctx, 0, ar -> fail());
}
pool.acquire(ctx, 0, onFailure(err -> {
assertTrue(err instanceof ConnectionPoolTooBusyException);
testComplete();
}));
await();
}
Aggregations