Module org.junit.jupiter.engine
Class TestTemplateTestDescriptor
- java.lang.Object
-
- org.junit.platform.engine.support.descriptor.AbstractTestDescriptor
-
- org.junit.jupiter.engine.descriptor.JupiterTestDescriptor
-
- org.junit.jupiter.engine.descriptor.MethodBasedTestDescriptor
-
- org.junit.jupiter.engine.descriptor.TestTemplateTestDescriptor
-
- All Implemented Interfaces:
Filterable
,Node<JupiterEngineExecutionContext>
,TestDescriptor
@API(status=INTERNAL, since="5.0") public class TestTemplateTestDescriptor extends MethodBasedTestDescriptor implements Filterable
TestDescriptor
for@TestTemplate
methods.- Since:
- 5.0
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.junit.platform.engine.support.hierarchical.Node
Node.DynamicTestExecutor, Node.ExecutionMode, Node.Invocation<C extends EngineExecutionContext>, Node.SkipResult
-
Nested classes/interfaces inherited from interface org.junit.platform.engine.TestDescriptor
TestDescriptor.Type, TestDescriptor.Visitor
-
-
Field Summary
Fields Modifier and Type Field Description static String
SEGMENT_TYPE
-
Fields inherited from class org.junit.platform.engine.support.descriptor.AbstractTestDescriptor
children
-
-
Constructor Summary
Constructors Constructor Description TestTemplateTestDescriptor(UniqueId uniqueId, Class<?> testClass, Method templateMethod, JupiterConfiguration configuration)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description JupiterEngineExecutionContext
execute(JupiterEngineExecutionContext context, Node.DynamicTestExecutor dynamicTestExecutor)
Execute the behavior of this node.DynamicDescendantFilter
getDynamicDescendantFilter()
TestDescriptor.Type
getType()
Determine theTestDescriptor.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.-
Methods inherited from class org.junit.jupiter.engine.descriptor.MethodBasedTestDescriptor
getExclusiveResources, getExplicitExecutionMode, getLegacyReportingName, getTags, getTestClass, getTestMethod, invokeTestWatchers, nodeSkipped
-
Methods inherited from class org.junit.jupiter.engine.descriptor.JupiterTestDescriptor
cleanUp, getExecutionMode, shouldBeSkipped, toExecutionMode
-
Methods inherited from class org.junit.platform.engine.support.descriptor.AbstractTestDescriptor
addChild, equals, findByUniqueId, getChildren, getDisplayName, getParent, getSource, getUniqueId, hashCode, removeChild, removeFromHierarchy, setParent, toString
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.junit.platform.engine.support.hierarchical.Node
after, around, before, nodeFinished
-
Methods inherited from interface org.junit.platform.engine.TestDescriptor
accept, getDescendants, isContainer, isRoot, isTest, prune
-
-
-
-
Field Detail
-
SEGMENT_TYPE
public static final String SEGMENT_TYPE
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
TestTemplateTestDescriptor
public TestTemplateTestDescriptor(UniqueId uniqueId, Class<?> testClass, Method templateMethod, JupiterConfiguration configuration)
-
-
Method Detail
-
getDynamicDescendantFilter
public DynamicDescendantFilter getDynamicDescendantFilter()
- Specified by:
getDynamicDescendantFilter
in interfaceFilterable
-
getType
public TestDescriptor.Type getType()
Description copied from interface:TestDescriptor
Determine theTestDescriptor.Type
of this descriptor.- Specified by:
getType
in interfaceTestDescriptor
- Returns:
- the descriptor type; never
null
. - See Also:
TestDescriptor.isContainer()
,TestDescriptor.isTest()
-
mayRegisterTests
public boolean mayRegisterTests()
Description copied from interface:TestDescriptor
Determine if this descriptor may register dynamic tests during execution.The default implementation assumes tests are usually known during discovery and thus returns
false
.- Specified by:
mayRegisterTests
in interfaceTestDescriptor
-
prepare
public JupiterEngineExecutionContext prepare(JupiterEngineExecutionContext context) throws Exception
Description copied from class:JupiterTestDescriptor
Must be overridden and return a new context so cleanUp() does not accidentally close the parent context.- Specified by:
prepare
in interfaceNode<JupiterEngineExecutionContext>
- Specified by:
prepare
in classJupiterTestDescriptor
- Throws:
Exception
- See Also:
Node.cleanUp(EngineExecutionContext)
-
execute
public JupiterEngineExecutionContext execute(JupiterEngineExecutionContext context, Node.DynamicTestExecutor dynamicTestExecutor) throws Exception
Description copied from interface:Node
Execute the behavior of this node.Containers 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.- Specified by:
execute
in interfaceNode<JupiterEngineExecutionContext>
- Parameters:
context
- the context to execute indynamicTestExecutor
- the executor to submit dynamic tests to- Returns:
- the new context to be used for children of this node and for the after behavior of the parent of this node, if any
- Throws:
Exception
- See Also:
Node.before(C)
,Node.after(C)
-
-