Class RetryRule

java.lang.Object
com.vaadin.testbench.RetryRule
All Implemented Interfaces:
org.junit.rules.TestRule

public class RetryRule extends Object implements 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

    Constructors
    Constructor
    Description
    RetryRule(int maxAttempts)
    Constructs the retry rule with a maximum number of attempts.
  • Method Summary

    Modifier and Type
    Method
    Description
    org.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.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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 interface org.junit.rules.TestRule