Disabled test case failing intermittently due to a bug in HttpCore 4.4
git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpasyncclient/trunk@1658394 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/httpasyncclient/src/test/java/org/apache/http/nio/client/integration/TestHttpAsyncPipelining.java b/httpasyncclient/src/test/java/org/apache/http/nio/client/integration/TestHttpAsyncPipelining.java
index 80830d7..d7b739c 100644
--- a/httpasyncclient/src/test/java/org/apache/http/nio/client/integration/TestHttpAsyncPipelining.java
+++ b/httpasyncclient/src/test/java/org/apache/http/nio/client/integration/TestHttpAsyncPipelining.java
@@ -56,6 +56,7 @@
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 @@
}
- @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);
+ 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 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);
+ 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());
}
- 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());
+
}
}