Module org.junitpioneer
Package org.junitpioneer.jupiter
Class RetryingTestExtension.FailedTestRetrier
- java.lang.Object
-
- org.junitpioneer.jupiter.RetryingTestExtension.FailedTestRetrier
-
- All Implemented Interfaces:
java.util.Iterator<RetryingTestInvocationContext>
- Enclosing class:
- RetryingTestExtension
private static class RetryingTestExtension.FailedTestRetrier extends java.lang.Object implements java.util.Iterator<RetryingTestInvocationContext>
-
-
Field Summary
Fields Modifier and Type Field Description private intexceptionsSoFarprivate java.lang.Class<? extends java.lang.Throwable>[]expectedExceptionsprivate TestNameFormatterformatterprivate intmaxRetriesprivate intminSuccessprivate intretriesSoFarprivate java.util.List<org.opentest4j.TestAbortedException>seenExceptionsprivate booleanseenFailedAssumptionprivate booleanseenUnexpectedExceptionprivate intsuspendForMs
-
Constructor Summary
Constructors Modifier Constructor Description privateFailedTestRetrier(int maxRetries, int minSuccess, int suspendForMs, java.lang.Class<? extends java.lang.Throwable>[] expectedExceptions, TestNameFormatter formatter)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) static RetryingTestExtension.FailedTestRetriercreateFor(java.lang.reflect.Method test, org.junit.jupiter.api.extension.ExtensionContext context)private booleanexpectedException(java.lang.Throwable exception)(package private) <E extends java.lang.Throwable>
voidfailed(E exception)booleanhasNext()private booleanisFirstExecution()RetryingTestInvocationContextnext()private voidsuspendFor(int millis)
-
-
-
Field Detail
-
maxRetries
private final int maxRetries
-
minSuccess
private final int minSuccess
-
suspendForMs
private final int suspendForMs
-
expectedExceptions
private final java.lang.Class<? extends java.lang.Throwable>[] expectedExceptions
-
seenExceptions
private final java.util.List<org.opentest4j.TestAbortedException> seenExceptions
-
formatter
private final TestNameFormatter formatter
-
retriesSoFar
private int retriesSoFar
-
exceptionsSoFar
private int exceptionsSoFar
-
seenFailedAssumption
private boolean seenFailedAssumption
-
seenUnexpectedException
private boolean seenUnexpectedException
-
-
Constructor Detail
-
FailedTestRetrier
private FailedTestRetrier(int maxRetries, int minSuccess, int suspendForMs, java.lang.Class<? extends java.lang.Throwable>[] expectedExceptions, TestNameFormatter formatter)
-
-
Method Detail
-
createFor
static RetryingTestExtension.FailedTestRetrier createFor(java.lang.reflect.Method test, org.junit.jupiter.api.extension.ExtensionContext context)
-
failed
<E extends java.lang.Throwable> void failed(E exception) throws E extends java.lang.Throwable- Throws:
E extends java.lang.Throwable
-
expectedException
private boolean expectedException(java.lang.Throwable exception)
-
suspendFor
private void suspendFor(int millis)
-
isFirstExecution
private boolean isFirstExecution()
-
hasNext
public boolean hasNext()
- Specified by:
hasNextin interfacejava.util.Iterator<RetryingTestInvocationContext>
-
next
public RetryingTestInvocationContext next()
- Specified by:
nextin interfacejava.util.Iterator<RetryingTestInvocationContext>
-
-