public class CircuitBreakerTest
extends org.jboss.arquillian.testng.Arquillian
Constructor and Description |
---|
CircuitBreakerTest() |
Modifier and Type | Method and Description |
---|---|
static org.jboss.shrinkwrap.api.spec.WebArchive |
deploy() |
void |
testCircuitClosedThenOpen()
A test to exercise Circuit Breaker thresholds, with a default
SuccessThreshold
With requestVolumeThreshold = 4, failureRatio=0.75, successThreshold = 2,
delay = 50000 the expected behaviour is,
Execution Behaviour
========= =========
1 RunTimeException
2 RunTimeException
3 RunTimeException
4 RunTimeException
5 CircuitBreakerOpenException
6 CircuitBreakerOpenException
7 CircuitBreakerOpenException
|
void |
testCircuitDefaultSuccessThreshold()
A test to exercise Circuit Breaker thresholds, with a default
SuccessThreshold
With requestVolumeThreshold = 4, failureRatio=0.75 and successThreshold = 1
the expected behaviour is,
Execution Behaviour
========= =========
1 RunTimeException
2 RunTimeException
3 RunTimeException
4 RunTimeException
5 CircuitBreakerOpenException
Pause for longer than CircuitBreaker delay, so that it transitions to half-open
6 SUCCEED (CircuitBreaker will be re-closed as successThreshold is 1.
|
void |
testCircuitHighSuccessThreshold()
A test to exercise Circuit Breaker thresholds, with a default
SuccessThreshold
With requestVolumeThreshold = 4, failureRatio=0.75 and successThreshold = 3
the expected behaviour is,
Execution Behaviour
========= =========
1 RunTimeException
2 RunTimeException
3 RunTimeException
4 RunTimeException
5 CircuitBreakerOpenException
Pause for longer than CircuitBreaker delay, so that it transitions to half-open
6 SUCCEED
7 SUCCEED
8 RunTimeException (CircuitBreaker will be re-opened)
9 CircuitBreakerOpenException
|
void |
testCircuitReClose()
A test to exercise Circuit Breaker thresholds, with a SuccessThreshold of
2
With requestVolumeThreshold = 4, failureRatio=0.75 and successThreshold =
2 the expected behaviour is,
Execution Behaviour
========= =========
1 RunTimeException
2 RunTimeException
3 RunTimeException
4 RunTimeException
Pause for longer than CircuitBreaker delay, so that it transitions to half-open
5 SUCCEED
6 SUCCEED (CircuitBreaker will be re-closed as successThreshold is 2)
7 SUCCEED
|
void |
testClassLevelCircuitBase()
Analogous to testCircuitClosedThenOpen but using a Class level rather
than method level annotation.
|
void |
testClassLevelCircuitOverride()
Analogous to testCircuitClosedThenOpen but with a Class level annotation
specified that is overridden by a Method level annotation on serviceC.
|
void |
testClassLevelCircuitOverrideNoDelay()
Analogous to testCircuitReClose but with a Class level annotation
specified that is overridden by a Method level annotation on serviceD.
|
void |
testRollingWindowCircuitOpen()
A test to exercise Circuit Breaker rolling window
With requestVolumeThreshold = 4, failureRatio=0.5, expected behaviour is,
Execution Behaviour
========= =========
1 Success
2 RunTimeException
3 RunTimeException
4 Success
5 CircuitBreakerOpenException
|
void |
testRollingWindowCircuitOpen2()
A test to exercise Circuit Breaker rolling window
With requestVolumeThreshold = 4, failureRatio=0.5, expected behaviour is,
Execution Behaviour
========= =========
1 Success
2 RunTimeException
3 Success
4 Success
5 RuntimeException
6 CircuitBreakerOpenException
|
@Deployment public static org.jboss.shrinkwrap.api.spec.WebArchive deploy()
public void testCircuitClosedThenOpen()
public void testCircuitReClose()
public void testCircuitDefaultSuccessThreshold()
public void testCircuitHighSuccessThreshold()
public void testClassLevelCircuitBase()
public void testClassLevelCircuitOverride()
public void testClassLevelCircuitOverrideNoDelay()
public void testRollingWindowCircuitOpen()
public void testRollingWindowCircuitOpen2()
Copyright © 2020 Eclipse Foundation. All rights reserved.