Fixed test

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

Branch: refs/heads/camel-2.12.x
Commit: 5362037cab1c0fd367ac19b99784beb971cc0315
Parents: d77ad14
Author: Claus Ibsen <davscl...@apache.org>
Authored: Mon Nov 18 11:16:51 2013 +0100
Committer: Claus Ibsen <davscl...@apache.org>
Committed: Mon Nov 18 11:17:10 2013 +0100

----------------------------------------------------------------------
 .../file/FileConsumePollEnrichFileTest.java          | 15 ++++++---------
 1 file changed, 6 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/5362037c/camel-core/src/test/java/org/apache/camel/component/file/FileConsumePollEnrichFileTest.java
----------------------------------------------------------------------
diff --git 
a/camel-core/src/test/java/org/apache/camel/component/file/FileConsumePollEnrichFileTest.java
 
b/camel-core/src/test/java/org/apache/camel/component/file/FileConsumePollEnrichFileTest.java
index 726785a..d9dcaac 100644
--- 
a/camel-core/src/test/java/org/apache/camel/component/file/FileConsumePollEnrichFileTest.java
+++ 
b/camel-core/src/test/java/org/apache/camel/component/file/FileConsumePollEnrichFileTest.java
@@ -35,20 +35,17 @@ public class FileConsumePollEnrichFileTest extends 
ContextTestSupport {
 
         MockEndpoint mock = getMockEndpoint("mock:result");
         mock.expectedBodiesReceived("Big file");
+        mock.expectedFileExists("target/enrich/.done/AAA.fin");
+        mock.expectedFileExists("target/enrichdata/.done/AAA.dat");
 
         template.sendBodyAndHeader("file://target/enrich", "Start", 
Exchange.FILE_NAME, "AAA.fin");
 
-        log.info("Sleeping for 2 sec before writing enrichdata file");
-        Thread.sleep(2000);
+        log.info("Sleeping for 1 sec before writing enrichdata file");
+        Thread.sleep(1000);
         template.sendBodyAndHeader("file://target/enrichdata", "Big file", 
Exchange.FILE_NAME, "AAA.dat");
         log.info("... write done");
 
-        mock.assertIsSatisfied();
-
-        // because the on completion is executed async, we should wait a bit 
to not fail on slow CI servers
-        Thread.sleep(200);
-        assertFileExists("target/enrich/.done/AAA.fin");
-        assertFileExists("target/enrichdata/.done/AAA.dat");
+        assertMockEndpointsSatisfied();
     }
 
     @Override
@@ -58,7 +55,7 @@ public class FileConsumePollEnrichFileTest extends 
ContextTestSupport {
             public void configure() throws Exception {
                 from("file://target/enrich?move=.done")
                     .to("mock:start")
-                    .pollEnrich("file://target/enrichdata?move=.done", 20000)
+                    .pollEnrich("file://target/enrichdata?move=.done", 10000)
                     .to("mock:result");
             }
         };

Reply via email to