com.vaadin.testbench.

Class 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 and Description
      RetryRule(int maxAttempts)

      Constructs the retry rule with a maximum number of attempts.

    • Constructor Detail

      • 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 Detail

      • 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