Package org.testng.util
Class RetryAnalyzerCount
java.lang.Object
org.testng.util.RetryAnalyzerCount
- All Implemented Interfaces:
IRetryAnalyzer
An implementation of IRetryAnalyzer that allows you to specify the maximum number of times you
want your test to be retried.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected int
getCount()
boolean
retry
(ITestResult result) Retries the test if count is not 0.abstract boolean
retryMethod
(ITestResult result) The method implemented by the class that test if the test must be retried or not.protected void
setCount
(int count)
-
Field Details
-
count
AtomicInteger count
-
-
Constructor Details
-
RetryAnalyzerCount
public RetryAnalyzerCount()
-
-
Method Details
-
setCount
protected void setCount(int count) - Parameters:
count
- the max number of time the method needs to be retried.
-
getCount
protected int getCount()- Returns:
- the current counter value
-
retry
Retries the test if count is not 0.- Specified by:
retry
in interfaceIRetryAnalyzer
- Parameters:
result
- The result of the test.- Returns:
- true if the test method has to be retried, false otherwise.
-
retryMethod
The method implemented by the class that test if the test must be retried or not.- Parameters:
result
- The result of the test.- Returns:
- true if the test must be retried, false otherwise.
-