/[projects]/miscJava/CircuitBreaker/src/test/java/dk/thoerup/circuitbreaker/TestCircuitBreaker.java
ViewVC logotype

Diff of /miscJava/CircuitBreaker/src/test/java/dk/thoerup/circuitbreaker/TestCircuitBreaker.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 456 by torben, Tue Oct 20 20:42:36 2009 UTC revision 459 by torben, Wed Oct 21 07:52:08 2009 UTC
# Line 135  public class TestCircuitBreaker { Line 135  public class TestCircuitBreaker {
135                  assertTrue( cb.isOpen() );                  assertTrue( cb.isOpen() );
136                  Thread.sleep(DELAY*2);                  Thread.sleep(DELAY*2);
137                                    
138                  cb.invoke( new FailingInvocation() ); //in half open this will cause a CircuitBreakerException                            cb.invoke( new FailingInvocation() ); //in half-open this will cause a CircuitBreakerException, as if it was in open mode              
139          }          }
140                    
141          @Test public void halfOpen3() throws Exception {          @Test public void halfOpen3() throws Exception {
# Line 145  public class TestCircuitBreaker { Line 145  public class TestCircuitBreaker {
145                  Thread.sleep(DELAY*2);                  Thread.sleep(DELAY*2);
146                                    
147                  try{                  try{
148                          cb.invoke( new FailingInvocation() );                          cb.invoke( new FailingInvocation() );
149                  } catch (CircuitBreakerException e) {}                  } catch (CircuitBreakerException e) {}
150    
151                  assertTrue( cb.isOpen() );                  assertTrue( cb.isOpen() ); //after failing in half-open go back to open
152          }          }
153    
154                    

Legend:
Removed from v.456  
changed lines
  Added in v.459

  ViewVC Help
Powered by ViewVC 1.1.20