File tree 2 files changed +1
-43
lines changed
src/test/java/com/ning/http/client/async 2 files changed +1
-43
lines changed Original file line number Diff line number Diff line change @@ -1182,6 +1182,7 @@ public void onThrowable(Throwable t) {
1182
1182
1183
1183
try {
1184
1184
response .getResponseBody ();
1185
+
1185
1186
fail ();
1186
1187
} catch (IllegalStateException e ) {
1187
1188
assertNotNull (e .getMessage ());
Original file line number Diff line number Diff line change @@ -286,49 +286,6 @@ public void multipleMaxConnectionOpenTestWithQuery() throws Throwable {
286
286
c .close ();
287
287
}
288
288
289
- @ Test (groups = {"default_provider" , "async" })
290
- public void asyncDoGetMaxConnectionsTest () throws Throwable {
291
- AsyncHttpClient client = new AsyncHttpClient (new AsyncHttpClientConfig .Builder ().setMaximumConnectionsTotal (2 ).build ());
292
-
293
- // Use a l in case the assert fail
294
- final CountDownLatch l = new CountDownLatch (2 );
295
-
296
- AsyncCompletionHandler <Response > handler = new AsyncCompletionHandlerAdapter () {
297
-
298
- @ Override
299
- public Response onCompleted (Response response ) throws Exception {
300
- l .countDown ();
301
- return response ;
302
- }
303
-
304
- @ Override
305
- public void onThrowable (Throwable t ) {
306
- try {
307
- Assert .fail ("Unexpected exception" , t );
308
- } finally {
309
- l .countDown ();
310
- }
311
- }
312
- };
313
-
314
- client .prepareGet (getTargetUrl ()).execute (handler );
315
- client .prepareGet (getTargetUrl ()).execute (handler );
316
-
317
- try {
318
- client .prepareGet (getTargetUrl ()).execute (handler ).get ();
319
- Assert .fail ();
320
- } catch (IOException ex ) {
321
- String s = ex .getMessage ();
322
- assertEquals (s , "Too many connections 2" );
323
- }
324
-
325
-
326
- if (!l .await (TIMEOUT , TimeUnit .SECONDS )) {
327
- Assert .fail ("Timed out" );
328
- }
329
- client .close ();
330
- }
331
-
332
289
/**
333
290
* This test just make sure the hack used to catch disconnected channel under win7 doesn't throw any exception.
334
291
* The onComplete method must be only called once.
You can’t perform that action at this time.
0 commit comments