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/01/15 11:18:08 UTC

svn commit: r734656 - /activemq/camel/branches/camel-1.x/camel-core/src/test/java/org/apache/camel/component/seda/SedaConsumerStartStopTest.java

Author: davsclaus
Date: Thu Jan 15 02:18:08 2009
New Revision: 734656

URL: http://svn.apache.org/viewvc?rev=734656&view=rev
Log:
Aligned unit test with camel 2.0 to fix failing in 1.x reported by teamcity

Modified:
    activemq/camel/branches/camel-1.x/camel-core/src/test/java/org/apache/camel/component/seda/SedaConsumerStartStopTest.java

Modified: activemq/camel/branches/camel-1.x/camel-core/src/test/java/org/apache/camel/component/seda/SedaConsumerStartStopTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/branches/camel-1.x/camel-core/src/test/java/org/apache/camel/component/seda/SedaConsumerStartStopTest.java?rev=734656&r1=734655&r2=734656&view=diff
==============================================================================
--- activemq/camel/branches/camel-1.x/camel-core/src/test/java/org/apache/camel/component/seda/SedaConsumerStartStopTest.java (original)
+++ activemq/camel/branches/camel-1.x/camel-core/src/test/java/org/apache/camel/component/seda/SedaConsumerStartStopTest.java Thu Jan 15 02:18:08 2009
@@ -43,9 +43,11 @@
         executor.execute(new Runnable() {
             public void run() {
                 for (int i = 0; i < 20; i++) {
+                    // when this delay is removed, the seda endpoint has ordering issues
                     try {
                         // do some random sleep to simulate spread in user activity
-                        Thread.sleep(new Random().nextInt(10));
+                        // range is 5-15
+                        Thread.sleep(new Random().nextInt(10) + 5);
                     } catch (InterruptedException e) {
                         // ignore
                     }
@@ -74,7 +76,7 @@
             if (i == 10) {
                 // stop while sending, and then start again to pickup what is left in the queue
                 consumer.stop();
-                Thread.sleep(1000);
+                Thread.sleep(900);
                 consumer.start();
             }
             // use 1000 as timeout otherwise we might get null if the consumer hasn't been started again
@@ -84,5 +86,4 @@
 
         assertMockEndpointsSatisfied();
     }
-
-}
+}
\ No newline at end of file