camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject svn commit: r782198 - /camel/branches/camel-1.x/camel-core/src/test/java/org/apache/camel/management/MultiInstanceProcessorTest.java
Date Sat, 06 Jun 2009 07:06:06 GMT
Author: davsclaus
Date: Sat Jun  6 07:06:06 2009
New Revision: 782198

URL: http://svn.apache.org/viewvc?rev=782198&view=rev
Log:
Fixed unit test occationally failed on TC.

Modified:
    camel/branches/camel-1.x/camel-core/src/test/java/org/apache/camel/management/MultiInstanceProcessorTest.java

Modified: camel/branches/camel-1.x/camel-core/src/test/java/org/apache/camel/management/MultiInstanceProcessorTest.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-1.x/camel-core/src/test/java/org/apache/camel/management/MultiInstanceProcessorTest.java?rev=782198&r1=782197&r2=782198&view=diff
==============================================================================
--- camel/branches/camel-1.x/camel-core/src/test/java/org/apache/camel/management/MultiInstanceProcessorTest.java
(original)
+++ camel/branches/camel-1.x/camel-core/src/test/java/org/apache/camel/management/MultiInstanceProcessorTest.java
Sat Jun  6 07:06:06 2009
@@ -17,9 +17,10 @@
 package org.apache.camel.management;
 
 import java.util.Set;
-
 import javax.management.ObjectName;
 
+import org.apache.camel.Exchange;
+import org.apache.camel.Processor;
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.component.mock.MockEndpoint;
 
@@ -34,7 +35,12 @@
     protected RouteBuilder createRouteBuilder() {
         return new RouteBuilder() {
             public void configure() {
-                from("direct:start").to("mock:end").to("mock:end");
+                // must have a little delay to simulate a little processing
+                from("direct:start").process(new Processor() {
+                    public void process(Exchange exchange) throws Exception {
+                        Thread.sleep(10);
+                    }
+                }).to("mock:end").to("mock:end");
             }
         };
     }
@@ -65,7 +71,7 @@
 
         s = mbsc.queryNames(
                 new ObjectName(domainName + ":type=processors,*"), null);
-        assertEquals("Could not find 2 processor: " + s, 2, s.size());
+        assertEquals("Could not find 3 processor: " + s, 3, s.size());
 
         s = mbsc.queryNames(
                 new ObjectName(domainName + ":type=routes,*"), null);



Mime
View raw message