Package org.apache.pulsar.tests
Class TestRetrySupport
- java.lang.Object
-
- org.apache.pulsar.tests.TestRetrySupport
-
public abstract class TestRetrySupport extends java.lang.ObjectAdds support for resetting the internal state of the test by calling "cleanup" and "setup" methods before running a test method after a previous test method has failed. This is useful for making test retries to work on classes which use BeforeClass and AfterClass methods to setup a test environment that is shared across all test methods in the test class.
-
-
Constructor Summary
Constructors Constructor Description TestRetrySupport()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract voidcleanup()voidfailureCheck(org.testng.ITestResult testResult, java.lang.reflect.Method method)protected voidincrementSetupNumber()This method should be called in the setup method of the concrete class.protected voidmarkCurrentSetupNumberCleaned()protected abstract voidsetup()voidstateCheck(java.lang.reflect.Method method)
-
-
-
Method Detail
-
stateCheck
@BeforeMethod(alwaysRun=true) public final void stateCheck(java.lang.reflect.Method method) throws java.lang.Exception- Throws:
java.lang.Exception
-
failureCheck
@AfterMethod(alwaysRun=true) public final void failureCheck(org.testng.ITestResult testResult, java.lang.reflect.Method method)
-
incrementSetupNumber
protected final void incrementSetupNumber()
This method should be called in the setup method of the concrete class. This increases an internal counter and resets the failure state which are used to determine whether cleanup is needed before a test method is called.
-
markCurrentSetupNumberCleaned
protected final void markCurrentSetupNumberCleaned()
-
setup
protected abstract void setup() throws java.lang.Exception- Throws:
java.lang.Exception
-
cleanup
protected abstract void cleanup() throws java.lang.Exception- Throws:
java.lang.Exception
-
-