hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r1696267 - /httpcomponents/httpcore/branches/4.4.x/httpcore-nio/src/test/java/org/apache/http/nio/integration/TestHttpAsyncHandlersPipelining.java
Date Mon, 17 Aug 2015 12:59:26 GMT
Author: olegk
Date: Mon Aug 17 12:59:26 2015
New Revision: 1696267

URL: http://svn.apache.org/r1696267
Log:
Fixed non-deterministic test case

Modified:
    httpcomponents/httpcore/branches/4.4.x/httpcore-nio/src/test/java/org/apache/http/nio/integration/TestHttpAsyncHandlersPipelining.java

Modified: httpcomponents/httpcore/branches/4.4.x/httpcore-nio/src/test/java/org/apache/http/nio/integration/TestHttpAsyncHandlersPipelining.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/branches/4.4.x/httpcore-nio/src/test/java/org/apache/http/nio/integration/TestHttpAsyncHandlersPipelining.java?rev=1696267&r1=1696266&r2=1696267&view=diff
==============================================================================
--- httpcomponents/httpcore/branches/4.4.x/httpcore-nio/src/test/java/org/apache/http/nio/integration/TestHttpAsyncHandlersPipelining.java
(original)
+++ httpcomponents/httpcore/branches/4.4.x/httpcore-nio/src/test/java/org/apache/http/nio/integration/TestHttpAsyncHandlersPipelining.java
Mon Aug 17 12:59:26 2015
@@ -77,7 +77,6 @@ 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;
@@ -344,7 +343,7 @@ public class TestHttpAsyncHandlersPipeli
         }
     }
 
-    @Test @Ignore
+    @Test
     public void testUnexpectedConnectionClosure() throws Exception {
         this.server.registerHandler("*", new BasicAsyncRequestHandler(new HttpRequestHandler()
{
 
@@ -376,31 +375,23 @@ public class TestHttpAsyncHandlersPipeli
         this.client.setMaxPerRoute(3);
         this.client.setMaxTotal(3);
 
-        for (int i = 0; i < 20; i++) {
+        for (int i = 0; i < 3; i++) {
 
             final HttpAsyncRequestProducer p1 = new BasicAsyncRequestProducer(target, new
BasicHttpRequest("GET", "/"));
             final HttpAsyncRequestProducer p2 = new BasicAsyncRequestProducer(target, new
BasicHttpRequest("GET", "/"));
             final HttpAsyncRequestProducer p3 = new BasicAsyncRequestProducer(target, new
BasicHttpRequest("GET", "/boom"));
-            final HttpAsyncRequestProducer p4 = new BasicAsyncRequestProducer(target, new
BasicHttpRequest("GET", "/"));
-            final HttpAsyncRequestProducer p5 = new BasicAsyncRequestProducer(target, new
BasicHttpRequest("GET", "/"));
             final List<HttpAsyncRequestProducer> requestProducers = new ArrayList<HttpAsyncRequestProducer>();
             requestProducers.add(p1);
             requestProducers.add(p2);
             requestProducers.add(p3);
-            requestProducers.add(p4);
-            requestProducers.add(p5);
 
             final HttpAsyncResponseConsumer<HttpResponse> c1 = new BasicAsyncResponseConsumer();
             final HttpAsyncResponseConsumer<HttpResponse> c2 = new BasicAsyncResponseConsumer();
             final HttpAsyncResponseConsumer<HttpResponse> c3 = new BasicAsyncResponseConsumer();
-            final HttpAsyncResponseConsumer<HttpResponse> c4 = new BasicAsyncResponseConsumer();
-            final HttpAsyncResponseConsumer<HttpResponse> c5 = new BasicAsyncResponseConsumer();
             final List<HttpAsyncResponseConsumer<HttpResponse>> responseConsumers
= new ArrayList<HttpAsyncResponseConsumer<HttpResponse>>();
             responseConsumers.add(c1);
             responseConsumers.add(c2);
             responseConsumers.add(c3);
-            responseConsumers.add(c4);
-            responseConsumers.add(c5);
 
             final Future<List<HttpResponse>> future = this.client.executePipelined(target,
requestProducers, responseConsumers, null, null);
             try {
@@ -416,10 +407,6 @@ public class TestHttpAsyncHandlersPipeli
             Assert.assertNotNull(c2.getResult());
             Assert.assertTrue(c2.isDone());
             Assert.assertNotNull(c3.getResult());
-            Assert.assertTrue(c4.isDone());
-            Assert.assertNull(c4.getResult());
-            Assert.assertTrue(c5.isDone());
-            Assert.assertNull(c5.getResult());
         }
     }
 



Mime
View raw message