Package io.github.artsok.extension
Class RepeatIfExceptionsExtension
- java.lang.Object
-
- io.github.artsok.extension.RepeatIfExceptionsExtension
-
- All Implemented Interfaces:
org.junit.jupiter.api.extension.AfterTestExecutionCallback,org.junit.jupiter.api.extension.BeforeTestExecutionCallback,org.junit.jupiter.api.extension.Extension,org.junit.jupiter.api.extension.TestExecutionExceptionHandler,org.junit.jupiter.api.extension.TestTemplateInvocationContextProvider
public class RepeatIfExceptionsExtension extends Object implements org.junit.jupiter.api.extension.TestTemplateInvocationContextProvider, org.junit.jupiter.api.extension.BeforeTestExecutionCallback, org.junit.jupiter.api.extension.AfterTestExecutionCallback, org.junit.jupiter.api.extension.TestExecutionExceptionHandler
Main condition for extension point @RepeatedIfExceptions All logic in this class. See TestTemplateIterator where handler logic of repeat tests- Author:
- Artem Sokovets
-
-
Constructor Summary
Constructors Constructor Description RepeatIfExceptionsExtension()
-
Method Summary
Modifier and Type Method Description voidafterTestExecution(org.junit.jupiter.api.extension.ExtensionContext extensionContext)Check if exceptions that will appear in test same as we waitvoidbeforeTestExecution(org.junit.jupiter.api.extension.ExtensionContext context)voidhandleTestExecutionException(org.junit.jupiter.api.extension.ExtensionContext context, Throwable throwable)Stream<org.junit.jupiter.api.extension.TestTemplateInvocationContext>provideTestTemplateInvocationContexts(org.junit.jupiter.api.extension.ExtensionContext extensionContext)Context call TestTemplateInvocationContextbooleansupportsTestTemplate(org.junit.jupiter.api.extension.ExtensionContext extensionContext)Check that test method containRepeatedIfExceptionsTestannotation
-
-
-
Method Detail
-
supportsTestTemplate
public boolean supportsTestTemplate(org.junit.jupiter.api.extension.ExtensionContext extensionContext)
Check that test method containRepeatedIfExceptionsTestannotation- Specified by:
supportsTestTemplatein interfaceorg.junit.jupiter.api.extension.TestTemplateInvocationContextProvider- Parameters:
extensionContext- - encapsulates the context in which the current test or container is being executed- Returns:
- true/false
-
provideTestTemplateInvocationContexts
public Stream<org.junit.jupiter.api.extension.TestTemplateInvocationContext> provideTestTemplateInvocationContexts(org.junit.jupiter.api.extension.ExtensionContext extensionContext)
Context call TestTemplateInvocationContext- Specified by:
provideTestTemplateInvocationContextsin interfaceorg.junit.jupiter.api.extension.TestTemplateInvocationContextProvider- Parameters:
extensionContext- - Test Class Context- Returns:
- Stream of TestTemplateInvocationContext
-
beforeTestExecution
public void beforeTestExecution(org.junit.jupiter.api.extension.ExtensionContext context)
- Specified by:
beforeTestExecutionin interfaceorg.junit.jupiter.api.extension.BeforeTestExecutionCallback
-
afterTestExecution
public void afterTestExecution(org.junit.jupiter.api.extension.ExtensionContext extensionContext)
Check if exceptions that will appear in test same as we wait- Specified by:
afterTestExecutionin interfaceorg.junit.jupiter.api.extension.AfterTestExecutionCallback- Parameters:
extensionContext- - Test Class Context
-
handleTestExecutionException
public void handleTestExecutionException(org.junit.jupiter.api.extension.ExtensionContext context, Throwable throwable) throws Throwable- Specified by:
handleTestExecutionExceptionin interfaceorg.junit.jupiter.api.extension.TestExecutionExceptionHandler- Throws:
Throwable
-
-