Interface RetryStrategy
-
- All Known Implementing Classes:
AbstractRetryStrategy,RetryOnExceptionStrategy,RetryOnFailureStrategy
public interface RetryStrategyRetry strategy for executing retry tests.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidhandleException(String testName, int attemptIndex, Throwable throwable)Handle an exception that occurred during the annotated test attempt.booleanhasNextAttempt()Return the next attempt should execute or not.voidstopFollowingAttempts()Stop the following attempts when test succeed or failed.
-
-
-
Method Detail
-
hasNextAttempt
boolean hasNextAttempt()
Return the next attempt should execute or not.
-
stopFollowingAttempts
void stopFollowingAttempts()
Stop the following attempts when test succeed or failed.
-
handleException
void handleException(String testName, int attemptIndex, Throwable throwable) throws Throwable
Handle an exception that occurred during the annotated test attempt.This method can swallow the exception to pass the test.
- Parameters:
testName- the test nameattemptIndex- test attempt index that starts from 1throwable- the throwable that the test case throws- Throws:
org.opentest4j.TestAbortedException- When handling a test attempt failure, throwing this exception indicates another attempt should be made.Throwable- Propagating the original exception, or throwing any other exception indicates that the test has definitively failed and no further attempts should be made.
-
-