You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2015/11/22 09:20:38 UTC

[2/2] camel git commit: Fixed potential test error

Fixed potential test error


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

Branch: refs/heads/camel-2.16.x
Commit: 0399fd40cbb9430aa786b6e6c31ea51521beed92
Parents: bef5bde
Author: Claus Ibsen <da...@apache.org>
Authored: Sun Nov 22 09:20:08 2015 +0100
Committer: Claus Ibsen <da...@apache.org>
Committed: Sun Nov 22 09:20:27 2015 +0100

----------------------------------------------------------------------
 .../src/test/java/org/apache/camel/TestSupport.java       | 10 +++++++++-
 .../FileChangedReadLockMinAgeShortCircuitTest.java        |  2 +-
 .../file/strategy/FileChangedReadLockMinAgeTest.java      |  3 +--
 3 files changed, 11 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/0399fd40/camel-core/src/test/java/org/apache/camel/TestSupport.java
----------------------------------------------------------------------
diff --git a/camel-core/src/test/java/org/apache/camel/TestSupport.java b/camel-core/src/test/java/org/apache/camel/TestSupport.java
index ed76051..6d91a26 100644
--- a/camel-core/src/test/java/org/apache/camel/TestSupport.java
+++ b/camel-core/src/test/java/org/apache/camel/TestSupport.java
@@ -73,13 +73,21 @@ public abstract class TestSupport extends TestCase {
     }
 
     /**
-     * Returns a value builder for the given property
+     * Returns a value builder for the given exchange property
      */
+    @Deprecated
     public static ValueBuilder property(String name) {
         return Builder.exchangeProperty(name);
     }
 
     /**
+     * Returns a value builder for the given exchange property
+     */
+    public static ValueBuilder exchangeProperty(String name) {
+        return Builder.exchangeProperty(name);
+    }
+
+    /**
      * Returns a predicate and value builder for the inbound body on an exchange
      */
     public static ValueBuilder body() {

http://git-wip-us.apache.org/repos/asf/camel/blob/0399fd40/camel-core/src/test/java/org/apache/camel/component/file/strategy/FileChangedReadLockMinAgeShortCircuitTest.java
----------------------------------------------------------------------
diff --git a/camel-core/src/test/java/org/apache/camel/component/file/strategy/FileChangedReadLockMinAgeShortCircuitTest.java b/camel-core/src/test/java/org/apache/camel/component/file/strategy/FileChangedReadLockMinAgeShortCircuitTest.java
index 524452d..b5db872 100644
--- a/camel-core/src/test/java/org/apache/camel/component/file/strategy/FileChangedReadLockMinAgeShortCircuitTest.java
+++ b/camel-core/src/test/java/org/apache/camel/component/file/strategy/FileChangedReadLockMinAgeShortCircuitTest.java
@@ -47,7 +47,7 @@ public class FileChangedReadLockMinAgeShortCircuitTest extends ContextTestSuppor
         mock.expectedMessageCount(1);
         mock.expectedFileExists("target/changed/out/file.dat");
         // We should get the file on the first poll
-        mock.expectedMessagesMatches(property(Exchange.RECEIVED_TIMESTAMP).convertTo(long.class).isLessThan(new Date().getTime() + 15000));
+        mock.expectedMessagesMatches(exchangeProperty(Exchange.RECEIVED_TIMESTAMP).convertTo(long.class).isLessThan(new Date().getTime() + 15000));
 
         assertMockEndpointsSatisfied();
     }

http://git-wip-us.apache.org/repos/asf/camel/blob/0399fd40/camel-core/src/test/java/org/apache/camel/component/file/strategy/FileChangedReadLockMinAgeTest.java
----------------------------------------------------------------------
diff --git a/camel-core/src/test/java/org/apache/camel/component/file/strategy/FileChangedReadLockMinAgeTest.java b/camel-core/src/test/java/org/apache/camel/component/file/strategy/FileChangedReadLockMinAgeTest.java
index c0690fc..4efcc2a 100644
--- a/camel-core/src/test/java/org/apache/camel/component/file/strategy/FileChangedReadLockMinAgeTest.java
+++ b/camel-core/src/test/java/org/apache/camel/component/file/strategy/FileChangedReadLockMinAgeTest.java
@@ -45,8 +45,7 @@ public class FileChangedReadLockMinAgeTest extends ContextTestSupport {
         MockEndpoint mock = getMockEndpoint("mock:result");
         mock.expectedMessageCount(1);
         mock.expectedFileExists("target/changed/out/slowfile.dat");
-        // writing takes ~2 seconds, and then it has to age for at least minAge milliseconds (3 seconds)
-        mock.expectedMessagesMatches(property(Exchange.RECEIVED_TIMESTAMP).convertTo(long.class).isGreaterThan(new Date().getTime() + 5000));
+        mock.expectedMessagesMatches(exchangeProperty(Exchange.RECEIVED_TIMESTAMP).convertTo(long.class).isGreaterThan(new Date().getTime() + 3000));
 
         writeSlowFile();