}
}
@Test
public void testClientThreadPool() throws Exception {
final AsyncInvoker invoker = ClientBuilder
.newClient(new ClientConfig().property(ClientProperties.ASYNC_THREADPOOL_SIZE, 9))
.target(getBaseUri())
.path("threadpool")
.request()
.async();
final CountDownLatch latch = new CountDownLatch(100);
final int threadCount = Thread.activeCount();
final List<Thread> threads = new ArrayList<Thread>(20);
for (int i = 0; i < 20; i++) {
threads.add(new Thread(new Runnable() {
@Override
public void run() throws RuntimeException {
for (int i = 0; i < 5; i++) {
try {
assertThat(invoker.get().get().readEntity(String.class), equalTo("GET"));
assertThat(Thread.activeCount() - threadCount - 20, lessThanOrEqualTo(10));
latch.countDown();
} catch (final InterruptedException e) {
fail();
} catch (final ExecutionException e) {