Module org.junit.jupiter.engine
Class ClassTemplateInvocationTestDescriptor
java.lang.Object
org.junit.platform.engine.support.descriptor.AbstractTestDescriptor
org.junit.jupiter.engine.descriptor.JupiterTestDescriptor
org.junit.jupiter.engine.descriptor.ClassTemplateInvocationTestDescriptor
- All Implemented Interfaces:
TestClassAware
,Node<JupiterEngineExecutionContext>
,TestDescriptor
@API(status=INTERNAL,
since="5.13")
public class ClassTemplateInvocationTestDescriptor
extends JupiterTestDescriptor
implements TestClassAware
- Since:
- 5.13
-
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
FieldsFields inherited from class org.junit.platform.engine.support.descriptor.AbstractTestDescriptor
children
-
Constructor Summary
ConstructorsConstructorDescriptionClassTemplateInvocationTestDescriptor
(UniqueId uniqueId, ClassTemplateTestDescriptor parent, ClassTemplateInvocationContext invocationContext, int index, TestSource source, JupiterConfiguration configuration) -
Method Summary
Modifier and TypeMethodDescriptionvoid
after
(JupiterEngineExecutionContext context) Execute the after behavior of this node.before
(JupiterEngineExecutionContext context) Execute the before behavior of this node.void
cleanUp
(JupiterEngineExecutionContext context) Clean up the suppliedcontext
after execution.default Stream
<ExclusiveResource> default Stream
<ExclusiveResource> determineOwnExclusiveResources
(Function<ResourceLocksProvider, Set<ResourceLocksProvider.Lock>> providerToLocks) execute
(JupiterEngineExecutionContext context, Node.DynamicTestExecutor dynamicTestExecutor) Execute the behavior of this node.org.junit.jupiter.engine.descriptor.ExclusiveResourceCollector
int
getIndex()
Get the name of this descriptor in a format that is suitable for legacy reporting infrastructure — for example, for reporting systems built on the Ant-based XML reporting format for JUnit 4.Class
<?> getType()
Determine theTestDescriptor.Type
of this descriptor.prepare
(JupiterEngineExecutionContext context) Must be overridden and return a new context with a newExtensionContext
so cleanUp() does not accidentally close the parent context.Determine if the execution of the suppliedcontext
should be skipped.protected ClassTemplateInvocationTestDescriptor
withUniqueId
(UnaryOperator<UniqueId> uniqueIdTransformer) Returns shallow copy (without children) of this descriptor with the supplied unique ID.Methods inherited from class org.junit.jupiter.engine.descriptor.JupiterTestDescriptor
copyIncludingDescendants, getExclusiveResources, getExecutionMode, toExecutionMode
Methods inherited from class org.junit.platform.engine.support.descriptor.AbstractTestDescriptor
addChild, equals, findByUniqueId, getChildren, getDisplayName, getParent, getSource, getTags, getUniqueId, hashCode, orderChildren, 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
around, nodeFinished, nodeSkipped
Methods inherited from interface org.junit.platform.engine.TestDescriptor
accept, addChild, findByUniqueId, getAncestors, getChildren, getDescendants, getDisplayName, getParent, getSource, getTags, getUniqueId, isContainer, isRoot, isTest, mayRegisterTests, orderChildren, prune, removeChild, removeFromHierarchy, setParent
-
Field Details
-
SEGMENT_TYPE
- See Also:
-
-
Constructor Details
-
ClassTemplateInvocationTestDescriptor
public ClassTemplateInvocationTestDescriptor(UniqueId uniqueId, ClassTemplateTestDescriptor parent, ClassTemplateInvocationContext invocationContext, int index, TestSource source, JupiterConfiguration configuration)
-
-
Method Details
-
getIndex
public int getIndex() -
withUniqueId
protected ClassTemplateInvocationTestDescriptor withUniqueId(UnaryOperator<UniqueId> uniqueIdTransformer) Description copied from class:JupiterTestDescriptor
Returns shallow copy (without children) of this descriptor with the supplied unique ID.- Specified by:
withUniqueId
in classJupiterTestDescriptor
- Returns:
- shallow copy (without children) of this descriptor with the supplied unique ID
-
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:
-
getLegacyReportingName
Description copied from interface:TestDescriptor
Get the name of this descriptor in a format that is suitable for legacy reporting infrastructure — for example, for reporting systems built on the Ant-based XML reporting format for JUnit 4.The default implementation delegates to
TestDescriptor.getDisplayName()
.- Specified by:
getLegacyReportingName
in interfaceTestDescriptor
- Returns:
- the legacy reporting name; never
null
or blank
-
getTestClass
- Specified by:
getTestClass
in interfaceTestClassAware
-
getEnclosingTestClasses
- Specified by:
getEnclosingTestClasses
in interfaceTestClassAware
-
getExclusiveResourceCollector
public org.junit.jupiter.engine.descriptor.ExclusiveResourceCollector getExclusiveResourceCollector() -
getResourceLocksProviderEvaluator
public Function<ResourceLocksProvider,Set<ResourceLocksProvider.Lock>> getResourceLocksProviderEvaluator() -
prepare
Description copied from class:JupiterTestDescriptor
Must be overridden and return a new context with a newExtensionContext
so cleanUp() does not accidentally close the parent context.- Specified by:
prepare
in interfaceNode<JupiterEngineExecutionContext>
- Specified by:
prepare
in classJupiterTestDescriptor
- See Also:
-
shouldBeSkipped
Description copied from interface:Node
Determine if the execution of the suppliedcontext
should be skipped.The default implementation returns
Node.SkipResult.doNotSkip()
.- Specified by:
shouldBeSkipped
in interfaceNode<JupiterEngineExecutionContext>
- Overrides:
shouldBeSkipped
in classJupiterTestDescriptor
-
before
Description copied from interface:Node
Execute the before behavior of this node.This method will be called once before execution of this node.
The default implementation returns the supplied
context
unmodified.- Specified by:
before
in interfaceNode<JupiterEngineExecutionContext>
- Parameters:
context
- the context to execute in- Returns:
- the new context to be used for children of this node; never
null
- Throws:
Exception
- See Also:
-
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:
-
after
Description copied from interface:Node
Execute the after behavior of this node.This method will be called once after execution of this node.
The default implementation does nothing.
- Specified by:
after
in interfaceNode<JupiterEngineExecutionContext>
- Parameters:
context
- the context to execute in- Throws:
Exception
- See Also:
-
cleanUp
Description copied from interface:Node
Clean up the suppliedcontext
after execution.The default implementation does nothing.
- Specified by:
cleanUp
in interfaceNode<JupiterEngineExecutionContext>
- Overrides:
cleanUp
in classJupiterTestDescriptor
- Parameters:
context
- the context to execute in- Throws:
Exception
- See Also:
-
determineExclusiveResources
-
determineOwnExclusiveResources
default Stream<ExclusiveResource> determineOwnExclusiveResources(Function<ResourceLocksProvider, Set<ResourceLocksProvider.Lock>> providerToLocks)
-