Class RetryConditionTest
java.lang.Object
org.jboss.arquillian.testng.Arquillian
org.eclipse.microprofile.fault.tolerance.tck.RetryConditionTest
- All Implemented Interfaces:
org.testng.IHookable,org.testng.ITestNGListener
public class RetryConditionTest
extends org.jboss.arquillian.testng.Arquillian
Test the retryOn and abortOn conditions. If retryOn condition is not met, no retry will be performed. If abortOn
condition is met, no retry will be performed.
- Author:
- Emily Jiang
-
Nested Class Summary
Nested classes/interfaces inherited from class org.jboss.arquillian.testng.Arquillian
org.jboss.arquillian.testng.Arquillian.UpdateResultListener -
Field Summary
FieldsFields inherited from class org.jboss.arquillian.testng.Arquillian
ARQUILLIAN_DATA_PROVIDER -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic org.jboss.shrinkwrap.api.spec.WebArchivedeploy()voidPersistent Error condition.voidAnalogous to testRetryonFalse, testing whether the@Retryannotation on method serviceB overrides the Class level@Retryannotation.voidAnalogous to testRetryOnTrue but using a Class level rather than method level annotation.voidAnalogous to testRetryWithAbortOnFalse but using a Class level rather than method level@Retryannotation.voidAnalogous to testRetryWithAbortOnTrue, testing whether the@Retryannotation on method serviceB overrides the Class level@Retryannotation.voidPersistent Error condition outside the CompletableFuture.voidPersistent Error condition inside a CompletableFuture.voidPersistent Error condition.voidTemporary error.voidTemporary error.voidTest that no retries are executed where a failure declared as "retry on" in the@Retryannotation is NOT encountered.voidTest that retries are executed where a failure declared as "retry on" in the@Retryannotation is encountered by inheritance.voidTest that retries are executed where a failure declared as "retry on" in the@Retryannotation is encountered.voidTest that retries are executed where a failure declared as "retry on" in the@Retryannotation is encountered by inheritance.voidPersistent Error condition.voidTemporary error.voidTemporary error.voidTest that the default number of retries are executed where a failure declared as "abort on" in the@Retryannotation is NOT encountered.voidTest that no retries are executed where a failure declared as "abort on" in the@Retryannotation is encountered.Methods inherited from class org.jboss.arquillian.testng.Arquillian
arquillianAfterClass, arquillianAfterSuite, arquillianAfterTest, arquillianArgumentProvider, arquillianBeforeClass, arquillianBeforeSuite, arquillianBeforeTest, run
-
Field Details
-
SIMULATED_EXCEPTION_MESSAGE
- See Also:
-
SIMULATED_RUNTIME_EXCEPTION_MESSAGE
- See Also:
-
-
Constructor Details
-
RetryConditionTest
public RetryConditionTest()
-
-
Method Details
-
deploy
@Deployment public static org.jboss.shrinkwrap.api.spec.WebArchive deploy() -
testRetryOnTrue
public void testRetryOnTrue()Test that retries are executed where a failure declared as "retry on" in the@Retryannotation is encountered. serviceA is configured to retry on a TestException. The service should be retried 3 times. -
testRetryOnFalse
public void testRetryOnFalse()Test that no retries are executed where a failure declared as "retry on" in the@Retryannotation is NOT encountered. serviceB is configured to retry on an IOException. In practice the only exception that the service will throw is a TestException, therefore no retries should be executed. -
testRetryOnTrueThrowingAChildCustomException
public void testRetryOnTrueThrowingAChildCustomException()Test that retries are executed where a failure declared as "retry on" in the@Retryannotation is encountered by inheritance. Service that throws a child custom exception but in the retry on list is configured child's parent custom exception -
testRetryOnFalseAndAbortOnTrueThrowingAChildCustomException
public void testRetryOnFalseAndAbortOnTrueThrowingAChildCustomException()Test that retries are executed where a failure declared as "retry on" in the@Retryannotation is encountered by inheritance. Service that throws a child custom exception but in the retry on list is configured child's parent custom exception and in the abort on list is configured the child custom exception. For this case the retry on will be false and the abort on will be true due the class configured in the abort on list is equals to the exception that is throwing by the serviceD not like in the retry on list where is configured the parent exception class of the throwing by the serviceD. So the highest priority will be when the exception type is equals -
testRetryWithAbortOnFalse
public void testRetryWithAbortOnFalse()Test that the default number of retries are executed where a failure declared as "abort on" in the@Retryannotation is NOT encountered. serviceA is configured to abort on an IOException. In practice the only exception that the service will throw is a TestException, therefore the default number of 3 retries should be executed. -
testRetryWithAbortOnTrue
public void testRetryWithAbortOnTrue()Test that no retries are executed where a failure declared as "abort on" in the@Retryannotation is encountered. serviceB is configured to abort on a TestException. The service should not be retried. -
testClassLevelRetryOnTrue
public void testClassLevelRetryOnTrue()Analogous to testRetryOnTrue but using a Class level rather than method level annotation. serviceA is configured to retry on a TestException. The service should be retried 3 times. -
testClassLevelRetryOnFalse
public void testClassLevelRetryOnFalse()Analogous to testRetryonFalse, testing whether the@Retryannotation on method serviceB overrides the Class level@Retryannotation. serviceB is configured to retry on an IOException. In practice the only exception that the service will throw is a TestException, therefore no retries should be executed. -
testClassLevelRetryWithAbortOnFalse
public void testClassLevelRetryWithAbortOnFalse()Analogous to testRetryWithAbortOnFalse but using a Class level rather than method level@Retryannotation. Test that the default number of retries are executed where a failure declared as "abort on" in the@Retryannotation is NOT encountered. The Class, and therefore serviceA, is configured to abort on an IOException. In practice the only exception that the service will throw is a TestException, therefore the default number of 3 retries should be executed. -
testClassLevelRetryWithAbortOnTrue
public void testClassLevelRetryWithAbortOnTrue()Analogous to testRetryWithAbortOnTrue, testing whether the@Retryannotation on method serviceB overrides the Class level@Retryannotation. Test that no retries are executed where a failure declared as "abort on" in the@Retryannotation is encountered. serviceB is configured to abort on a TestException. The service should not be retried. -
testAsyncRetryExceptionally
public void testAsyncRetryExceptionally()Persistent Error condition. Will retry 2 times and still throw exception. ServiceA usesAsynchronousand will always return IOException. -
testNoAsynWilNotRetryExceptionally
public void testNoAsynWilNotRetryExceptionally()Persistent Error condition inside a CompletableFuture. Will not retry because method is not marked with @Asynchronous ServiceB will always complete exceptionally with IOException. -
testNoAsynRetryOnMethodException
public void testNoAsynRetryOnMethodException()Persistent Error condition outside the CompletableFuture. Will retry because ServiceB will always throw IOException. -
testRetrySuccess
public void testRetrySuccess()Temporary error. Will retry 2 times, the first 2 executions will fail. ServiceC usesAsynchronous. -
testRetryChainSuccess
public void testRetryChainSuccess()Temporary error. Will retry 2 times, the first 2 executions will fail deep in a CompletableFuture chained execution. ServiceD usesAsynchronousand chains 2 CompletableFutures. -
testRetryChainExceptionally
public void testRetryChainExceptionally()Persistent Error condition. Will retry 3 times and still throw exception. ServiceE will always return IOException. -
testRetryParallelExceptionally
public void testRetryParallelExceptionally()Persistent Error condition. Will retry 3 times and still throw exception. ServiceF will always return IOException. -
testRetryParallelSuccess
public void testRetryParallelSuccess()Temporary error. Will retry 2 times, the first 2 executions fail in a CompletableFuture parallel execution. ServiceG usesAsynchronousand 2 CompletableFutures. -
testRetryCompletionStageWithException
public void testRetryCompletionStageWithException()Temporary error. Will retry 2 times, the first 2 executions fail and the method will throw an exception.
-