com.vaadin.testbench.
Class RetryRule
All Implemented Interfaces:
org.junit.rules.TestRule
A retry rule is used to re-run a test several times in case of a random failure. The test passes as soon as one attempt is executed without any errors, i.e. it is only run as many times as needed. The maximum number of attempts is specified in the constructor.
Since:
5.0
-
Constructor Summary
ConstructorsConstructorDescriptionRetryRule
(int maxAttempts) Constructs the retry rule with a maximum number of attempts.
-
Method Summary
Modifier and TypeMethodDescriptionorg.junit.runners.model.Statement
apply
(org.junit.runners.model.Statement base, org.junit.runner.Description description) int
Gets the maximum number of times to run the test.
-
Constructor Details
-
RetryRule
public RetryRule(int maxAttempts) Constructs the retry rule with a maximum number of attempts. The maximum number of attempts specifies how many times the test will be run in case of a random failure.
Parameters:
maxAttempts
- a maximum number of attempts.
-
-
Method Details
-
getMaxAttempts
public int getMaxAttempts()Gets the maximum number of times to run the test.
Returns:
the maximum number of times to run the test.
-
apply
public org.junit.runners.model.Statement apply(org.junit.runners.model.Statement base, org.junit.runner.Description description) Specified by:
apply
in interfaceorg.junit.rules.TestRule
-