Class RetryTestExecutionExtension

  • All Implemented Interfaces:
    org.junit.jupiter.api.extension.AfterEachCallback, org.junit.jupiter.api.extension.ExecutionCondition, org.junit.jupiter.api.extension.Extension, org.junit.jupiter.api.extension.TestExecutionExceptionHandler

    public class RetryTestExecutionExtension
    extends Object
    implements org.junit.jupiter.api.extension.ExecutionCondition, org.junit.jupiter.api.extension.TestExecutionExceptionHandler, org.junit.jupiter.api.extension.AfterEachCallback
    Extension to decide whether a retry test should run.
    • Constructor Detail

      • RetryTestExecutionExtension

        public RetryTestExecutionExtension​(int retryIndex,
                                           int totalTimes)
    • Method Detail

      • evaluateExecutionCondition

        public org.junit.jupiter.api.extension.ConditionEvaluationResult evaluateExecutionCondition​(org.junit.jupiter.api.extension.ExtensionContext context)
        Specified by:
        evaluateExecutionCondition in interface org.junit.jupiter.api.extension.ExecutionCondition
      • handleTestExecutionException

        public void handleTestExecutionException​(org.junit.jupiter.api.extension.ExtensionContext context,
                                                 Throwable throwable)
                                          throws Throwable
        Specified by:
        handleTestExecutionException in interface org.junit.jupiter.api.extension.TestExecutionExceptionHandler
        Throws:
        Throwable
      • afterEach

        public void afterEach​(org.junit.jupiter.api.extension.ExtensionContext context)
                       throws Exception
        Specified by:
        afterEach in interface org.junit.jupiter.api.extension.AfterEachCallback
        Throws:
        Exception