@@ -0,0 +1,1942 @@
+/*%0A * Copyright 2010 Ning, Inc.%0A *%0A * Ning licenses this file to you under the Apache License, version 2.0%0A * (the %22License%22); you may not use this file except in compliance with the%0A * License.  You may obtain a copy of the License at:%0A *%0A *    http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS, WITHOUT%0A * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the%0A * License for the specific language governing permissions and limitations%0A * under the License.%0A */%0Apackage com.ning.http.client.async;%0A%0Aimport com.ning.http.client.AsyncHttpClient;%0Aimport com.ning.http.client.AsyncHttpClientConfig;%0Aimport com.ning.http.client.Response;%0Aimport com.ning.http.client.logging.LogManager;%0Aimport com.ning.http.client.logging.Logger;%0Aimport org.testng.annotations.Test;%0A%0Apublic class ConnectionPoorTest extends AbstractBasicTest%7B%0A    protected final Logger log = LogManager.getLogger(AbstractBasicTest.class);%0A   %0A    @Test%0A    public void testMaxTotalConnections() %7B%0A        AsyncHttpClient client = new AsyncHttpClient(%0A                new AsyncHttpClientConfig.Builder()%0A                        .setConnectionTimeoutInMs(100)%0A                        .setRequestTimeoutInMs(100)%0A                        .setKeepAlive(true)%0A                        .setMaximumConnectionsTotal(30)%0A                        .build()%0A        );%0A%0A        String url = getTargetUrl();%0A        for (int i = 0; i %3C 50; i++) %7B%0A            try %7B%0A                log.info(String.format(%22%25d requesting url %5B%25s%5D...%22, i, url));%0A                Response response = client.prepareGet(url).execute().get();%0A                log.info(String.format(%22%25d response %5B%25s%5D.%22, i, response));%0A            %7D catch (Exception e) %7B%0A                log.error(String.format(%22%25d error: %25s%22, i, e.getMessage()));%0A            %7D%0A        %7D%0A    %7D%0A%0A%7D%0A

Add a unit test for trying to cover issue http://github.com/AsyncHttpClient/async-http-client/issues#issue/33