@API(status=INTERNAL,
since="5.0")
public class TestTemplateTestDescriptor
extends MethodBasedTestDescriptor
implements Filterable
TestDescriptor for @TestTemplate
methods.JupiterTestDescriptor.ExceptionHandlerInvoker<E extends Extension>Node.DynamicTestExecutor, Node.ExecutionMode, Node.Invocation<C extends EngineExecutionContext>, Node.SkipResultTestDescriptor.Type, TestDescriptor.Visitor| Modifier and Type | Field and Description |
|---|---|
private DynamicDescendantFilter |
dynamicDescendantFilter |
static java.lang.String |
SEGMENT_TYPE |
configurationchildren| Constructor and Description |
|---|
TestTemplateTestDescriptor(UniqueId uniqueId,
java.lang.Class<?> testClass,
java.lang.reflect.Method templateMethod,
JupiterConfiguration configuration) |
| Modifier and Type | Method and Description |
|---|---|
private java.util.Optional<TestDescriptor> |
createInvocationTestDescriptor(TestTemplateInvocationContext invocationContext,
int index) |
JupiterEngineExecutionContext |
execute(JupiterEngineExecutionContext context,
Node.DynamicTestExecutor dynamicTestExecutor)
Execute the behavior of this node.
|
private void |
execute(Node.DynamicTestExecutor dynamicTestExecutor,
TestDescriptor testDescriptor) |
DynamicDescendantFilter |
getDynamicDescendantFilter() |
TestDescriptor.Type |
getType()
Determine the
TestDescriptor.Type of this descriptor. |
boolean |
mayRegisterTests()
Determine if this descriptor may register dynamic tests during execution.
|
JupiterEngineExecutionContext |
prepare(JupiterEngineExecutionContext context)
Must be overridden and return a new context so cleanUp() does not accidentally close the parent context.
|
private java.util.List<TestTemplateInvocationContextProvider> |
validateProviders(ExtensionContext extensionContext,
ExtensionRegistry extensionRegistry) |
private void |
validateWasAtLeastInvokedOnce(int invocationIndex) |
getExclusiveResources, getExplicitExecutionMode, getLegacyReportingName, getTags, getTestClass, getTestMethodcleanUp, getDefaultChildExecutionMode, getExclusiveResourcesFromAnnotation, getExecutionMode, getExecutionModeFromAnnotation, getTags, invokeExecutionExceptionHandlers, shouldBeSkipped, toExecutionModeaddChild, equals, findByUniqueId, getChildren, getDisplayName, getParent, getSource, getUniqueId, hashCode, removeChild, removeFromHierarchy, setParent, toStringclone, finalize, getClass, notify, notifyAll, wait, wait, waitafter, around, before, nodeFinished, nodeSkippedaccept, containsTests, getDescendants, isContainer, isRoot, isTest, prunepublic static final java.lang.String SEGMENT_TYPE
private final DynamicDescendantFilter dynamicDescendantFilter
public TestTemplateTestDescriptor(UniqueId uniqueId, java.lang.Class<?> testClass, java.lang.reflect.Method templateMethod, JupiterConfiguration configuration)
public DynamicDescendantFilter getDynamicDescendantFilter()
getDynamicDescendantFilter in interface Filterablepublic TestDescriptor.Type getType()
TestDescriptorTestDescriptor.Type of this descriptor.getType in interface TestDescriptornull.TestDescriptor.isContainer(),
TestDescriptor.isTest()public boolean mayRegisterTests()
TestDescriptorThe default implementation assumes tests are usually known during
discovery and thus returns false.
mayRegisterTests in interface TestDescriptorpublic JupiterEngineExecutionContext prepare(JupiterEngineExecutionContext context) throws java.lang.Exception
JupiterTestDescriptorprepare in interface Node<JupiterEngineExecutionContext>prepare in class JupiterTestDescriptorjava.lang.ExceptionNode.cleanUp(EngineExecutionContext)public JupiterEngineExecutionContext execute(JupiterEngineExecutionContext context, Node.DynamicTestExecutor dynamicTestExecutor) throws java.lang.Exception
NodeContainers typically do not implement this method since the
HierarchicalTestEngine handles execution of their children.
The supplied dynamicTestExecutor may be used to submit
additional dynamic tests for immediate execution.
The default implementation returns the supplied context unmodified.
execute in interface Node<JupiterEngineExecutionContext>context - the context to execute indynamicTestExecutor - the executor to submit dynamic tests tojava.lang.ExceptionNode.before(C),
Node.after(C)private java.util.List<TestTemplateInvocationContextProvider> validateProviders(ExtensionContext extensionContext, ExtensionRegistry extensionRegistry)
private java.util.Optional<TestDescriptor> createInvocationTestDescriptor(TestTemplateInvocationContext invocationContext, int index)
private void execute(Node.DynamicTestExecutor dynamicTestExecutor, TestDescriptor testDescriptor)
private void validateWasAtLeastInvokedOnce(int invocationIndex)