Class RetryExtension

java.lang.Object
rife.bld.testing.RetryExtension
All Implemented Interfaces:
Extension, InvocationInterceptor, TestInstantiationAwareExtension, TestTemplateInvocationContextProvider

public class RetryExtension extends Object implements TestTemplateInvocationContextProvider, InvocationInterceptor
JUnit extension that retries a failing RetryTest method.

Implements TestTemplateInvocationContextProvider and InvocationInterceptor to integrate with @TestTemplate. The test is retried up to RetryTest.value() times with an optional RetryTest.delay() in seconds.

If RetryTest.withExceptions() is specified, only matching exception types (including causes in the cause chain) will trigger a retry.

If a retry succeeds, the test passes. If all retries fail, the last exception is thrown.

Since:
1.0
Author:
Erik C. Thauvin, Guillaume Laforge
See Also: