camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject [3/5] camel git commit: CAMEL-8584 Update half-open test to assert circuit stays open during halfOpenAfter period
Date Thu, 02 Apr 2015 08:11:17 GMT
CAMEL-8584 Update half-open test to assert circuit stays open during
halfOpenAfter period


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

Branch: refs/heads/master
Commit: 323ab6bd5c9c0ef1abab610270343d00f77ec6c6
Parents: d85f2f0
Author: jack.perrett <jack.perrett@gamesys.co.uk>
Authored: Wed Apr 1 12:55:16 2015 +0100
Committer: Claus Ibsen <davsclaus@apache.org>
Committed: Thu Apr 2 10:11:45 2015 +0200

----------------------------------------------------------------------
 .../processor/CircuitBreakerLoadBalancerTest.java | 18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/323ab6bd/camel-core/src/test/java/org/apache/camel/processor/CircuitBreakerLoadBalancerTest.java
----------------------------------------------------------------------
diff --git a/camel-core/src/test/java/org/apache/camel/processor/CircuitBreakerLoadBalancerTest.java
b/camel-core/src/test/java/org/apache/camel/processor/CircuitBreakerLoadBalancerTest.java
index 2644240..3607ae8 100644
--- a/camel-core/src/test/java/org/apache/camel/processor/CircuitBreakerLoadBalancerTest.java
+++ b/camel-core/src/test/java/org/apache/camel/processor/CircuitBreakerLoadBalancerTest.java
@@ -102,17 +102,17 @@ public class CircuitBreakerLoadBalancerTest extends ContextTestSupport
{
         assertTrue(exchangeThree.getException() instanceof RejectedExecutionException);
     }
     
-    public void testHalfOpenAfterMessageThreeSync() throws Exception {
+    public void testHalfOpenAfterTimeoutSync() throws Exception {
         String endpoint = "direct:start";
-        halfOpenAfterMessageThree(endpoint);
+        halfOpenAfterTimeout(endpoint);
     }
     
-    public void testHalfOpenAfterMessageThreeAsync() throws Exception {
+    public void testHalfOpenAfterTimeoutAsync() throws Exception {
         String endpoint = "direct:start-async";
-        halfOpenAfterMessageThree(endpoint);
+        halfOpenAfterTimeout(endpoint);
     }
     
-    private void halfOpenAfterMessageThree(String endpoint) throws InterruptedException,
Exception {
+    private void halfOpenAfterTimeout(String endpoint) throws InterruptedException, Exception
{
         expectsMessageCount(2, result);
 
         result.whenAnyExchangeReceived(new Processor() {
@@ -125,6 +125,7 @@ public class CircuitBreakerLoadBalancerTest extends ContextTestSupport
{
         Exchange exchangeOne = sendMessage(endpoint, "message one");
         Exchange exchangeTwo = sendMessage(endpoint, "message two");
         Exchange exchangeThree = sendMessage(endpoint, "message three");
+        Exchange exchangeFour = sendMessage(endpoint, "message four");
         assertMockEndpointsSatisfied();
         Thread.sleep(1000);
         result.reset();
@@ -135,15 +136,16 @@ public class CircuitBreakerLoadBalancerTest extends ContextTestSupport
{
             }
         });
         expectsMessageCount(1, result);
-        Exchange exchangeFour = sendMessage(endpoint, "message four");
         Exchange exchangeFive = sendMessage(endpoint, "message five");
+        Exchange exchangeSix = sendMessage(endpoint, "message six");
         assertMockEndpointsSatisfied();
         
         assertTrue(exchangeOne.getException() instanceof MyCustomException);
         assertTrue(exchangeTwo.getException() instanceof MyCustomException);
         assertTrue(exchangeThree.getException() instanceof RejectedExecutionException);
-        assertTrue(exchangeFour.getException() instanceof MyCustomException);
-        assertTrue(exchangeFive.getException() instanceof RejectedExecutionException);
+        assertTrue(exchangeFour.getException() instanceof RejectedExecutionException);
+        assertTrue(exchangeFive.getException() instanceof MyCustomException);
+        assertTrue(exchangeSix.getException() instanceof RejectedExecutionException);
     }
     
     public void testHalfOpenToCloseTransitionSync() throws Exception {


Mime
View raw message