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:
ResourceLockAware,TestClassAware,Node<JupiterEngineExecutionContext>,TestDescriptor
@API(status=INTERNAL, since="5.13") public class ClassTemplateInvocationTestDescriptor extends JupiterTestDescriptor implements TestClassAware, ResourceLockAware- Since:
- 5.13
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.junit.jupiter.engine.descriptor.JupiterTestDescriptor
JupiterTestDescriptor.ExceptionHandlerInvoker<E extends org.junit.jupiter.api.extension.Extension>
-
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 private intindexprivate org.junit.jupiter.api.extension.ClassTemplateInvocationContextinvocationContextprivate ClassTemplateTestDescriptorparentstatic java.lang.StringSEGMENT_TYPE-
Fields inherited from class org.junit.jupiter.engine.descriptor.JupiterTestDescriptor
configuration
-
Fields inherited from class org.junit.platform.engine.support.descriptor.AbstractTestDescriptor
children
-
-
Constructor Summary
Constructors Constructor Description ClassTemplateInvocationTestDescriptor(UniqueId uniqueId, ClassTemplateTestDescriptor parent, org.junit.jupiter.api.extension.ClassTemplateInvocationContext invocationContext, int index, TestSource source, JupiterConfiguration configuration)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidafter(JupiterEngineExecutionContext context)Execute the after behavior of this node.JupiterEngineExecutionContextbefore(JupiterEngineExecutionContext context)Execute the before behavior of this node.voidcleanUp(JupiterEngineExecutionContext context)Clean up the suppliedcontextafter execution.JupiterEngineExecutionContextexecute(JupiterEngineExecutionContext context, Node.DynamicTestExecutor dynamicTestExecutor)Execute the behavior of this node.java.util.List<java.lang.Class<?>>getEnclosingTestClasses()ExclusiveResourceCollectorgetExclusiveResourceCollector()java.util.Set<ExclusiveResource>getExclusiveResources()Get the set of exclusive resources required to execute this node.intgetIndex()java.lang.StringgetLegacyReportingName()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.java.util.function.Function<org.junit.jupiter.api.parallel.ResourceLocksProvider,java.util.Set<org.junit.jupiter.api.parallel.ResourceLocksProvider.Lock>>getResourceLocksProviderEvaluator()java.lang.Class<?>getTestClass()TestDescriptor.TypegetType()Determine theTestDescriptor.Typeof this descriptor.JupiterEngineExecutionContextprepare(JupiterEngineExecutionContext context)Must be overridden and return a new context with a newExtensionContextso cleanUp() does not accidentally close the parent context.Node.SkipResultshouldBeSkipped(JupiterEngineExecutionContext context)Determine if the execution of the suppliedcontextshould be skipped.protected ClassTemplateInvocationTestDescriptorwithUniqueId(java.util.function.UnaryOperator<UniqueId> uniqueIdTransformer){@return shallow copy (without children) of this descriptor with the supplied unique ID}-
Methods inherited from class org.junit.jupiter.engine.descriptor.JupiterTestDescriptor
copyIncludingDescendants, getDefaultChildExecutionMode, getExecutionMode, getExecutionModeFromAnnotation, getExplicitExecutionMode, getTags, invokeExecutionExceptionHandlers, 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.jupiter.engine.descriptor.ResourceLockAware
determineExclusiveResources, determineOwnExclusiveResources
-
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 Detail
-
SEGMENT_TYPE
public static final java.lang.String SEGMENT_TYPE
- See Also:
- Constant Field Values
-
parent
private final ClassTemplateTestDescriptor parent
-
invocationContext
private org.junit.jupiter.api.extension.ClassTemplateInvocationContext invocationContext
-
index
private final int index
-
-
Constructor Detail
-
ClassTemplateInvocationTestDescriptor
public ClassTemplateInvocationTestDescriptor(UniqueId uniqueId, ClassTemplateTestDescriptor parent, org.junit.jupiter.api.extension.ClassTemplateInvocationContext invocationContext, int index, TestSource source, JupiterConfiguration configuration)
-
-
Method Detail
-
getIndex
public int getIndex()
-
withUniqueId
protected ClassTemplateInvocationTestDescriptor withUniqueId(java.util.function.UnaryOperator<UniqueId> uniqueIdTransformer)
Description copied from class:JupiterTestDescriptor{@return shallow copy (without children) of this descriptor with the supplied unique ID}- Specified by:
withUniqueIdin classJupiterTestDescriptor
-
getType
public TestDescriptor.Type getType()
Description copied from interface:TestDescriptorDetermine theTestDescriptor.Typeof this descriptor.- Specified by:
getTypein interfaceTestDescriptor- Returns:
- the descriptor type; never
null. - See Also:
TestDescriptor.isContainer(),TestDescriptor.isTest()
-
getLegacyReportingName
public java.lang.String 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
public java.lang.Class<?> getTestClass()
- Specified by:
getTestClassin interfaceTestClassAware
-
getEnclosingTestClasses
public java.util.List<java.lang.Class<?>> getEnclosingTestClasses()
- Specified by:
getEnclosingTestClassesin interfaceTestClassAware
-
getExclusiveResourceCollector
public ExclusiveResourceCollector getExclusiveResourceCollector()
- Specified by:
getExclusiveResourceCollectorin interfaceResourceLockAware
-
getResourceLocksProviderEvaluator
public java.util.function.Function<org.junit.jupiter.api.parallel.ResourceLocksProvider,java.util.Set<org.junit.jupiter.api.parallel.ResourceLocksProvider.Lock>> getResourceLocksProviderEvaluator()
- Specified by:
getResourceLocksProviderEvaluatorin interfaceResourceLockAware
-
getExclusiveResources
public java.util.Set<ExclusiveResource> getExclusiveResources()
Description copied from interface:NodeGet the set of exclusive resources required to execute this node.The default implementation returns an empty set.
- Specified by:
getExclusiveResourcesin interfaceNode<JupiterEngineExecutionContext>- Overrides:
getExclusiveResourcesin classJupiterTestDescriptor- Returns:
- the set of exclusive resources required by this node; never
nullbut potentially empty - See Also:
ExclusiveResource
-
prepare
public JupiterEngineExecutionContext prepare(JupiterEngineExecutionContext context)
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:
Node.cleanUp(EngineExecutionContext)
-
shouldBeSkipped
public Node.SkipResult shouldBeSkipped(JupiterEngineExecutionContext context)
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
public JupiterEngineExecutionContext before(JupiterEngineExecutionContext context) throws java.lang.Exception
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:
java.lang.Exception- See Also:
Node.execute(EngineExecutionContext, DynamicTestExecutor),Node.after(EngineExecutionContext)
-
execute
public JupiterEngineExecutionContext execute(JupiterEngineExecutionContext context, Node.DynamicTestExecutor dynamicTestExecutor) throws java.lang.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:
java.lang.Exception- See Also:
Node.before(C),Node.after(C)
-
after
public void after(JupiterEngineExecutionContext context) throws java.lang.Exception
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:
java.lang.Exception- See Also:
Node.before(C),Node.execute(C, org.junit.platform.engine.support.hierarchical.Node.DynamicTestExecutor)
-
cleanUp
public void cleanUp(JupiterEngineExecutionContext context) throws java.lang.Exception
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:
java.lang.Exception- See Also:
Node.prepare(EngineExecutionContext)
-
-