You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2009/06/24 09:50:21 UTC

svn commit: r787935 - /camel/trunk/camel-core/src/test/java/org/apache/camel/processor/aggregator/AggregatorRouteNumberOfProcessorTest.java

Author: davsclaus
Date: Wed Jun 24 07:50:21 2009
New Revision: 787935

URL: http://svn.apache.org/viewvc?rev=787935&view=rev
Log:
Fixed unit test failing on other platforms.

Modified:
    camel/trunk/camel-core/src/test/java/org/apache/camel/processor/aggregator/AggregatorRouteNumberOfProcessorTest.java

Modified: camel/trunk/camel-core/src/test/java/org/apache/camel/processor/aggregator/AggregatorRouteNumberOfProcessorTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/aggregator/AggregatorRouteNumberOfProcessorTest.java?rev=787935&r1=787934&r2=787935&view=diff
==============================================================================
--- camel/trunk/camel-core/src/test/java/org/apache/camel/processor/aggregator/AggregatorRouteNumberOfProcessorTest.java (original)
+++ camel/trunk/camel-core/src/test/java/org/apache/camel/processor/aggregator/AggregatorRouteNumberOfProcessorTest.java Wed Jun 24 07:50:21 2009
@@ -28,7 +28,7 @@
  */
 public class AggregatorRouteNumberOfProcessorTest extends ContextTestSupport {
 
-    private static volatile boolean failed;
+    private static volatile boolean hasOut;
 
     @Override
     public boolean isUseRouteBuilder() {
@@ -36,7 +36,7 @@
     }
 
     public void testOneProcesssor() throws Exception {
-        failed = false;
+        hasOut = false;
 
         context.addRoutes(new RouteBuilder() {
             @Override
@@ -47,17 +47,15 @@
                             if (oldExchange == null) {
                                 return newExchange;
                             }
-                                // should always be in
+                            // should always be in
                             String body = newExchange.getIn().getBody(String.class);
                             assertNotNull(body);
-                            // should not have an out
-                            failed = newExchange.hasOut();
+                            hasOut = newExchange.hasOut();
                             return newExchange;
                         }
-                    }).batchSize(2)
+                    }).batchSize(2).batchTimeout(2000)
                         .process(new Processor() {
                             public void process(Exchange exchange) throws Exception {
-                                assertFalse("Should not have out", failed);
                                 String s = exchange.getIn().getBody(String.class);
                                 exchange.getIn().setBody("Hi " + s);
                                 context.createProducerTemplate().send("mock:foo", exchange);
@@ -78,10 +76,12 @@
         template.requestBodyAndHeader("direct:start", "Willem", "id", 1);
 
         assertMockEndpointsSatisfied();
+
+        assertFalse("Should not have out", hasOut);
     }
     
     public void testThreeProcesssors() throws Exception {
-        failed = false;
+        hasOut = false;
 
         context.addRoutes(new RouteBuilder() {
             @Override
@@ -95,15 +95,13 @@
                             // should always be in
                             String body = newExchange.getIn().getBody(String.class);
                             assertNotNull(body);
-                            // should not have an out
-                            failed = newExchange.hasOut();
+                            hasOut = newExchange.hasOut();
                             return newExchange;
                         }
-                    }).batchSize(2)
+                    }).batchSize(2).batchTimeout(2000)
                         .to("log:foo")
                         .process(new Processor() {
                             public void process(Exchange exchange) throws Exception {
-                                assertFalse("Should not have out", failed);
                                 String s = exchange.getIn().getBody(String.class);
                                 exchange.getIn().setBody("Hi " + s);
                                 context.createProducerTemplate().send("mock:foo", exchange);
@@ -126,7 +124,7 @@
 
         assertMockEndpointsSatisfied();
 
-        assertFalse("Should not have out", failed);
+        assertFalse("Should not have out", hasOut);
     }
 
 }