public class RetryOnExceptionStrategy extends AbstractRetryStrategy
hasNextAttempt, totalTimes
Constructor and Description |
---|
RetryOnExceptionStrategy(int retryTimes,
Class<? extends Throwable> repeatableException) |
Modifier and Type | Method and Description |
---|---|
void |
handleException(String testName,
int attemptIndex,
Throwable throwable)
Handle an exception that occurred during the annotated test attempt.
|
hasNextAttempt, stopFollowingAttempts
public void handleException(String testName, int attemptIndex, Throwable throwable) throws Throwable
RetryStrategy
This method can swallow the exception to pass the test.
testName
- the test nameattemptIndex
- test attempt index that starts from 1throwable
- the throwable that the test case throwsorg.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.Copyright © 2014–2023 The Apache Software Foundation. All rights reserved.