Class RepeatedTestExtension
- java.lang.Object
-
- org.junit.jupiter.engine.extension.RepeatedTestExtension
-
- All Implemented Interfaces:
Extension
,TestTemplateInvocationContextProvider
class RepeatedTestExtension extends java.lang.Object implements TestTemplateInvocationContextProvider
TestTemplateInvocationContextProvider
that supports the@RepeatedTest
annotation.- Since:
- 5.0
-
-
Constructor Summary
Constructors Constructor Description RepeatedTestExtension()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private RepeatedTestDisplayNameFormatter
displayNameFormatter(RepeatedTest repeatedTest, java.lang.reflect.Method method, java.lang.String displayName)
java.util.stream.Stream<TestTemplateInvocationContext>
provideTestTemplateInvocationContexts(ExtensionContext context)
Provide invocation contexts for the test template method represented by the suppliedcontext
.boolean
supportsTestTemplate(ExtensionContext context)
Determine if this provider supports providing invocation contexts for the test template method represented by the suppliedcontext
.private int
totalRepetitions(RepeatedTest repeatedTest, java.lang.reflect.Method method)
-
-
-
Method Detail
-
supportsTestTemplate
public boolean supportsTestTemplate(ExtensionContext context)
Description copied from interface:TestTemplateInvocationContextProvider
Determine if this provider supports providing invocation contexts for the test template method represented by the suppliedcontext
.- Specified by:
supportsTestTemplate
in interfaceTestTemplateInvocationContextProvider
- Parameters:
context
- the extension context for the test template method about to be invoked; nevernull
- Returns:
true
if this provider can provide invocation contexts- See Also:
TestTemplateInvocationContextProvider.provideTestTemplateInvocationContexts(org.junit.jupiter.api.extension.ExtensionContext)
,ExtensionContext
-
provideTestTemplateInvocationContexts
public java.util.stream.Stream<TestTemplateInvocationContext> provideTestTemplateInvocationContexts(ExtensionContext context)
Description copied from interface:TestTemplateInvocationContextProvider
Provide invocation contexts for the test template method represented by the suppliedcontext
.This method is only called by the framework if
TestTemplateInvocationContextProvider.supportsTestTemplate(org.junit.jupiter.api.extension.ExtensionContext)
previously returnedtrue
for the sameExtensionContext
; this method is allowed to return an emptyStream
but notnull
.The returned
Stream
will be properly closed by callingBaseStream.close()
, making it safe to use a resource such asFiles.lines()
.- Specified by:
provideTestTemplateInvocationContexts
in interfaceTestTemplateInvocationContextProvider
- Parameters:
context
- the extension context for the test template method about to be invoked; nevernull
- Returns:
- a
Stream
ofTestTemplateInvocationContext
instances for the invocation of the test template method; nevernull
- See Also:
TestTemplateInvocationContextProvider.supportsTestTemplate(org.junit.jupiter.api.extension.ExtensionContext)
,ExtensionContext
-
totalRepetitions
private int totalRepetitions(RepeatedTest repeatedTest, java.lang.reflect.Method method)
-
displayNameFormatter
private RepeatedTestDisplayNameFormatter displayNameFormatter(RepeatedTest repeatedTest, java.lang.reflect.Method method, java.lang.String displayName)
-
-