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.SkipResultNested 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, @Nullable TestSource source, JupiterConfiguration configuration) -
Method Summary
Modifier and TypeMethodDescriptionvoidafter(JupiterEngineExecutionContext context) Execute the after behavior of this node.before(JupiterEngineExecutionContext context) Execute the before behavior of this node.voidcleanUp(JupiterEngineExecutionContext context) Clean up the suppliedcontextafter 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.ExclusiveResourceCollectorintgetIndex()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.Typeof this descriptor.prepare(JupiterEngineExecutionContext context) Must be overridden and return a new context with a newExtensionContextso cleanUp() does not accidentally close the parent context.Determine if the execution of the suppliedcontextshould be skipped.protected ClassTemplateInvocationTestDescriptorwithUniqueId(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, toExecutionModeMethods inherited from class org.junit.platform.engine.support.descriptor.AbstractTestDescriptor
addChild, equals, findByUniqueId, getChildren, getDisplayName, getParent, getSource, getTags, getUniqueId, hashCode, orderChildren, removeChild, removeFromHierarchy, setParent, toStringMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.junit.platform.engine.support.hierarchical.Node
around, nodeFinished, nodeSkippedMethods 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, @Nullable TestSource source, JupiterConfiguration configuration)
-
-
Method Details
-
getIndex
public int getIndex() -
withUniqueId
protected ClassTemplateInvocationTestDescriptor withUniqueId(UnaryOperator<UniqueId> uniqueIdTransformer) Description copied from class:JupiterTestDescriptorReturns shallow copy (without children) of this descriptor with the supplied unique ID.- Specified by:
withUniqueIdin classJupiterTestDescriptor- Returns:
- shallow copy (without children) of this descriptor with the supplied unique ID
-
getType
Description copied from interface:TestDescriptorDetermine theTestDescriptor.Typeof this descriptor.- Specified by:
getTypein interfaceTestDescriptor- Returns:
- the descriptor type; never
null. - See Also:
-
getLegacyReportingName
Description copied from interface:TestDescriptorGet 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:
getLegacyReportingNamein interfaceTestDescriptor- Returns:
- the legacy reporting name; never
nullor blank
-
getTestClass
- Specified by:
getTestClassin interfaceTestClassAware
-
getEnclosingTestClasses
- Specified by:
getEnclosingTestClassesin interfaceTestClassAware
-
getExclusiveResourceCollector
public org.junit.jupiter.engine.descriptor.ExclusiveResourceCollector getExclusiveResourceCollector() -
getResourceLocksProviderEvaluator
public Function<ResourceLocksProvider, Set<ResourceLocksProvider.Lock>> getResourceLocksProviderEvaluator() -
prepare
Description copied from class:JupiterTestDescriptorMust be overridden and return a new context with a newExtensionContextso cleanUp() does not accidentally close the parent context.- Specified by:
preparein interfaceNode<JupiterEngineExecutionContext>- Specified by:
preparein classJupiterTestDescriptor- See Also:
-
shouldBeSkipped
Description copied from interface:NodeDetermine if the execution of the suppliedcontextshould be skipped.The default implementation returns
Node.SkipResult.doNotSkip().- Specified by:
shouldBeSkippedin interfaceNode<JupiterEngineExecutionContext>- Overrides:
shouldBeSkippedin classJupiterTestDescriptor
-
before
Description copied from interface:NodeExecute the before behavior of this node.This method will be called once before execution of this node.
The default implementation returns the supplied
contextunmodified.- Specified by:
beforein 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:NodeExecute the behavior of this node.Containers typically do not implement this method since the
HierarchicalTestEnginehandles execution of their children.The supplied
dynamicTestExecutormay be used to submit additional dynamic tests for immediate execution.The default implementation returns the supplied
contextunmodified.- Specified by:
executein 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:NodeExecute the after behavior of this node.This method will be called once after execution of this node.
The default implementation does nothing.
- Specified by:
afterin interfaceNode<JupiterEngineExecutionContext>- Parameters:
context- the context to execute in- Throws:
Exception- See Also:
-
cleanUp
Description copied from interface:NodeClean up the suppliedcontextafter execution.The default implementation does nothing.
- Specified by:
cleanUpin interfaceNode<JupiterEngineExecutionContext>- Overrides:
cleanUpin classJupiterTestDescriptor- Parameters:
context- the context to execute in- Throws:
Exception- See Also:
-
determineExclusiveResources
-
determineOwnExclusiveResources
default Stream<ExclusiveResource> determineOwnExclusiveResources(Function<ResourceLocksProvider, Set<ResourceLocksProvider.Lock>> providerToLocks)
-