Class RetryRule

java.lang.Object
org.elasticsearch.test.RetryRule
All Implemented Interfaces:
org.junit.rules.TestRule

public class RetryRule extends Object implements org.junit.rules.TestRule
Provides a way to retry a failed test. To use this functionality add something like the following to your test class:
@Rule
public RetryRule retry = new RetryRule(3, TimeValue.timeValueSeconds(1));
  • Constructor Summary

    Constructors
    Constructor
    Description
    RetryRule(int maxAttempts, org.elasticsearch.core.TimeValue retryDelay)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    org.junit.runners.model.Statement
    apply(org.junit.runners.model.Statement statement, org.junit.runner.Description description)
     

    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, org.elasticsearch.core.TimeValue retryDelay)
  • Method Details

    • apply

      public org.junit.runners.model.Statement apply(org.junit.runners.model.Statement statement, org.junit.runner.Description description)
      Specified by:
      apply in interface org.junit.rules.TestRule