camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject camel git commit: CAMEL-11446: Use awaitility for testing where we otherwise use thred sleep which can be speeded up.
Date Sun, 16 Jul 2017 10:01:46 GMT
Repository: camel
Updated Branches:
  refs/heads/master 4d40a3463 -> fd73931f3


CAMEL-11446: Use awaitility for testing where we otherwise use thred sleep which can be speeded
up.


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/fd73931f
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/fd73931f
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/fd73931f

Branch: refs/heads/master
Commit: fd73931f301db2b0347613376d04e82904102dec
Parents: 4d40a34
Author: Claus Ibsen <davsclaus@apache.org>
Authored: Sun Jul 16 12:01:34 2017 +0200
Committer: Claus Ibsen <davsclaus@apache.org>
Committed: Sun Jul 16 12:01:34 2017 +0200

----------------------------------------------------------------------
 .../TimerDrivenTimePatternConverterTest.java        |  6 +++---
 .../apache/camel/management/ManagedDelayerTest.java | 12 ++++++------
 .../processor/ComposedMessageProcessorTest.java     |  2 +-
 ...dLetterChannelRedeliveringWhileShutdownTest.java |  2 +-
 .../DefaultErrorHandlerRedeliveryTest.java          |  4 ++--
 .../camel/processor/DelayInterceptorTest.java       | 16 +++++-----------
 .../RedeliveryErrorHandlerBlockedDelayTest.java     |  2 +-
 .../RedeliveryErrorHandlerLogHandledTest.java       |  1 +
 .../RedeliveryErrorHandlerNonBlockedDelayTest.java  |  2 +-
 .../aggregator/AggregateCompleteAllOnStopTest.java  |  2 +-
 .../aggregator/AggregateExpressionTimeoutTest.java  |  4 ++--
 ...ggregatePreCompleteAwareStrategyTimeoutTest.java |  2 +-
 .../aggregator/AggregateSimpleTimeoutTest.java      |  4 ++--
 .../aggregator/AggregateTimeoutOnlyTest.java        |  8 ++++----
 .../processor/aggregator/AggregateTimeoutTest.java  | 12 ++++++------
 .../AggregateTimeoutWithExecutorServiceTest.java    |  5 +++--
 .../AggregateTimeoutWithNoExecutorServiceTest.java  |  5 +++--
 .../aggregator/AggregatorExceptionHandleTest.java   |  2 +-
 .../processor/aggregator/AlbertoAggregatorTest.java | 14 ++++++++------
 ...eptionRetryUntilWithDefaultErrorHandlerTest.java |  1 +
 .../org/apache/camel/util/EndpointHelperTest.java   |  3 ++-
 .../spring/interceptor/DelayerInterceptorTest.java  |  8 ++++----
 .../spring/interceptor/delayerInterceptorTest.xml   |  2 +-
 .../SpringAggregateExpressionTimeoutTest.xml        |  2 +-
 .../aggregator/SpringAggregateSimpleTimeoutTest.xml |  2 +-
 25 files changed, 62 insertions(+), 61 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/fd73931f/camel-core/src/test/java/org/apache/camel/converter/TimerDrivenTimePatternConverterTest.java
----------------------------------------------------------------------
diff --git a/camel-core/src/test/java/org/apache/camel/converter/TimerDrivenTimePatternConverterTest.java
b/camel-core/src/test/java/org/apache/camel/converter/TimerDrivenTimePatternConverterTest.java
index f597219..ceae896 100644
--- a/camel-core/src/test/java/org/apache/camel/converter/TimerDrivenTimePatternConverterTest.java
+++ b/camel-core/src/test/java/org/apache/camel/converter/TimerDrivenTimePatternConverterTest.java
@@ -41,15 +41,15 @@ public class TimerDrivenTimePatternConverterTest extends ContextTestSupport
{
         assertMockEndpointsSatisfied();
         long interval = watch.taken();
         
-        LOG.trace("Should take approx 2000 milliseconds, was: {}", interval);
-        assertTrue("Should take approx 2000 milliseconds, was: " + interval, interval >=
1700);
+        LOG.trace("Should take approx 50 milliseconds, was: {}", interval);
+        assertTrue("Should take approx 50 milliseconds, was: " + interval, interval >=
40);
     }
     
     @Override
     protected RouteBuilder createRouteBuilder() throws Exception {
         return new RouteBuilder() {
             public void configure() {
-                from("timer://foo?fixedRate=true&delay=0&period=2s").to("mock:result");
+                from("timer://foo?fixedRate=true&delay=0&period=50").to("mock:result");
             }
         };
     } 

http://git-wip-us.apache.org/repos/asf/camel/blob/fd73931f/camel-core/src/test/java/org/apache/camel/management/ManagedDelayerTest.java
----------------------------------------------------------------------
diff --git a/camel-core/src/test/java/org/apache/camel/management/ManagedDelayerTest.java
b/camel-core/src/test/java/org/apache/camel/management/ManagedDelayerTest.java
index db77717..574f0cd 100644
--- a/camel-core/src/test/java/org/apache/camel/management/ManagedDelayerTest.java
+++ b/camel-core/src/test/java/org/apache/camel/management/ManagedDelayerTest.java
@@ -52,11 +52,11 @@ public class ManagedDelayerTest extends ManagementTestSupport {
         Long last = (Long) mbeanServer.getAttribute(routeName, "LastProcessingTime");
         Long total = (Long) mbeanServer.getAttribute(routeName, "TotalProcessingTime");
 
-        assertTrue("Should take around 1 sec: was " + last, last > 900);
-        assertTrue("Should take around 1 sec: was " + total, total > 900);
+        assertTrue("Should take around 0.1 sec: was " + last, last > 90);
+        assertTrue("Should take around 0.1 sec: was " + total, total > 90);
 
         // change the delay time using JMX
-        mbeanServer.invoke(delayerName, "constantDelay", new Object[]{2000}, new String[]{"java.lang.Integer"});
+        mbeanServer.invoke(delayerName, "constantDelay", new Object[]{200}, new String[]{"java.lang.Integer"});
 
         // send in another message
         template.sendBody("direct:start", "Bye World");
@@ -69,8 +69,8 @@ public class ManagedDelayerTest extends ManagementTestSupport {
         last = (Long) mbeanServer.getAttribute(routeName, "LastProcessingTime");
         total = (Long) mbeanServer.getAttribute(routeName, "TotalProcessingTime");
 
-        assertTrue("Should take around 2 sec: was " + last, last > 1900);
-        assertTrue("Should be around 3 sec now: was " + total, total > 2900);
+        assertTrue("Should take around 0.2 sec: was " + last, last > 190);
+        assertTrue("Should be around 0.3 sec now: was " + total, total > 290);
     }
 
     @Override
@@ -80,7 +80,7 @@ public class ManagedDelayerTest extends ManagementTestSupport {
             public void configure() throws Exception {
                 from("direct:start")
                     .to("log:foo")
-                    .delay(1000).id("mydelayer")
+                    .delay(100).id("mydelayer")
                     .to("mock:result");
             }
         };

http://git-wip-us.apache.org/repos/asf/camel/blob/fd73931f/camel-core/src/test/java/org/apache/camel/processor/ComposedMessageProcessorTest.java
----------------------------------------------------------------------
diff --git a/camel-core/src/test/java/org/apache/camel/processor/ComposedMessageProcessorTest.java
b/camel-core/src/test/java/org/apache/camel/processor/ComposedMessageProcessorTest.java
index 7a0a748..068c50e 100644
--- a/camel-core/src/test/java/org/apache/camel/processor/ComposedMessageProcessorTest.java
+++ b/camel-core/src/test/java/org/apache/camel/processor/ComposedMessageProcessorTest.java
@@ -95,7 +95,7 @@ public class ComposedMessageProcessorTest extends ContextTestSupport {
                 
                 // collect and re-assemble the validated OrderItems into an order again
                 from("seda:aggregate")
-                    .aggregate(new MyOrderAggregationStrategy()).header("orderId").completionTimeout(1000L)
+                    .aggregate(new MyOrderAggregationStrategy()).header("orderId").completionTimeout(100).completionTimeoutCheckerInterval(10)
                         .to("mock:result");
                 // END SNIPPET: e2
             }

http://git-wip-us.apache.org/repos/asf/camel/blob/fd73931f/camel-core/src/test/java/org/apache/camel/processor/DeadLetterChannelRedeliveringWhileShutdownTest.java
----------------------------------------------------------------------
diff --git a/camel-core/src/test/java/org/apache/camel/processor/DeadLetterChannelRedeliveringWhileShutdownTest.java
b/camel-core/src/test/java/org/apache/camel/processor/DeadLetterChannelRedeliveringWhileShutdownTest.java
index eb3cc1d..cd894c8 100644
--- a/camel-core/src/test/java/org/apache/camel/processor/DeadLetterChannelRedeliveringWhileShutdownTest.java
+++ b/camel-core/src/test/java/org/apache/camel/processor/DeadLetterChannelRedeliveringWhileShutdownTest.java
@@ -46,7 +46,7 @@ public class DeadLetterChannelRedeliveringWhileShutdownTest extends ContextTestS
         return new RouteBuilder() {
             @Override
             public void configure() throws Exception {
-                errorHandler(deadLetterChannel("mock:error").maximumRedeliveries(3).redeliveryDelay(1000));
+                errorHandler(deadLetterChannel("mock:error").maximumRedeliveries(3).redeliveryDelay(100));
 
                 from("direct:start").to("mock:result");
 

http://git-wip-us.apache.org/repos/asf/camel/blob/fd73931f/camel-core/src/test/java/org/apache/camel/processor/DefaultErrorHandlerRedeliveryTest.java
----------------------------------------------------------------------
diff --git a/camel-core/src/test/java/org/apache/camel/processor/DefaultErrorHandlerRedeliveryTest.java
b/camel-core/src/test/java/org/apache/camel/processor/DefaultErrorHandlerRedeliveryTest.java
index 73c40a8..ebdbb10 100644
--- a/camel-core/src/test/java/org/apache/camel/processor/DefaultErrorHandlerRedeliveryTest.java
+++ b/camel-core/src/test/java/org/apache/camel/processor/DefaultErrorHandlerRedeliveryTest.java
@@ -72,7 +72,7 @@ public class DefaultErrorHandlerRedeliveryTest extends ContextTestSupport
{
         return new RouteBuilder() {
             public void configure() throws Exception {
                 from("direct:start")
-                    .errorHandler(defaultErrorHandler().maximumRedeliveries(2))
+                    .errorHandler(defaultErrorHandler().redeliveryDelay(0).maximumRedeliveries(2))
                     .process(new Processor() {
                         public void process(Exchange exchange) throws Exception {
                             counter++;
@@ -89,7 +89,7 @@ public class DefaultErrorHandlerRedeliveryTest extends ContextTestSupport
{
                     });
 
                 from("direct:one")
-                    .errorHandler(defaultErrorHandler().maximumRedeliveries(1))
+                    .errorHandler(defaultErrorHandler().redeliveryDelay(0).maximumRedeliveries(1))
                     .process(new Processor() {
                         public void process(Exchange exchange) throws Exception {
                             counter++;

http://git-wip-us.apache.org/repos/asf/camel/blob/fd73931f/camel-core/src/test/java/org/apache/camel/processor/DelayInterceptorTest.java
----------------------------------------------------------------------
diff --git a/camel-core/src/test/java/org/apache/camel/processor/DelayInterceptorTest.java
b/camel-core/src/test/java/org/apache/camel/processor/DelayInterceptorTest.java
index 1ea6eea..1fcae60 100644
--- a/camel-core/src/test/java/org/apache/camel/processor/DelayInterceptorTest.java
+++ b/camel-core/src/test/java/org/apache/camel/processor/DelayInterceptorTest.java
@@ -28,29 +28,23 @@ import org.apache.camel.builder.RouteBuilder;
  */
 public class DelayInterceptorTest extends ContextTestSupport {
 
-    public void testSendingSomeMessages() throws Exception {
+    public void testDelayer() throws Exception {
         long start = System.currentTimeMillis();
         for (int i = 0; i < 10; i++) {
             template.sendBody("direct:start", "Message #" + i);
         }
         long delta = System.currentTimeMillis() - start;
-        assertTrue("Should not be that fast to run: " + delta, delta > 3800);
+        assertTrue("Should not be that fast to run: " + delta, delta > 100);
         // some OS boxes are slow
-        assertTrue("Should not take that long to run: " + delta, delta < 11000);
-    }
-
-    @Override
-    protected void setUp() throws Exception {
-        disableJMX();
-        super.setUp();
+        assertTrue("Should not take that long to run: " + delta, delta < 5000);
     }
 
     protected RouteBuilder createRouteBuilder() throws Exception {
         return new RouteBuilder() {
             // START SNIPPET: e1
             public void configure() throws Exception {
-                // configure delayer for each step 200 millis
-                getContext().setDelayer(200L);
+                // configure delayer for each step 10 millis
+                getContext().setDelayer(10L);
 
                 // regular routes here
 

http://git-wip-us.apache.org/repos/asf/camel/blob/fd73931f/camel-core/src/test/java/org/apache/camel/processor/RedeliveryErrorHandlerBlockedDelayTest.java
----------------------------------------------------------------------
diff --git a/camel-core/src/test/java/org/apache/camel/processor/RedeliveryErrorHandlerBlockedDelayTest.java
b/camel-core/src/test/java/org/apache/camel/processor/RedeliveryErrorHandlerBlockedDelayTest.java
index 95f1e85..3742a03 100644
--- a/camel-core/src/test/java/org/apache/camel/processor/RedeliveryErrorHandlerBlockedDelayTest.java
+++ b/camel-core/src/test/java/org/apache/camel/processor/RedeliveryErrorHandlerBlockedDelayTest.java
@@ -54,7 +54,7 @@ public class RedeliveryErrorHandlerBlockedDelayTest extends ContextTestSupport
{
             public void configure() throws Exception {
                 // will by default block
                 errorHandler(defaultErrorHandler()
-                    .maximumRedeliveries(5).redeliveryDelay(2000));
+                    .maximumRedeliveries(5).redeliveryDelay(10));
 
                 from("seda:start")
                     .to("log:before")

http://git-wip-us.apache.org/repos/asf/camel/blob/fd73931f/camel-core/src/test/java/org/apache/camel/processor/RedeliveryErrorHandlerLogHandledTest.java
----------------------------------------------------------------------
diff --git a/camel-core/src/test/java/org/apache/camel/processor/RedeliveryErrorHandlerLogHandledTest.java
b/camel-core/src/test/java/org/apache/camel/processor/RedeliveryErrorHandlerLogHandledTest.java
index c72f10c..3404ba4 100644
--- a/camel-core/src/test/java/org/apache/camel/processor/RedeliveryErrorHandlerLogHandledTest.java
+++ b/camel-core/src/test/java/org/apache/camel/processor/RedeliveryErrorHandlerLogHandledTest.java
@@ -159,6 +159,7 @@ public class RedeliveryErrorHandlerLogHandledTest extends ContextTestSupport
{
             @Override
             public void configure() throws Exception {
                 errorHandler(defaultErrorHandler()
+                        .redeliveryDelay(0)
                         .maximumRedeliveries(3)
                         .logExhausted(true).logHandled(true).logRetryStackTrace(true).logStackTrace(true)
                         .retryAttemptedLogLevel(LoggingLevel.WARN).retriesExhaustedLogLevel(LoggingLevel.ERROR));

http://git-wip-us.apache.org/repos/asf/camel/blob/fd73931f/camel-core/src/test/java/org/apache/camel/processor/RedeliveryErrorHandlerNonBlockedDelayTest.java
----------------------------------------------------------------------
diff --git a/camel-core/src/test/java/org/apache/camel/processor/RedeliveryErrorHandlerNonBlockedDelayTest.java
b/camel-core/src/test/java/org/apache/camel/processor/RedeliveryErrorHandlerNonBlockedDelayTest.java
index 309bf74..b199616 100644
--- a/camel-core/src/test/java/org/apache/camel/processor/RedeliveryErrorHandlerNonBlockedDelayTest.java
+++ b/camel-core/src/test/java/org/apache/camel/processor/RedeliveryErrorHandlerNonBlockedDelayTest.java
@@ -53,7 +53,7 @@ public class RedeliveryErrorHandlerNonBlockedDelayTest extends ContextTestSuppor
             @Override
             public void configure() throws Exception {
                 // use async delayed which means non blocking
-                errorHandler(defaultErrorHandler().maximumRedeliveries(5).redeliveryDelay(2000).asyncDelayedRedelivery());
+                errorHandler(defaultErrorHandler().maximumRedeliveries(5).redeliveryDelay(10).asyncDelayedRedelivery());
 
                 from("seda:start")
                     .to("log:before")

http://git-wip-us.apache.org/repos/asf/camel/blob/fd73931f/camel-core/src/test/java/org/apache/camel/processor/aggregator/AggregateCompleteAllOnStopTest.java
----------------------------------------------------------------------
diff --git a/camel-core/src/test/java/org/apache/camel/processor/aggregator/AggregateCompleteAllOnStopTest.java
b/camel-core/src/test/java/org/apache/camel/processor/aggregator/AggregateCompleteAllOnStopTest.java
index e2d1405..37487af 100644
--- a/camel-core/src/test/java/org/apache/camel/processor/aggregator/AggregateCompleteAllOnStopTest.java
+++ b/camel-core/src/test/java/org/apache/camel/processor/aggregator/AggregateCompleteAllOnStopTest.java
@@ -49,7 +49,7 @@ public class AggregateCompleteAllOnStopTest extends ContextTestSupport {
             public void configure() throws Exception {
                 from("seda:start").routeId("foo")
                         .aggregate(header("id"), new BodyInAggregatingStrategy()).aggregationRepository(new
MemoryAggregationRepository())
-                        .completionSize(2).completionTimeout(2000).completeAllOnStop()
+                        .completionSize(2).completionTimeout(100).completeAllOnStop().completionTimeoutCheckerInterval(10)
                         .to("mock:aggregated");
             }
         };

http://git-wip-us.apache.org/repos/asf/camel/blob/fd73931f/camel-core/src/test/java/org/apache/camel/processor/aggregator/AggregateExpressionTimeoutTest.java
----------------------------------------------------------------------
diff --git a/camel-core/src/test/java/org/apache/camel/processor/aggregator/AggregateExpressionTimeoutTest.java
b/camel-core/src/test/java/org/apache/camel/processor/aggregator/AggregateExpressionTimeoutTest.java
index b2c5c5a..f463be2 100644
--- a/camel-core/src/test/java/org/apache/camel/processor/aggregator/AggregateExpressionTimeoutTest.java
+++ b/camel-core/src/test/java/org/apache/camel/processor/aggregator/AggregateExpressionTimeoutTest.java
@@ -33,7 +33,7 @@ public class AggregateExpressionTimeoutTest extends ContextTestSupport {
 
         Map<String, Object> headers = new HashMap<String, Object>();
         headers.put("id", 123);
-        headers.put("timeout", 2000);
+        headers.put("timeout", 100);
 
         template.sendBodyAndHeaders("direct:start", "A", headers);
         template.sendBodyAndHeaders("direct:start", "B", headers);
@@ -53,7 +53,7 @@ public class AggregateExpressionTimeoutTest extends ContextTestSupport {
                     // Aggregate them using the BodyInAggregatingStrategy strategy which
                     // and the timeout header contains the timeout in millis of inactivity
them timeout and complete the aggregation
                     // and send it to mock:aggregated
-                    .aggregate(header("id"), new BodyInAggregatingStrategy()).completionTimeout(header("timeout"))
+                    .aggregate(header("id"), new BodyInAggregatingStrategy()).completionTimeout(header("timeout")).completionTimeoutCheckerInterval(10)
                         .to("mock:aggregated");
                 // END SNIPPET: e1
             }

http://git-wip-us.apache.org/repos/asf/camel/blob/fd73931f/camel-core/src/test/java/org/apache/camel/processor/aggregator/AggregatePreCompleteAwareStrategyTimeoutTest.java
----------------------------------------------------------------------
diff --git a/camel-core/src/test/java/org/apache/camel/processor/aggregator/AggregatePreCompleteAwareStrategyTimeoutTest.java
b/camel-core/src/test/java/org/apache/camel/processor/aggregator/AggregatePreCompleteAwareStrategyTimeoutTest.java
index ffcb03f..74d127b 100644
--- a/camel-core/src/test/java/org/apache/camel/processor/aggregator/AggregatePreCompleteAwareStrategyTimeoutTest.java
+++ b/camel-core/src/test/java/org/apache/camel/processor/aggregator/AggregatePreCompleteAwareStrategyTimeoutTest.java
@@ -68,7 +68,7 @@ public class AggregatePreCompleteAwareStrategyTimeoutTest extends ContextTestSup
             @Override
             public void configure() throws Exception {
                 from("direct:start")
-                    .aggregate(header("id"), new BodyInPreCompleteAggregatingStrategy()).completionTimeout(1000)
+                    .aggregate(header("id"), new BodyInPreCompleteAggregatingStrategy()).completionTimeout(100).completionTimeoutCheckerInterval(10)
                         .to("mock:aggregated");
             }
         };

http://git-wip-us.apache.org/repos/asf/camel/blob/fd73931f/camel-core/src/test/java/org/apache/camel/processor/aggregator/AggregateSimpleTimeoutTest.java
----------------------------------------------------------------------
diff --git a/camel-core/src/test/java/org/apache/camel/processor/aggregator/AggregateSimpleTimeoutTest.java
b/camel-core/src/test/java/org/apache/camel/processor/aggregator/AggregateSimpleTimeoutTest.java
index 428ca46..fb2d1ec 100644
--- a/camel-core/src/test/java/org/apache/camel/processor/aggregator/AggregateSimpleTimeoutTest.java
+++ b/camel-core/src/test/java/org/apache/camel/processor/aggregator/AggregateSimpleTimeoutTest.java
@@ -44,9 +44,9 @@ public class AggregateSimpleTimeoutTest extends ContextTestSupport {
                 from("direct:start")
                     // aggregate all exchanges correlated by the id header.
                     // Aggregate them using the BodyInAggregatingStrategy strategy which
-                    // and after 3 seconds of inactivity them timeout and complete the aggregation
+                    // and after 0.1 second of inactivity them timeout and complete the aggregation
                     // and send it to mock:aggregated
-                    .aggregate(header("id"), new BodyInAggregatingStrategy()).completionTimeout(3000)
+                    .aggregate(header("id"), new BodyInAggregatingStrategy()).completionTimeout(100).completionTimeoutCheckerInterval(10)
                         .to("mock:aggregated");
                 // END SNIPPET: e1
             }

http://git-wip-us.apache.org/repos/asf/camel/blob/fd73931f/camel-core/src/test/java/org/apache/camel/processor/aggregator/AggregateTimeoutOnlyTest.java
----------------------------------------------------------------------
diff --git a/camel-core/src/test/java/org/apache/camel/processor/aggregator/AggregateTimeoutOnlyTest.java
b/camel-core/src/test/java/org/apache/camel/processor/aggregator/AggregateTimeoutOnlyTest.java
index 86e94d0..38a1db5 100644
--- a/camel-core/src/test/java/org/apache/camel/processor/aggregator/AggregateTimeoutOnlyTest.java
+++ b/camel-core/src/test/java/org/apache/camel/processor/aggregator/AggregateTimeoutOnlyTest.java
@@ -32,8 +32,8 @@ public class AggregateTimeoutOnlyTest extends ContextTestSupport {
         MockEndpoint result = getMockEndpoint("mock:result");
         // by default the use latest aggregation strategy is used so we get message 9
         result.expectedBodiesReceived("Message 9");
-        // should take 3 seconds to complete this one
-        result.setResultMinimumWaitTime(2500);
+        // should take 0.1 seconds to complete this one
+        result.setResultMinimumWaitTime(90);
 
         for (int i = 0; i < 10; i++) {
             template.sendBodyAndHeader("direct:start", "Message " + i, "id", "1");
@@ -49,8 +49,8 @@ public class AggregateTimeoutOnlyTest extends ContextTestSupport {
             public void configure() throws Exception {
                 // START SNIPPET: e1
                 from("direct:start")
-                    // aggregate timeout after 3th seconds
-                    .aggregate(header("id"), new UseLatestAggregationStrategy()).completionTimeout(3000)
+                    // aggregate timeout after 0.1 second
+                    .aggregate(header("id"), new UseLatestAggregationStrategy()).completionTimeout(100).completionTimeoutCheckerInterval(10)
                     .to("mock:result");
                 // END SNIPPET: e1
             }

http://git-wip-us.apache.org/repos/asf/camel/blob/fd73931f/camel-core/src/test/java/org/apache/camel/processor/aggregator/AggregateTimeoutTest.java
----------------------------------------------------------------------
diff --git a/camel-core/src/test/java/org/apache/camel/processor/aggregator/AggregateTimeoutTest.java
b/camel-core/src/test/java/org/apache/camel/processor/aggregator/AggregateTimeoutTest.java
index f07003c..a1da044 100644
--- a/camel-core/src/test/java/org/apache/camel/processor/aggregator/AggregateTimeoutTest.java
+++ b/camel-core/src/test/java/org/apache/camel/processor/aggregator/AggregateTimeoutTest.java
@@ -42,8 +42,8 @@ public class AggregateTimeoutTest extends ContextTestSupport {
         template.sendBodyAndHeader("direct:start", "A", "id", 123);
         template.sendBodyAndHeader("direct:start", "B", "id", 123);
 
-        // wait about 4 seconds so that the timeout kicks in but it was discarded
-        mock.assertIsSatisfied(4000);
+        // wait about 0.2 second so that the timeout kicks in but it was discarded
+        mock.assertIsSatisfied(200);
 
         // should invoke the timeout method
         assertEquals(1, invoked.get());
@@ -52,7 +52,7 @@ public class AggregateTimeoutTest extends ContextTestSupport {
         assertEquals("AB", receivedExchange.getIn().getBody());
         assertEquals(-1, receivedIndex);
         assertEquals(-1, receivedTotal);
-        assertEquals(2000, receivedTimeout);
+        assertEquals(100, receivedTimeout);
 
         mock.reset();
         mock.expectedBodiesReceived("ABC");
@@ -63,7 +63,7 @@ public class AggregateTimeoutTest extends ContextTestSupport {
         template.sendBodyAndHeader("direct:start", "C", "id", 123);
 
         // should complete before timeout
-        mock.assertIsSatisfied(1500);
+        mock.assertIsSatisfied(150);
 
         // should have not invoked the timeout method anymore
         assertEquals(1, invoked.get());
@@ -78,8 +78,8 @@ public class AggregateTimeoutTest extends ContextTestSupport {
                     .aggregate(header("id"), new MyAggregationStrategy())
                         .discardOnCompletionTimeout()
                         .completionSize(3)
-                        // use a 2 second timeout
-                        .completionTimeout(2000)
+                        // use a 0.1 second timeout
+                        .completionTimeout(100).completionTimeoutCheckerInterval(10)
                         .to("mock:aggregated");
             }
         };

http://git-wip-us.apache.org/repos/asf/camel/blob/fd73931f/camel-core/src/test/java/org/apache/camel/processor/aggregator/AggregateTimeoutWithExecutorServiceTest.java
----------------------------------------------------------------------
diff --git a/camel-core/src/test/java/org/apache/camel/processor/aggregator/AggregateTimeoutWithExecutorServiceTest.java
b/camel-core/src/test/java/org/apache/camel/processor/aggregator/AggregateTimeoutWithExecutorServiceTest.java
index 8ff53ff..63f68c1 100644
--- a/camel-core/src/test/java/org/apache/camel/processor/aggregator/AggregateTimeoutWithExecutorServiceTest.java
+++ b/camel-core/src/test/java/org/apache/camel/processor/aggregator/AggregateTimeoutWithExecutorServiceTest.java
@@ -73,8 +73,9 @@ public class AggregateTimeoutWithExecutorServiceTest extends ContextTestSupport
                 ScheduledExecutorService threadPool = context.getExecutorServiceManager().newScheduledThreadPool(this,
"MyThreadPool", 8);
                 for (int i = 0; i < NUM_AGGREGATORS; ++i) {
                     from("direct:start" + i)
-                        // aggregate timeout after 3th seconds
-                        .aggregate(header("id"), new UseLatestAggregationStrategy()).completionTimeout(3000).timeoutCheckerExecutorService(threadPool)
+                        // aggregate timeout after 0.1 second
+                        .aggregate(header("id"), new UseLatestAggregationStrategy()).completionTimeout(100)
+                            .timeoutCheckerExecutorService(threadPool).completionTimeoutCheckerInterval(10)
                         .to("mock:result" + i);
                 }
             }

http://git-wip-us.apache.org/repos/asf/camel/blob/fd73931f/camel-core/src/test/java/org/apache/camel/processor/aggregator/AggregateTimeoutWithNoExecutorServiceTest.java
----------------------------------------------------------------------
diff --git a/camel-core/src/test/java/org/apache/camel/processor/aggregator/AggregateTimeoutWithNoExecutorServiceTest.java
b/camel-core/src/test/java/org/apache/camel/processor/aggregator/AggregateTimeoutWithNoExecutorServiceTest.java
index 0d0ce39..a7a10e9 100644
--- a/camel-core/src/test/java/org/apache/camel/processor/aggregator/AggregateTimeoutWithNoExecutorServiceTest.java
+++ b/camel-core/src/test/java/org/apache/camel/processor/aggregator/AggregateTimeoutWithNoExecutorServiceTest.java
@@ -22,6 +22,7 @@ import org.apache.camel.component.mock.MockEndpoint;
 import org.apache.camel.processor.aggregate.UseLatestAggregationStrategy;
 
 public class AggregateTimeoutWithNoExecutorServiceTest extends ContextTestSupport {
+
     public void testThreadUsedForEveryAggregatorWhenDefaultExecutorServiceUsed() throws Exception
{
         assertTrue("There should be a thread for every aggregator when using defaults", 
                 AggregateTimeoutWithExecutorServiceTest.aggregateThreadsCount() >= AggregateTimeoutWithExecutorServiceTest.NUM_AGGREGATORS);
@@ -47,8 +48,8 @@ public class AggregateTimeoutWithNoExecutorServiceTest extends ContextTestSuppor
             public void configure() throws Exception {
                 for (int i = 0; i < AggregateTimeoutWithExecutorServiceTest.NUM_AGGREGATORS;
++i) {
                     from("direct:start" + i)
-                        // aggregate timeout after 3th seconds
-                        .aggregate(header("id"), new UseLatestAggregationStrategy()).completionTimeout(3000)
+                        // aggregate timeout after 0.1 second
+                        .aggregate(header("id"), new UseLatestAggregationStrategy()).completionTimeout(100).completionTimeoutCheckerInterval(10)
                         .to("mock:result" + i);
                 }
             }

http://git-wip-us.apache.org/repos/asf/camel/blob/fd73931f/camel-core/src/test/java/org/apache/camel/processor/aggregator/AggregatorExceptionHandleTest.java
----------------------------------------------------------------------
diff --git a/camel-core/src/test/java/org/apache/camel/processor/aggregator/AggregatorExceptionHandleTest.java
b/camel-core/src/test/java/org/apache/camel/processor/aggregator/AggregatorExceptionHandleTest.java
index ec043f2..b1e741e 100644
--- a/camel-core/src/test/java/org/apache/camel/processor/aggregator/AggregatorExceptionHandleTest.java
+++ b/camel-core/src/test/java/org/apache/camel/processor/aggregator/AggregatorExceptionHandleTest.java
@@ -64,7 +64,7 @@ public class AggregatorExceptionHandleTest extends ContextTestSupport {
                 onException(IllegalArgumentException.class).handled(true).to("mock:handled");
 
                 from("direct:start")
-                    .aggregate(header("id"), new UseLatestAggregationStrategy()).completionTimeout(1000L)
+                    .aggregate(header("id"), new UseLatestAggregationStrategy()).completionTimeout(100).completionTimeoutCheckerInterval(10)
                     .process(new Processor() {
                         public void process(Exchange exchange) throws Exception {
                             String body = exchange.getIn().getBody(String.class);

http://git-wip-us.apache.org/repos/asf/camel/blob/fd73931f/camel-core/src/test/java/org/apache/camel/processor/aggregator/AlbertoAggregatorTest.java
----------------------------------------------------------------------
diff --git a/camel-core/src/test/java/org/apache/camel/processor/aggregator/AlbertoAggregatorTest.java
b/camel-core/src/test/java/org/apache/camel/processor/aggregator/AlbertoAggregatorTest.java
index 5237b02..19b56e7 100644
--- a/camel-core/src/test/java/org/apache/camel/processor/aggregator/AlbertoAggregatorTest.java
+++ b/camel-core/src/test/java/org/apache/camel/processor/aggregator/AlbertoAggregatorTest.java
@@ -153,16 +153,18 @@ public class AlbertoAggregatorTest extends ContextTestSupport {
                         .to("direct:joinSurnames");
 
                 from("direct:joinSurnames")
-                        .aggregate(header(SURNAME_HEADER),
-                                surnameAggregator).completionTimeout(2000L).setHeader(TYPE_HEADER,
-                        constant(BROTHERS_TYPE)).to("direct:joinBrothers");
+                        .aggregate(header(SURNAME_HEADER), surnameAggregator)
+                            .completionTimeout(100).completionTimeoutCheckerInterval(10)
+                            .setHeader(TYPE_HEADER, constant(BROTHERS_TYPE))
+                            .to("direct:joinBrothers");
 
                 // Join all brothers lists and remove surname and type headers
                 AggregateDefinition agg =
-                        from("direct:joinBrothers").aggregate(header(TYPE_HEADER),
-                                brothersAggregator);
+                        from("direct:joinBrothers")
+                            .aggregate(header(TYPE_HEADER), brothersAggregator);
 
-                agg.setCompletionTimeout(2000L);
+                agg.setCompletionTimeout(100L);
+                agg.setCompletionTimeoutCheckerInterval(10L);
                 agg.removeHeader(SURNAME_HEADER)
                         .removeHeader(TYPE_HEADER)
                         .to("mock:result");

http://git-wip-us.apache.org/repos/asf/camel/blob/fd73931f/camel-core/src/test/java/org/apache/camel/processor/onexception/OnExceptionRetryUntilWithDefaultErrorHandlerTest.java
----------------------------------------------------------------------
diff --git a/camel-core/src/test/java/org/apache/camel/processor/onexception/OnExceptionRetryUntilWithDefaultErrorHandlerTest.java
b/camel-core/src/test/java/org/apache/camel/processor/onexception/OnExceptionRetryUntilWithDefaultErrorHandlerTest.java
index 9c5e426..3006379 100644
--- a/camel-core/src/test/java/org/apache/camel/processor/onexception/OnExceptionRetryUntilWithDefaultErrorHandlerTest.java
+++ b/camel-core/src/test/java/org/apache/camel/processor/onexception/OnExceptionRetryUntilWithDefaultErrorHandlerTest.java
@@ -48,6 +48,7 @@ public class OnExceptionRetryUntilWithDefaultErrorHandlerTest extends ContextTes
 
                 onException(MyFunctionalException.class)
                         .retryWhile(method("myRetryHandler"))
+                        .redeliveryDelay(0)
                         .handled(true)
                         .transform().constant("Sorry").stop();
 

http://git-wip-us.apache.org/repos/asf/camel/blob/fd73931f/camel-core/src/test/java/org/apache/camel/util/EndpointHelperTest.java
----------------------------------------------------------------------
diff --git a/camel-core/src/test/java/org/apache/camel/util/EndpointHelperTest.java b/camel-core/src/test/java/org/apache/camel/util/EndpointHelperTest.java
index c92b8c1..967a326 100644
--- a/camel-core/src/test/java/org/apache/camel/util/EndpointHelperTest.java
+++ b/camel-core/src/test/java/org/apache/camel/util/EndpointHelperTest.java
@@ -40,6 +40,7 @@ public class EndpointHelperTest extends ContextTestSupport {
         template.sendBody("seda:foo", "Bye World");
 
         final List<String> bodies = new ArrayList<String>();
+        // uses 1 sec default timeout
         EndpointHelper.pollEndpoint(context.getEndpoint("seda:foo"), new Processor() {
             public void process(Exchange exchange) throws Exception {
                 bodies.add(exchange.getIn().getBody(String.class));
@@ -60,7 +61,7 @@ public class EndpointHelperTest extends ContextTestSupport {
             public void process(Exchange exchange) throws Exception {
                 bodies.add(exchange.getIn().getBody(String.class));
             }
-        }, 2000);
+        }, 10);
 
         assertEquals(2, bodies.size());
         assertEquals("Hello World", bodies.get(0));

http://git-wip-us.apache.org/repos/asf/camel/blob/fd73931f/components/camel-spring/src/test/java/org/apache/camel/spring/interceptor/DelayerInterceptorTest.java
----------------------------------------------------------------------
diff --git a/components/camel-spring/src/test/java/org/apache/camel/spring/interceptor/DelayerInterceptorTest.java
b/components/camel-spring/src/test/java/org/apache/camel/spring/interceptor/DelayerInterceptorTest.java
index 87d6a41..563d4ba 100644
--- a/components/camel-spring/src/test/java/org/apache/camel/spring/interceptor/DelayerInterceptorTest.java
+++ b/components/camel-spring/src/test/java/org/apache/camel/spring/interceptor/DelayerInterceptorTest.java
@@ -39,13 +39,13 @@ public class DelayerInterceptorTest extends SpringTestSupport {
         for (int i = 0; i < 10; i++) {
             template.sendBody("direct:start", "Message #" + i);
         }
-        // add a little slack
-        long delta = System.currentTimeMillis() - start + 200;
+        long delta = System.currentTimeMillis() - start;
 
         assertMockEndpointsSatisfied();
 
-        assertTrue("Should be slower to run: " + delta, delta >= 2000);
-        assertTrue("Should not take that long to run: " + delta, delta <= 7000);
+        assertTrue("Should not be that fast to run: " + delta, delta > 100);
+        // some OS boxes are slow
+        assertTrue("Should not take that long to run: " + delta, delta < 5000);
     }
 
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/camel/blob/fd73931f/components/camel-spring/src/test/resources/org/apache/camel/spring/interceptor/delayerInterceptorTest.xml
----------------------------------------------------------------------
diff --git a/components/camel-spring/src/test/resources/org/apache/camel/spring/interceptor/delayerInterceptorTest.xml
b/components/camel-spring/src/test/resources/org/apache/camel/spring/interceptor/delayerInterceptorTest.xml
index 299909f..7685b6a 100644
--- a/components/camel-spring/src/test/resources/org/apache/camel/spring/interceptor/delayerInterceptorTest.xml
+++ b/components/camel-spring/src/test/resources/org/apache/camel/spring/interceptor/delayerInterceptorTest.xml
@@ -24,7 +24,7 @@
        http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd

     ">
 
-    <camelContext delayer="200" xmlns="http://camel.apache.org/schema/spring">
+    <camelContext delayer="10" xmlns="http://camel.apache.org/schema/spring">
         <route>
             <from uri="direct:start"/>
             <to uri="mock:result"/>

http://git-wip-us.apache.org/repos/asf/camel/blob/fd73931f/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/aggregator/SpringAggregateExpressionTimeoutTest.xml
----------------------------------------------------------------------
diff --git a/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/aggregator/SpringAggregateExpressionTimeoutTest.xml
b/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/aggregator/SpringAggregateExpressionTimeoutTest.xml
index b7f00da..034a0dc 100644
--- a/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/aggregator/SpringAggregateExpressionTimeoutTest.xml
+++ b/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/aggregator/SpringAggregateExpressionTimeoutTest.xml
@@ -28,7 +28,7 @@
     <camelContext xmlns="http://camel.apache.org/schema/spring">
         <route>
             <from uri="direct:start"/>
-            <aggregate strategyRef="aggregatorStrategy">
+            <aggregate strategyRef="aggregatorStrategy" completionTimeoutCheckerInterval="10">
                 <correlationExpression>
                     <simple>header.id</simple>
                 </correlationExpression>

http://git-wip-us.apache.org/repos/asf/camel/blob/fd73931f/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/aggregator/SpringAggregateSimpleTimeoutTest.xml
----------------------------------------------------------------------
diff --git a/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/aggregator/SpringAggregateSimpleTimeoutTest.xml
b/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/aggregator/SpringAggregateSimpleTimeoutTest.xml
index eb796b7..717ec6f 100644
--- a/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/aggregator/SpringAggregateSimpleTimeoutTest.xml
+++ b/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/aggregator/SpringAggregateSimpleTimeoutTest.xml
@@ -28,7 +28,7 @@
     <camelContext xmlns="http://camel.apache.org/schema/spring">
         <route>
             <from uri="direct:start"/>
-            <aggregate strategyRef="aggregatorStrategy" completionTimeout="3000">
+            <aggregate strategyRef="aggregatorStrategy" completionTimeout="100" completionTimeoutCheckerInterval="10">
                 <correlationExpression>
                     <simple>header.id</simple>
                 </correlationExpression>


Mime
View raw message