Fixed test. This closes #1404
Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/0243960c Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/0243960c Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/0243960c Branch: refs/heads/master Commit: 0243960c5c6f5bfb0e140e52c19f980a4229f82d Parents: 3232712 Author: Claus Ibsen <davscl...@apache.org> Authored: Fri Jan 20 10:36:03 2017 +0100 Committer: Claus Ibsen <davscl...@apache.org> Committed: Fri Jan 20 10:36:03 2017 +0100 ---------------------------------------------------------------------- .../management/ManagedThrottlingExceptionRoutePolicyTest.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/camel/blob/0243960c/camel-core/src/test/java/org/apache/camel/management/ManagedThrottlingExceptionRoutePolicyTest.java ---------------------------------------------------------------------- diff --git a/camel-core/src/test/java/org/apache/camel/management/ManagedThrottlingExceptionRoutePolicyTest.java b/camel-core/src/test/java/org/apache/camel/management/ManagedThrottlingExceptionRoutePolicyTest.java index 0d41938..eab7635 100644 --- a/camel-core/src/test/java/org/apache/camel/management/ManagedThrottlingExceptionRoutePolicyTest.java +++ b/camel-core/src/test/java/org/apache/camel/management/ManagedThrottlingExceptionRoutePolicyTest.java @@ -123,11 +123,11 @@ public class ManagedThrottlingExceptionRoutePolicyTest extends ManagementTestSu myState = proxy.currentState(); assertTrue(myState.contains("State closed, failures 1, last failure")); - // the route has no failures + // the route has 1 failure val = proxy.getCurrentFailures(); assertEquals(1, val.intValue()); - // the route has no failures + // the route has 1 failure X mills ago lastFail = proxy.getLastFailure(); assertTrue(lastFail.longValue() > 0); } @@ -153,6 +153,8 @@ public class ManagedThrottlingExceptionRoutePolicyTest extends ManagementTestSu @Override public void process(Exchange exchange) throws Exception { + // need to sleep a little to cause last failure to be slow + Thread.sleep(50); throw new RuntimeException("boom!"); }