camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cmuel...@apache.org
Subject svn commit: r1382443 - /camel/branches/camel-2.9.x/camel-core/src/test/java/org/apache/camel/component/file/FromFilePollThirdTimeOkTest.java
Date Sun, 09 Sep 2012 10:44:24 GMT
Author: cmueller
Date: Sun Sep  9 10:44:24 2012
New Revision: 1382443

URL: http://svn.apache.org/viewvc?rev=1382443&view=rev
Log:
small code enhancement for a test which fails randomly on slow CI server

Modified:
    camel/branches/camel-2.9.x/camel-core/src/test/java/org/apache/camel/component/file/FromFilePollThirdTimeOkTest.java

Modified: camel/branches/camel-2.9.x/camel-core/src/test/java/org/apache/camel/component/file/FromFilePollThirdTimeOkTest.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.9.x/camel-core/src/test/java/org/apache/camel/component/file/FromFilePollThirdTimeOkTest.java?rev=1382443&r1=1382442&r2=1382443&view=diff
==============================================================================
--- camel/branches/camel-2.9.x/camel-core/src/test/java/org/apache/camel/component/file/FromFilePollThirdTimeOkTest.java
(original)
+++ camel/branches/camel-2.9.x/camel-core/src/test/java/org/apache/camel/component/file/FromFilePollThirdTimeOkTest.java
Sun Sep  9 10:44:24 2012
@@ -24,9 +24,6 @@ import org.apache.camel.Processor;
 import org.apache.camel.builder.NotifyBuilder;
 import org.apache.camel.builder.RouteBuilder;
 
-/**
- * @version 
- */
 public class FromFilePollThirdTimeOkTest extends ContextTestSupport {
 
     private static int counter;
@@ -46,31 +43,30 @@ public class FromFilePollThirdTimeOkTest
         getMockEndpoint("mock:result").expectedBodiesReceived(body);
 
         assertMockEndpointsSatisfied();
-        notify.matchesMockWaitTime();
-
+        assertTrue(notify.matchesMockWaitTime());
         assertEquals(3, counter);
 
         // assert the file is deleted
-        File file = new File("./target/deletefile/hello.txt");
-        file = file.getAbsoluteFile();
+        File file = new File("./target/deletefile/hello.txt").getAbsoluteFile();
         assertFalse("The file should have been deleted", file.exists());
     }
 
     protected RouteBuilder createRouteBuilder() throws Exception {
         return new RouteBuilder() {
             public void configure() throws Exception {
-                from("file://target/deletefile?delete=true&initialDelay=0&delay=10").process(new
Processor() {
-                    public void process(Exchange exchange) throws Exception {
-                        counter++;
-                        if (counter < 3) {
-                            // file should exists
-                            File file = new File("./target/deletefile/hello.txt");
-                            file = file.getAbsoluteFile();
-                            assertTrue("The file should NOT have been deleted", file.exists());
-                            throw new IllegalArgumentException("Forced by unittest");
+                from("file://target/deletefile?delete=true&initialDelay=0&delay=10")
+                    .process(new Processor() {
+                        public void process(Exchange exchange) throws Exception {
+                            counter++;
+                            if (counter < 3) {
+                                // file should exists
+                                File file = new File("./target/deletefile/hello.txt").getAbsoluteFile();
+                                assertTrue("The file should NOT have been deleted", file.exists());
+                                throw new IllegalArgumentException("Forced by unittest");
+                            }
                         }
-                    }
-                }).to("mock:result");
+                    })
+                    .to("mock:result");
             }
         };
     }



Mime
View raw message