Annotation Type RetryOnFailure


  • @Retention(RUNTIME)
    @Target({METHOD,TYPE})
    @Inherited
    public @interface RetryOnFailure
    Annotation to use with RetryRule.

    Add the RetryRule to your test class and annotate the class and/or tests with RetryOnFailure.

     @RetryOnFailure(times=1)
     public class YourTest {
    
         @Rule
         public RetryRule retryRule = new RetryRule();
    
         @Test
         public void yourTest() {
             // This will be retried 1 time (total runs 2) before failing the test.
             throw new Exception("Failing test");
         }
    
         @Test
         @RetryOnFailure(times=2)
         public void yourTest() {
             // This will be retried 2 time (total runs 3) before failing the test.
             throw new Exception("Failing test");
         }
     }
     
    • Required Element Summary

      Required Elements 
      Modifier and Type Required Element Description
      int times  
    • Element Detail

      • times

        int times