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 19:23:58 GMT
Repository: camel
Updated Branches:
  refs/heads/master 7593d1366 -> 20a9cf7ce


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/20a9cf7c
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/20a9cf7c
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/20a9cf7c

Branch: refs/heads/master
Commit: 20a9cf7ce190a2ac56ed88f8923f0ec11dfe0c93
Parents: 7593d13
Author: Claus Ibsen <davsclaus@apache.org>
Authored: Sun Jul 16 21:23:46 2017 +0200
Committer: Claus Ibsen <davsclaus@apache.org>
Committed: Sun Jul 16 21:23:46 2017 +0200

----------------------------------------------------------------------
 .../camel/component/file/FilePollEnrichNoWaitTest.java       | 4 ++--
 .../camel/management/ManagedRouteLoadstatisticsTest.java     | 6 ++++--
 .../org/apache/camel/processor/SplitParallelTimeoutTest.java | 8 ++++----
 .../processor/aggregator/AggregateLostGroupIssueTest.java    | 4 ++--
 .../onexception/DefaultErrorHandlerRetryWhileTest.java       | 2 +-
 5 files changed, 13 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/20a9cf7c/camel-core/src/test/java/org/apache/camel/component/file/FilePollEnrichNoWaitTest.java
----------------------------------------------------------------------
diff --git a/camel-core/src/test/java/org/apache/camel/component/file/FilePollEnrichNoWaitTest.java
b/camel-core/src/test/java/org/apache/camel/component/file/FilePollEnrichNoWaitTest.java
index 61b0435..a46f4e3 100644
--- a/camel-core/src/test/java/org/apache/camel/component/file/FilePollEnrichNoWaitTest.java
+++ b/camel-core/src/test/java/org/apache/camel/component/file/FilePollEnrichNoWaitTest.java
@@ -54,10 +54,10 @@ public class FilePollEnrichNoWaitTest extends ContextTestSupport {
         return new RouteBuilder() {
             @Override
             public void configure() throws Exception {
-                from("timer:foo?period=1000").routeId("foo")
+                from("timer:foo?delay=0&period=10").routeId("foo")
                     .log("Trigger timer foo")
                     // use 0 as timeout for no wait
-                    .pollEnrich("file:target/pollenrich?move=done", 0)
+                    .pollEnrich("file:target/pollenrich?initialDelay=0&delay=10&move=done",
0)
                     .convertBodyTo(String.class)
                     .filter(body().isNull())
                         .stop()

http://git-wip-us.apache.org/repos/asf/camel/blob/20a9cf7c/camel-core/src/test/java/org/apache/camel/management/ManagedRouteLoadstatisticsTest.java
----------------------------------------------------------------------
diff --git a/camel-core/src/test/java/org/apache/camel/management/ManagedRouteLoadstatisticsTest.java
b/camel-core/src/test/java/org/apache/camel/management/ManagedRouteLoadstatisticsTest.java
index 4788b27..a95d760 100644
--- a/camel-core/src/test/java/org/apache/camel/management/ManagedRouteLoadstatisticsTest.java
+++ b/camel-core/src/test/java/org/apache/camel/management/ManagedRouteLoadstatisticsTest.java
@@ -43,7 +43,8 @@ public class ManagedRouteLoadstatisticsTest extends ManagementTestSupport
{
         context.addRoutes(new RouteBuilder() {
             @Override
             public void configure() throws Exception {
-                from("direct:start").to("log:foo").delay(2000).to("mock:result");
+                // must be a bit more than 1 sec
+                from("direct:start").to("log:foo").delay(1200).to("mock:result");
             }
         });
         context.start();
@@ -79,7 +80,8 @@ public class ManagedRouteLoadstatisticsTest extends ManagementTestSupport
{
         context.addRoutes(new RouteBuilder() {
             @Override
             public void configure() throws Exception {
-                from("direct:start").to("log:foo").delay(2000).to("mock:result");
+                // must be a bit more than 1 sec
+                from("direct:start").to("log:foo").delay(1200).to("mock:result");
             }
         });
         context.start();

http://git-wip-us.apache.org/repos/asf/camel/blob/20a9cf7c/camel-core/src/test/java/org/apache/camel/processor/SplitParallelTimeoutTest.java
----------------------------------------------------------------------
diff --git a/camel-core/src/test/java/org/apache/camel/processor/SplitParallelTimeoutTest.java
b/camel-core/src/test/java/org/apache/camel/processor/SplitParallelTimeoutTest.java
index bd7d72c..4a877e0 100644
--- a/camel-core/src/test/java/org/apache/camel/processor/SplitParallelTimeoutTest.java
+++ b/camel-core/src/test/java/org/apache/camel/processor/SplitParallelTimeoutTest.java
@@ -44,7 +44,7 @@ public class SplitParallelTimeoutTest extends ContextTestSupport {
         assertNotNull(receivedExchange);
         assertEquals(0, receivedIndex);
         assertEquals(3, receivedTotal);
-        assertEquals(1000, receivedTimeout);
+        assertEquals(100, receivedTimeout);
     }
 
     @Override
@@ -54,7 +54,7 @@ public class SplitParallelTimeoutTest extends ContextTestSupport {
             public void configure() throws Exception {
                 from("direct:start")
                     .split(body().tokenize(","), new MyAggregationStrategy())
-                        .parallelProcessing().timeout(1000)
+                        .parallelProcessing().timeout(100)
                         .choice()
                             .when(body().isEqualTo("A")).to("direct:a")
                             .when(body().isEqualTo("B")).to("direct:b")
@@ -63,11 +63,11 @@ public class SplitParallelTimeoutTest extends ContextTestSupport {
                     .end() // end split
                     .to("mock:result");
 
-                from("direct:a").delay(5000).setBody(constant("A"));
+                from("direct:a").delay(200).setBody(constant("A"));
 
                 from("direct:b").setBody(constant("B"));
 
-                from("direct:c").delay(500).setBody(constant("C"));
+                from("direct:c").delay(10).setBody(constant("C"));
             }
         };
     }

http://git-wip-us.apache.org/repos/asf/camel/blob/20a9cf7c/camel-core/src/test/java/org/apache/camel/processor/aggregator/AggregateLostGroupIssueTest.java
----------------------------------------------------------------------
diff --git a/camel-core/src/test/java/org/apache/camel/processor/aggregator/AggregateLostGroupIssueTest.java
b/camel-core/src/test/java/org/apache/camel/processor/aggregator/AggregateLostGroupIssueTest.java
index 793711c..4c9ea79 100644
--- a/camel-core/src/test/java/org/apache/camel/processor/aggregator/AggregateLostGroupIssueTest.java
+++ b/camel-core/src/test/java/org/apache/camel/processor/aggregator/AggregateLostGroupIssueTest.java
@@ -48,7 +48,7 @@ public class AggregateLostGroupIssueTest extends ContextTestSupport {
         return new RouteBuilder() {
             @Override
             public void configure() throws Exception {
-                from("timer://foo?period=100&delay=1000").startupOrder(2)
+                from("timer://foo?period=10&delay=0").startupOrder(2)
                         .process(new Processor() {
                             public void process(Exchange exchange) throws Exception {
                                 exchange.getOut().setBody(messageIndex++);
@@ -68,7 +68,7 @@ public class AggregateLostGroupIssueTest extends ContextTestSupport {
                         oldExchange.getIn().setBody(oldBody + "," + newBody);
                         return oldExchange;
                     }
-                }).completionSize(10).completionTimeout(2000L)
+                }).completionSize(10).completionTimeout(100).completionTimeoutCheckerInterval(10)
                         .to("log:aggregated")
                         .to("mock:result");
             }

http://git-wip-us.apache.org/repos/asf/camel/blob/20a9cf7c/camel-core/src/test/java/org/apache/camel/processor/onexception/DefaultErrorHandlerRetryWhileTest.java
----------------------------------------------------------------------
diff --git a/camel-core/src/test/java/org/apache/camel/processor/onexception/DefaultErrorHandlerRetryWhileTest.java
b/camel-core/src/test/java/org/apache/camel/processor/onexception/DefaultErrorHandlerRetryWhileTest.java
index a3e605b..334b6ae 100644
--- a/camel-core/src/test/java/org/apache/camel/processor/onexception/DefaultErrorHandlerRetryWhileTest.java
+++ b/camel-core/src/test/java/org/apache/camel/processor/onexception/DefaultErrorHandlerRetryWhileTest.java
@@ -47,7 +47,7 @@ public class DefaultErrorHandlerRetryWhileTest extends ContextTestSupport
{
         return new RouteBuilder() {
             @Override
             public void configure() throws Exception {
-                errorHandler(defaultErrorHandler().retryWhile(method("myRetryHandler")));
+                errorHandler(defaultErrorHandler().redeliveryDelay(0).retryWhile(method("myRetryHandler")));
 
                 from("direct:start").process(new MyProcessor());
             }


Mime
View raw message