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 { |
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 |
|
|