Repository: camel
Updated Branches:
  refs/heads/master ef217c3e3 -> acf2b03d8


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

Branch: refs/heads/master
Commit: acf2b03d8fbafdefcec5d6fb93754348e007bc61
Parents: ef217c3
Author: Claus Ibsen <davscl...@apache.org>
Authored: Sun Jul 9 14:49:02 2017 +0200
Committer: Claus Ibsen <davscl...@apache.org>
Committed: Sun Jul 9 14:49:02 2017 +0200

----------------------------------------------------------------------
 .../file/FileProducerCharsetUTFOptimizedTest.java         |  2 +-
 .../file/FileProducerCharsetUTFtoISOConfiguredTest.java   |  2 +-
 .../FileProducerCharsetUTFtoISOConvertBodyToTest.java     |  2 +-
 .../component/file/FileProducerCharsetUTFtoISOTest.java   |  2 +-
 .../component/file/FileProducerCharsetUTFtoUTFTest.java   |  2 +-
 .../file/FileProducerFileExistAppendNoFileBeforeTest.java |  3 ++-
 .../component/file/FileProducerFileExistAppendTest.java   |  8 ++++++--
 .../component/file/FileProducerFileExistFailTest.java     |  5 +++--
 .../component/file/FileProducerFileExistIgnoreTest.java   |  4 ++--
 .../component/file/FileProducerFileExistOverrideTest.java | 10 +++++++---
 .../file/FileProducerFileExistTryRenameTest.java          |  8 +++++---
 .../component/file/FileProducerNoForcedWritesTest.java    | 10 +++++++---
 .../component/file/FilerConsumerDoneFileNoopTest.java     |  7 +++----
 .../apache/camel/component/file/NewFileConsumeTest.java   |  3 ++-
 .../seda/DirectRequestReplyAndSedaInOnlyTest.java         |  2 +-
 15 files changed, 43 insertions(+), 27 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/acf2b03d/camel-core/src/test/java/org/apache/camel/component/file/FileProducerCharsetUTFOptimizedTest.java
----------------------------------------------------------------------
diff --git 
a/camel-core/src/test/java/org/apache/camel/component/file/FileProducerCharsetUTFOptimizedTest.java
 
b/camel-core/src/test/java/org/apache/camel/component/file/FileProducerCharsetUTFOptimizedTest.java
index e390742..1aa5584 100644
--- 
a/camel-core/src/test/java/org/apache/camel/component/file/FileProducerCharsetUTFOptimizedTest.java
+++ 
b/camel-core/src/test/java/org/apache/camel/component/file/FileProducerCharsetUTFOptimizedTest.java
@@ -84,7 +84,7 @@ public class FileProducerCharsetUTFOptimizedTest extends 
ContextTestSupport {
         return new RouteBuilder() {
             @Override
             public void configure() throws Exception {
-                from("file:target/charset/input?noop=true")
+                
from("file:target/charset/input?initialDelay=0&delay=10&noop=true")
                     // no charset so its optimized to write directly
                     .to("file:target/charset/?fileName=output.txt");
             }

http://git-wip-us.apache.org/repos/asf/camel/blob/acf2b03d/camel-core/src/test/java/org/apache/camel/component/file/FileProducerCharsetUTFtoISOConfiguredTest.java
----------------------------------------------------------------------
diff --git 
a/camel-core/src/test/java/org/apache/camel/component/file/FileProducerCharsetUTFtoISOConfiguredTest.java
 
b/camel-core/src/test/java/org/apache/camel/component/file/FileProducerCharsetUTFtoISOConfiguredTest.java
index f7cb326..7c06dfb 100644
--- 
a/camel-core/src/test/java/org/apache/camel/component/file/FileProducerCharsetUTFtoISOConfiguredTest.java
+++ 
b/camel-core/src/test/java/org/apache/camel/component/file/FileProducerCharsetUTFtoISOConfiguredTest.java
@@ -89,7 +89,7 @@ public class FileProducerCharsetUTFtoISOConfiguredTest 
extends ContextTestSuppor
         return new RouteBuilder() {
             @Override
             public void configure() throws Exception {
-                from("file:target/charset/input?charset=utf-8&noop=true")
+                
from("file:target/charset/input?initialDelay=0&delay=10&charset=utf-8&noop=true")
                     
.to("file:target/charset/?fileName=output.txt&charset=iso-8859-1");
             }
         };

http://git-wip-us.apache.org/repos/asf/camel/blob/acf2b03d/camel-core/src/test/java/org/apache/camel/component/file/FileProducerCharsetUTFtoISOConvertBodyToTest.java
----------------------------------------------------------------------
diff --git 
a/camel-core/src/test/java/org/apache/camel/component/file/FileProducerCharsetUTFtoISOConvertBodyToTest.java
 
b/camel-core/src/test/java/org/apache/camel/component/file/FileProducerCharsetUTFtoISOConvertBodyToTest.java
index c6da3b3..6d8f7f3 100644
--- 
a/camel-core/src/test/java/org/apache/camel/component/file/FileProducerCharsetUTFtoISOConvertBodyToTest.java
+++ 
b/camel-core/src/test/java/org/apache/camel/component/file/FileProducerCharsetUTFtoISOConvertBodyToTest.java
@@ -96,7 +96,7 @@ public class FileProducerCharsetUTFtoISOConvertBodyToTest 
extends ContextTestSup
             @Override
             public void configure() throws Exception {
                 // the input file is in utf-8
-                from("file:target/charset/input?noop=true&charset=utf-8")
+                
from("file:target/charset/input?initialDelay=0&delay=10&noop=true&charset=utf-8")
                     // now convert the input file from utf-8 to iso-8859-1
                     .convertBodyTo(byte[].class, "iso-8859-1")
                     // and write the file using that encoding

http://git-wip-us.apache.org/repos/asf/camel/blob/acf2b03d/camel-core/src/test/java/org/apache/camel/component/file/FileProducerCharsetUTFtoISOTest.java
----------------------------------------------------------------------
diff --git 
a/camel-core/src/test/java/org/apache/camel/component/file/FileProducerCharsetUTFtoISOTest.java
 
b/camel-core/src/test/java/org/apache/camel/component/file/FileProducerCharsetUTFtoISOTest.java
index 52bb085..1844f7d 100644
--- 
a/camel-core/src/test/java/org/apache/camel/component/file/FileProducerCharsetUTFtoISOTest.java
+++ 
b/camel-core/src/test/java/org/apache/camel/component/file/FileProducerCharsetUTFtoISOTest.java
@@ -89,7 +89,7 @@ public class FileProducerCharsetUTFtoISOTest extends 
ContextTestSupport {
         return new RouteBuilder() {
             @Override
             public void configure() throws Exception {
-                from("file:target/charset/input?noop=true")
+                
from("file:target/charset/input?initialDelay=0&delay=10&noop=true")
                     
.to("file:target/charset/?fileName=output.txt&charset=iso-8859-1");
             }
         };

http://git-wip-us.apache.org/repos/asf/camel/blob/acf2b03d/camel-core/src/test/java/org/apache/camel/component/file/FileProducerCharsetUTFtoUTFTest.java
----------------------------------------------------------------------
diff --git 
a/camel-core/src/test/java/org/apache/camel/component/file/FileProducerCharsetUTFtoUTFTest.java
 
b/camel-core/src/test/java/org/apache/camel/component/file/FileProducerCharsetUTFtoUTFTest.java
index bfcc192..f4f2236 100644
--- 
a/camel-core/src/test/java/org/apache/camel/component/file/FileProducerCharsetUTFtoUTFTest.java
+++ 
b/camel-core/src/test/java/org/apache/camel/component/file/FileProducerCharsetUTFtoUTFTest.java
@@ -84,7 +84,7 @@ public class FileProducerCharsetUTFtoUTFTest extends 
ContextTestSupport {
         return new RouteBuilder() {
             @Override
             public void configure() throws Exception {
-                from("file:target/charset/input?noop=true")
+                
from("file:target/charset/input?initialDelay=0&delay=10&noop=true")
                     
.to("file:target/charset/?fileName=output.txt&charset=utf-8");
             }
         };

http://git-wip-us.apache.org/repos/asf/camel/blob/acf2b03d/camel-core/src/test/java/org/apache/camel/component/file/FileProducerFileExistAppendNoFileBeforeTest.java
----------------------------------------------------------------------
diff --git 
a/camel-core/src/test/java/org/apache/camel/component/file/FileProducerFileExistAppendNoFileBeforeTest.java
 
b/camel-core/src/test/java/org/apache/camel/component/file/FileProducerFileExistAppendNoFileBeforeTest.java
index fa5cfd0..f60a0b4 100644
--- 
a/camel-core/src/test/java/org/apache/camel/component/file/FileProducerFileExistAppendNoFileBeforeTest.java
+++ 
b/camel-core/src/test/java/org/apache/camel/component/file/FileProducerFileExistAppendNoFileBeforeTest.java
@@ -47,7 +47,8 @@ public class FileProducerFileExistAppendNoFileBeforeTest 
extends ContextTestSupp
         return new RouteBuilder() {
             @Override
             public void configure() throws Exception {
-                
from("file://target/file?noop=true&delay=1000").convertBodyTo(String.class).to("mock:result");
+                from("file://target/file?noop=true&initialDelay=0&delay=10")
+                    .convertBodyTo(String.class).to("mock:result");
             }
         };
     }

http://git-wip-us.apache.org/repos/asf/camel/blob/acf2b03d/camel-core/src/test/java/org/apache/camel/component/file/FileProducerFileExistAppendTest.java
----------------------------------------------------------------------
diff --git 
a/camel-core/src/test/java/org/apache/camel/component/file/FileProducerFileExistAppendTest.java
 
b/camel-core/src/test/java/org/apache/camel/component/file/FileProducerFileExistAppendTest.java
index 7a9bdce..b6cf181 100644
--- 
a/camel-core/src/test/java/org/apache/camel/component/file/FileProducerFileExistAppendTest.java
+++ 
b/camel-core/src/test/java/org/apache/camel/component/file/FileProducerFileExistAppendTest.java
@@ -30,10 +30,13 @@ public class FileProducerFileExistAppendTest extends 
ContextTestSupport {
     protected void setUp() throws Exception {
         deleteDirectory("target/file");
         super.setUp();
-        template.sendBodyAndHeader("file://target/file", "Hello World\n", 
Exchange.FILE_NAME, "hello.txt");
     }
 
     public void testAppend() throws Exception {
+        template.sendBodyAndHeader("file://target/file", "Hello World\n", 
Exchange.FILE_NAME, "hello.txt");
+
+        context.startAllRoutes();
+
         MockEndpoint mock = getMockEndpoint("mock:result");
         mock.expectedBodiesReceived("Hello World\nBye World");
         mock.expectedFileExists("target/file/hello.txt", "Hello World\nBye 
World");
@@ -48,7 +51,8 @@ public class FileProducerFileExistAppendTest extends 
ContextTestSupport {
         return new RouteBuilder() {
             @Override
             public void configure() throws Exception {
-                
from("file://target/file?noop=true&delay=1000").convertBodyTo(String.class).to("mock:result");
+                
from("file://target/file?noop=true&initialDelay=0&delay=10").noAutoStartup()
+                    .convertBodyTo(String.class).to("mock:result");
             }
         };
     }

http://git-wip-us.apache.org/repos/asf/camel/blob/acf2b03d/camel-core/src/test/java/org/apache/camel/component/file/FileProducerFileExistFailTest.java
----------------------------------------------------------------------
diff --git 
a/camel-core/src/test/java/org/apache/camel/component/file/FileProducerFileExistFailTest.java
 
b/camel-core/src/test/java/org/apache/camel/component/file/FileProducerFileExistFailTest.java
index cdf80cc..c143de6 100644
--- 
a/camel-core/src/test/java/org/apache/camel/component/file/FileProducerFileExistFailTest.java
+++ 
b/camel-core/src/test/java/org/apache/camel/component/file/FileProducerFileExistFailTest.java
@@ -32,7 +32,6 @@ public class FileProducerFileExistFailTest extends 
ContextTestSupport {
     protected void setUp() throws Exception {
         deleteDirectory("target/file");
         super.setUp();
-        template.sendBodyAndHeader("file://target/file", "Hello World", 
Exchange.FILE_NAME, "hello.txt");
     }
 
     public void testFail() throws Exception {
@@ -40,6 +39,8 @@ public class FileProducerFileExistFailTest extends 
ContextTestSupport {
         mock.expectedBodiesReceived("Hello World");
         mock.expectedFileExists("target/file/hello.txt", "Hello World");
 
+        template.sendBodyAndHeader("file://target/file", "Hello World", 
Exchange.FILE_NAME, "hello.txt");
+
         try {
             template.sendBodyAndHeader("file://target/file?fileExist=Fail", 
"Bye World", Exchange.FILE_NAME, "hello.txt");
             fail("Should have thrown a GenericFileOperationFailedException");
@@ -56,7 +57,7 @@ public class FileProducerFileExistFailTest extends 
ContextTestSupport {
         return new RouteBuilder() {
             @Override
             public void configure() throws Exception {
-                
from("file://target/file?noop=true&delay=1000").convertBodyTo(String.class).to("mock:result");
+                
from("file://target/file?noop=true&initialDelay=0&delay=10").convertBodyTo(String.class).to("mock:result");
             }
         };
     }

http://git-wip-us.apache.org/repos/asf/camel/blob/acf2b03d/camel-core/src/test/java/org/apache/camel/component/file/FileProducerFileExistIgnoreTest.java
----------------------------------------------------------------------
diff --git 
a/camel-core/src/test/java/org/apache/camel/component/file/FileProducerFileExistIgnoreTest.java
 
b/camel-core/src/test/java/org/apache/camel/component/file/FileProducerFileExistIgnoreTest.java
index 2bd6001..6645d34 100644
--- 
a/camel-core/src/test/java/org/apache/camel/component/file/FileProducerFileExistIgnoreTest.java
+++ 
b/camel-core/src/test/java/org/apache/camel/component/file/FileProducerFileExistIgnoreTest.java
@@ -30,7 +30,6 @@ public class FileProducerFileExistIgnoreTest extends 
ContextTestSupport {
     protected void setUp() throws Exception {
         deleteDirectory("target/file");
         super.setUp();
-        template.sendBodyAndHeader("file://target/file", "Hello World", 
Exchange.FILE_NAME, "hello.txt");
     }
 
     public void testIgnore() throws Exception {
@@ -38,6 +37,7 @@ public class FileProducerFileExistIgnoreTest extends 
ContextTestSupport {
         mock.expectedBodiesReceived("Hello World");
         mock.expectedFileExists("target/file/hello.txt", "Hello World");
 
+        template.sendBodyAndHeader("file://target/file", "Hello World", 
Exchange.FILE_NAME, "hello.txt");
         template.sendBodyAndHeader("file://target/file?fileExist=Ignore", "Bye 
World", Exchange.FILE_NAME, "hello.txt");
 
         assertMockEndpointsSatisfied();
@@ -48,7 +48,7 @@ public class FileProducerFileExistIgnoreTest extends 
ContextTestSupport {
         return new RouteBuilder() {
             @Override
             public void configure() throws Exception {
-                
from("file://target/file?noop=true&delay=1000").convertBodyTo(String.class).to("mock:result");
+                
from("file://target/file?noop=true&initialDelay=0&delay=10").convertBodyTo(String.class).to("mock:result");
             }
         };
     }

http://git-wip-us.apache.org/repos/asf/camel/blob/acf2b03d/camel-core/src/test/java/org/apache/camel/component/file/FileProducerFileExistOverrideTest.java
----------------------------------------------------------------------
diff --git 
a/camel-core/src/test/java/org/apache/camel/component/file/FileProducerFileExistOverrideTest.java
 
b/camel-core/src/test/java/org/apache/camel/component/file/FileProducerFileExistOverrideTest.java
index 560fc5e..645e5f3 100644
--- 
a/camel-core/src/test/java/org/apache/camel/component/file/FileProducerFileExistOverrideTest.java
+++ 
b/camel-core/src/test/java/org/apache/camel/component/file/FileProducerFileExistOverrideTest.java
@@ -30,8 +30,6 @@ public class FileProducerFileExistOverrideTest extends 
ContextTestSupport {
     protected void setUp() throws Exception {
         deleteDirectory("target/file");
         super.setUp();
-        template.sendBodyAndHeader("file://target/file", "Hello World", 
Exchange.FILE_NAME, "hello.txt");
-        template.sendBodyAndHeader("file://target/file?fileExist=Override", 
"Bye World", Exchange.FILE_NAME, "hello.txt");
     }
 
     public void testOverride() throws Exception {
@@ -39,6 +37,11 @@ public class FileProducerFileExistOverrideTest extends 
ContextTestSupport {
         mock.expectedBodiesReceived("Bye World");
         mock.expectedFileExists("target/file/hello.txt", "Bye World");
 
+        template.sendBodyAndHeader("file://target/file", "Hello World", 
Exchange.FILE_NAME, "hello.txt");
+        template.sendBodyAndHeader("file://target/file?fileExist=Override", 
"Bye World", Exchange.FILE_NAME, "hello.txt");
+
+        context.startAllRoutes();
+
         assertMockEndpointsSatisfied();
     }
 
@@ -47,7 +50,8 @@ public class FileProducerFileExistOverrideTest extends 
ContextTestSupport {
         return new RouteBuilder() {
             @Override
             public void configure() throws Exception {
-                
from("file://target/file?noop=true&delay=1000").convertBodyTo(String.class).to("mock:result");
+                
from("file://target/file?noop=true&initialDelay=0&delay=10").noAutoStartup()
+                    .convertBodyTo(String.class).to("mock:result");
             }
         };
     }

http://git-wip-us.apache.org/repos/asf/camel/blob/acf2b03d/camel-core/src/test/java/org/apache/camel/component/file/FileProducerFileExistTryRenameTest.java
----------------------------------------------------------------------
diff --git 
a/camel-core/src/test/java/org/apache/camel/component/file/FileProducerFileExistTryRenameTest.java
 
b/camel-core/src/test/java/org/apache/camel/component/file/FileProducerFileExistTryRenameTest.java
index be5a9a8..ab114b3 100644
--- 
a/camel-core/src/test/java/org/apache/camel/component/file/FileProducerFileExistTryRenameTest.java
+++ 
b/camel-core/src/test/java/org/apache/camel/component/file/FileProducerFileExistTryRenameTest.java
@@ -30,10 +30,8 @@ public class FileProducerFileExistTryRenameTest extends 
ContextTestSupport {
     protected void setUp() throws Exception {
         deleteDirectory("target/file");
         super.setUp();
-        template.sendBodyAndHeader("file://target/file", "Hello World", 
Exchange.FILE_NAME, "hello.txt");
     }
 
-
     public void testIgnore() throws Exception {
         // Does not work on Windows
         if (isPlatform("windows")) {
@@ -44,8 +42,11 @@ public class FileProducerFileExistTryRenameTest extends 
ContextTestSupport {
         mock.expectedBodiesReceived("Bye World");
         mock.expectedFileExists("target/file/hello.txt", "Bye World");
 
+        template.sendBodyAndHeader("file://target/file", "Hello World", 
Exchange.FILE_NAME, "hello.txt");
         
template.sendBodyAndHeader("file://target/file?fileExist=TryRename&tempPrefix=tmp",
 "Bye World", Exchange.FILE_NAME, "hello.txt");
 
+        context.startAllRoutes();
+
         assertMockEndpointsSatisfied();
     }
 
@@ -54,7 +55,8 @@ public class FileProducerFileExistTryRenameTest extends 
ContextTestSupport {
         return new RouteBuilder() {
             @Override
             public void configure() throws Exception {
-                
from("file://target/file?noop=true&delay=1000").convertBodyTo(String.class).to("mock:result");
+                
from("file://target/file?noop=true&initialDelay=0&delay=10").noAutoStartup()
+                    .convertBodyTo(String.class).to("mock:result");
             }
         };
     }

http://git-wip-us.apache.org/repos/asf/camel/blob/acf2b03d/camel-core/src/test/java/org/apache/camel/component/file/FileProducerNoForcedWritesTest.java
----------------------------------------------------------------------
diff --git 
a/camel-core/src/test/java/org/apache/camel/component/file/FileProducerNoForcedWritesTest.java
 
b/camel-core/src/test/java/org/apache/camel/component/file/FileProducerNoForcedWritesTest.java
index 555cf23..c472ac7 100644
--- 
a/camel-core/src/test/java/org/apache/camel/component/file/FileProducerNoForcedWritesTest.java
+++ 
b/camel-core/src/test/java/org/apache/camel/component/file/FileProducerNoForcedWritesTest.java
@@ -29,13 +29,14 @@ public class FileProducerNoForcedWritesTest extends 
ContextTestSupport {
     protected void setUp() throws Exception {
         deleteDirectory("target/file");
         super.setUp();
-        template.sendBodyAndHeader("file://target/file", "Hello World", 
Exchange.FILE_NAME, "hello.txt");
     }
 
     public void testNoForcedWrites() throws Exception {
         MockEndpoint mock = getMockEndpoint("mock:result");
         mock.expectedBodiesReceived("Hello World");
 
+        template.sendBodyAndHeader("file://target/file", "Hello World", 
Exchange.FILE_NAME, "hello.txt");
+
         assertMockEndpointsSatisfied();
 
         assertFileExists("target/file/output.txt");
@@ -50,8 +51,11 @@ public class FileProducerNoForcedWritesTest extends 
ContextTestSupport {
         return new RouteBuilder() {
             @Override
             public void configure() throws Exception {
-                
from("file:target/file?noop=true").multicast().to("file:target/file/?fileName=output.txt&forceWrites=false",
-                    
"file:target/file/?fileName=output2.txt&charset=iso-8859-1&forceWrites=false").to("mock:result");
+                from("file:target/file?initialDelay=0&delay=10&noop=true")
+                    .multicast().to(
+                        
"file:target/file/?fileName=output.txt&forceWrites=false",
+                        
"file:target/file/?fileName=output2.txt&charset=iso-8859-1&forceWrites=false")
+                    .to("mock:result");
             }
         };
     }

http://git-wip-us.apache.org/repos/asf/camel/blob/acf2b03d/camel-core/src/test/java/org/apache/camel/component/file/FilerConsumerDoneFileNoopTest.java
----------------------------------------------------------------------
diff --git 
a/camel-core/src/test/java/org/apache/camel/component/file/FilerConsumerDoneFileNoopTest.java
 
b/camel-core/src/test/java/org/apache/camel/component/file/FilerConsumerDoneFileNoopTest.java
index 6b893e0..1807351 100644
--- 
a/camel-core/src/test/java/org/apache/camel/component/file/FilerConsumerDoneFileNoopTest.java
+++ 
b/camel-core/src/test/java/org/apache/camel/component/file/FilerConsumerDoneFileNoopTest.java
@@ -35,12 +35,11 @@ public class FilerConsumerDoneFileNoopTest extends 
ContextTestSupport {
 
     public void testDoneFile() throws Exception {
         getMockEndpoint("mock:result").expectedMessageCount(0);
+        // wait a bit and it should not pickup the written file as there are 
no done file
+        getMockEndpoint("mock:result").setResultMinimumWaitTime(50);
 
         template.sendBodyAndHeader("file:target/done", "Hello World", 
Exchange.FILE_NAME, "hello.txt");
 
-        // wait a bit and it should not pickup the written file as there are 
no done file
-        Thread.sleep(250);
-
         assertMockEndpointsSatisfied();
         resetMocks();
         oneExchangeDone.reset();
@@ -67,7 +66,7 @@ public class FilerConsumerDoneFileNoopTest extends 
ContextTestSupport {
         return new RouteBuilder() {
             @Override
             public void configure() throws Exception {
-                
from("file:target/done?doneFileName=done&noop=true").to("mock:result");
+                
from("file:target/done?initialDelay=0&delay=10&doneFileName=done&noop=true").to("mock:result");
             }
         };
     }

http://git-wip-us.apache.org/repos/asf/camel/blob/acf2b03d/camel-core/src/test/java/org/apache/camel/component/file/NewFileConsumeTest.java
----------------------------------------------------------------------
diff --git 
a/camel-core/src/test/java/org/apache/camel/component/file/NewFileConsumeTest.java
 
b/camel-core/src/test/java/org/apache/camel/component/file/NewFileConsumeTest.java
index 5fb1815..194f9e8 100644
--- 
a/camel-core/src/test/java/org/apache/camel/component/file/NewFileConsumeTest.java
+++ 
b/camel-core/src/test/java/org/apache/camel/component/file/NewFileConsumeTest.java
@@ -20,6 +20,7 @@ import java.io.File;
 import java.io.FileOutputStream;
 import java.util.HashMap;
 import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.TimeUnit;
 
 import org.apache.camel.Consumer;
 import org.apache.camel.ContextTestSupport;
@@ -68,7 +69,7 @@ public class NewFileConsumeTest extends ContextTestSupport {
             }
         });
         consumer.start();
-        latch.await();
+        latch.await(5, TimeUnit.SECONDS);
 
         consumer.stop();
     }

http://git-wip-us.apache.org/repos/asf/camel/blob/acf2b03d/camel-core/src/test/java/org/apache/camel/component/seda/DirectRequestReplyAndSedaInOnlyTest.java
----------------------------------------------------------------------
diff --git 
a/camel-core/src/test/java/org/apache/camel/component/seda/DirectRequestReplyAndSedaInOnlyTest.java
 
b/camel-core/src/test/java/org/apache/camel/component/seda/DirectRequestReplyAndSedaInOnlyTest.java
index af8d38c..cbd6d75 100644
--- 
a/camel-core/src/test/java/org/apache/camel/component/seda/DirectRequestReplyAndSedaInOnlyTest.java
+++ 
b/camel-core/src/test/java/org/apache/camel/component/seda/DirectRequestReplyAndSedaInOnlyTest.java
@@ -44,7 +44,7 @@ public class DirectRequestReplyAndSedaInOnlyTest extends 
ContextTestSupport {
                 // In EIP patterns the WireTap pattern is what this would be
                 from("direct:start").transform(constant("Bye 
World")).inOnly("seda:log");
 
-                
from("seda:log").delay(1000).transform(body().prepend("Logging: 
")).to("log:log", "mock:log");
+                from("seda:log").transform(body().prepend("Logging: 
")).to("log:log", "mock:log");
             }
         };
     }

Reply via email to