camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject [2/2] camel git commit: CAMEL-11446: Use awaitility in camel-core for testing where we otherwise use thred sleep which can be speeded up.
Date Thu, 06 Jul 2017 14:45:55 GMT
CAMEL-11446: Use awaitility in camel-core 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/14402060
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/14402060
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/14402060

Branch: refs/heads/master
Commit: 144020608143df64fd0654a6bd4c4611bcf039e5
Parents: 1e51f29
Author: Claus Ibsen <davsclaus@apache.org>
Authored: Thu Jul 6 16:45:41 2017 +0200
Committer: Claus Ibsen <davsclaus@apache.org>
Committed: Thu Jul 6 16:45:41 2017 +0200

----------------------------------------------------------------------
 .../camel/processor/SplitterParallelBigFileTest.java     | 11 ++++-------
 .../async/AsyncEndpointCustomRoutePolicyTest.java        |  6 ++++--
 2 files changed, 8 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/14402060/camel-core/src/test/java/org/apache/camel/processor/SplitterParallelBigFileTest.java
----------------------------------------------------------------------
diff --git a/camel-core/src/test/java/org/apache/camel/processor/SplitterParallelBigFileTest.java
b/camel-core/src/test/java/org/apache/camel/processor/SplitterParallelBigFileTest.java
index c3e08df..bad9a6c 100644
--- a/camel-core/src/test/java/org/apache/camel/processor/SplitterParallelBigFileTest.java
+++ b/camel-core/src/test/java/org/apache/camel/processor/SplitterParallelBigFileTest.java
@@ -27,10 +27,12 @@ import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.util.IOHelper;
 import org.apache.camel.util.StopWatch;
 import org.apache.camel.util.TimeUtils;
+import org.junit.Ignore;
 
 /**
  * @version 
  */
+@Ignore("Manual test")
 public class SplitterParallelBigFileTest extends ContextTestSupport {
 
     private int lines = 20000;
@@ -53,12 +55,7 @@ public class SplitterParallelBigFileTest extends ContextTestSupport {
         IOHelper.close(fos);
     }
 
-    public void testNoop() {
-        // noop
-    }
-
-    // disabled due manual test
-    public void xxxtestSplitParallelBigFile() throws Exception {
+    public void testSplitParallelBigFile() throws Exception {
         StopWatch watch = new StopWatch();
 
         NotifyBuilder builder = new NotifyBuilder(context).whenDone(lines + 1).create();
@@ -71,7 +68,7 @@ public class SplitterParallelBigFileTest extends ContextTestSupport {
         }
 
         // need a little sleep for capturing memory profiling
-        // Thread.sleep(60 * 1000);
+        Thread.sleep(60 * 1000);
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/camel/blob/14402060/camel-core/src/test/java/org/apache/camel/processor/async/AsyncEndpointCustomRoutePolicyTest.java
----------------------------------------------------------------------
diff --git a/camel-core/src/test/java/org/apache/camel/processor/async/AsyncEndpointCustomRoutePolicyTest.java
b/camel-core/src/test/java/org/apache/camel/processor/async/AsyncEndpointCustomRoutePolicyTest.java
index 5f7bcdd..e7ec927 100644
--- a/camel-core/src/test/java/org/apache/camel/processor/async/AsyncEndpointCustomRoutePolicyTest.java
+++ b/camel-core/src/test/java/org/apache/camel/processor/async/AsyncEndpointCustomRoutePolicyTest.java
@@ -16,6 +16,7 @@
  */
 package org.apache.camel.processor.async;
 
+import java.util.concurrent.TimeUnit;
 import java.util.concurrent.atomic.AtomicBoolean;
 
 import org.apache.camel.ContextTestSupport;
@@ -26,6 +27,8 @@ import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.component.mock.MockEndpoint;
 import org.apache.camel.support.RoutePolicySupport;
 
+import static org.awaitility.Awaitility.await;
+
 /**
  * @version 
  */
@@ -81,8 +84,7 @@ public class AsyncEndpointCustomRoutePolicyTest extends ContextTestSupport
{
 
         mock.assertIsSatisfied();
 
-        // give time for slow boxes
-        Thread.sleep(500);
+        await().atMost(1, TimeUnit.SECONDS).until(policy::isStopped);
 
         assertTrue("Should be stopped", policy.isStopped());
     }


Mime
View raw message