hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r1658394 - /httpcomponents/httpasyncclient/trunk/httpasyncclient/src/test/java/org/apache/http/nio/client/integration/TestHttpAsyncPipelining.java
Date Mon, 09 Feb 2015 13:11:05 GMT
Author: olegk
Date: Mon Feb  9 13:11:05 2015
New Revision: 1658394

URL: http://svn.apache.org/r1658394
Log:
Disabled test case failing intermittently due to a bug in HttpCore 4.4

Modified:
    httpcomponents/httpasyncclient/trunk/httpasyncclient/src/test/java/org/apache/http/nio/client/integration/TestHttpAsyncPipelining.java

Modified: httpcomponents/httpasyncclient/trunk/httpasyncclient/src/test/java/org/apache/http/nio/client/integration/TestHttpAsyncPipelining.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpasyncclient/trunk/httpasyncclient/src/test/java/org/apache/http/nio/client/integration/TestHttpAsyncPipelining.java?rev=1658394&r1=1658393&r2=1658394&view=diff
==============================================================================
--- httpcomponents/httpasyncclient/trunk/httpasyncclient/src/test/java/org/apache/http/nio/client/integration/TestHttpAsyncPipelining.java
(original)
+++ httpcomponents/httpasyncclient/trunk/httpasyncclient/src/test/java/org/apache/http/nio/client/integration/TestHttpAsyncPipelining.java
Mon Feb  9 13:11:05 2015
@@ -56,6 +56,7 @@ import org.apache.http.util.EntityUtils;
 import org.junit.After;
 import org.junit.Assert;
 import org.junit.Before;
+import org.junit.Ignore;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.junit.runners.Parameterized;
@@ -177,49 +178,52 @@ public class TestHttpAsyncPipelining ext
 
     }
 
-    @Test
+    @Test @Ignore //TODO: re-enable afyer upgrade to HttpCore 4.4.1
     public void testPipelinedRequestsUnexpectedConnectionClosure() throws Exception {
         final HttpHost target = start();
 
-        final HttpAsyncRequestProducer p1 = HttpAsyncMethods.create(target, new HttpGet("/random/512"));
-        final HttpAsyncRequestProducer p2 = HttpAsyncMethods.create(target, new HttpGet("/pampa"));
-        final HttpAsyncRequestProducer p3 = HttpAsyncMethods.create(target, new HttpGet("/random/512"));
-        final HttpAsyncRequestProducer p4 = HttpAsyncMethods.create(target, new HttpGet("/random/512"));
-        final List<HttpAsyncRequestProducer> requestProducers = new ArrayList<HttpAsyncRequestProducer>();
-        requestProducers.add(p1);
-        requestProducers.add(p2);
-        requestProducers.add(p3);
-        requestProducers.add(p4);
-
-        final HttpAsyncResponseConsumer<HttpResponse> c1 = HttpAsyncMethods.createConsumer();
-        final HttpAsyncResponseConsumer<HttpResponse> c2 = HttpAsyncMethods.createConsumer();
-        final HttpAsyncResponseConsumer<HttpResponse> c3 = HttpAsyncMethods.createConsumer();
-        final HttpAsyncResponseConsumer<HttpResponse> c4 = HttpAsyncMethods.createConsumer();
-        final List<HttpAsyncResponseConsumer<HttpResponse>> responseConsumers
= new ArrayList<HttpAsyncResponseConsumer<HttpResponse>>();
-        responseConsumers.add(c1);
-        responseConsumers.add(c2);
-        responseConsumers.add(c3);
-        responseConsumers.add(c4);
-
-        final Future<List<HttpResponse>> future = this.httpclient.execute(
-                target,
-                requestProducers,
-                responseConsumers,
-                null, null);
-        try {
-            future.get();
-        } catch (ExecutionException ex) {
-            final Throwable cause = ex.getCause();
-            Assert.assertTrue(cause instanceof ConnectionClosedException);
-        }
-        Assert.assertTrue(c1.isDone());
-        Assert.assertNotNull(c1.getResult());
-        Assert.assertTrue(c2.isDone());
-        Assert.assertNotNull(c2.getResult());
-        Assert.assertTrue(c3.isDone());
-        Assert.assertNull(c3.getResult());
-        Assert.assertTrue(c4.isDone());
-        Assert.assertNull(c4.getResult());
+        for (int i = 0; i < 20; i++) {
+            final HttpAsyncRequestProducer p1 = HttpAsyncMethods.create(target, new HttpGet("/random/512"));
+            final HttpAsyncRequestProducer p2 = HttpAsyncMethods.create(target, new HttpGet("/pampa"));
+            final HttpAsyncRequestProducer p3 = HttpAsyncMethods.create(target, new HttpGet("/random/512"));
+            final HttpAsyncRequestProducer p4 = HttpAsyncMethods.create(target, new HttpGet("/random/512"));
+            final List<HttpAsyncRequestProducer> requestProducers = new ArrayList<HttpAsyncRequestProducer>();
+            requestProducers.add(p1);
+            requestProducers.add(p2);
+            requestProducers.add(p3);
+            requestProducers.add(p4);
+
+            final HttpAsyncResponseConsumer<HttpResponse> c1 = HttpAsyncMethods.createConsumer();
+            final HttpAsyncResponseConsumer<HttpResponse> c2 = HttpAsyncMethods.createConsumer();
+            final HttpAsyncResponseConsumer<HttpResponse> c3 = HttpAsyncMethods.createConsumer();
+            final HttpAsyncResponseConsumer<HttpResponse> c4 = HttpAsyncMethods.createConsumer();
+            final List<HttpAsyncResponseConsumer<HttpResponse>> responseConsumers
= new ArrayList<HttpAsyncResponseConsumer<HttpResponse>>();
+            responseConsumers.add(c1);
+            responseConsumers.add(c2);
+            responseConsumers.add(c3);
+            responseConsumers.add(c4);
+
+            final Future<List<HttpResponse>> future = this.httpclient.execute(
+                    target,
+                    requestProducers,
+                    responseConsumers,
+                    null, null);
+            try {
+                future.get();
+            } catch (ExecutionException ex) {
+                final Throwable cause = ex.getCause();
+                Assert.assertTrue(cause instanceof ConnectionClosedException);
+            }
+            Assert.assertTrue(c1.isDone());
+            Assert.assertNotNull(c1.getResult());
+            Assert.assertTrue(c2.isDone());
+            Assert.assertNotNull(c2.getResult());
+            Assert.assertTrue(c3.isDone());
+            Assert.assertNull(c3.getResult());
+            Assert.assertTrue(c4.isDone());
+            Assert.assertNull(c4.getResult());
+        }
+
     }
 
 }



Mime
View raw message