Class ClassTemplateTestDescriptor
java.lang.Object
org.junit.platform.engine.support.descriptor.AbstractTestDescriptor
org.junit.jupiter.engine.descriptor.JupiterTestDescriptor
org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor
org.junit.jupiter.engine.descriptor.ClassTemplateTestDescriptor
- All Implemented Interfaces:
Filterable,TestClassAware,Validatable,Node<JupiterEngineExecutionContext>,TestDescriptor
@API(status=INTERNAL,
since="5.13")
public class ClassTemplateTestDescriptor
extends ClassBasedTestDescriptor
implements Filterable
- Since:
- 5.13
-
Nested Class Summary
Nested classes/interfaces inherited from class org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor
ClassBasedTestDescriptor.ClassInfoNested 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.jupiter.engine.descriptor.ClassBasedTestDescriptor
classInfoFields inherited from class org.junit.platform.engine.support.descriptor.AbstractTestDescriptor
children -
Constructor Summary
ConstructorsConstructorDescriptionClassTemplateTestDescriptor(UniqueId uniqueId, ClassBasedTestDescriptor delegate) -
Method Summary
Modifier and TypeMethodDescriptionvoidcleanUp(JupiterEngineExecutionContext context) Clean up the suppliedcontextafter execution.protected JupiterTestDescriptorcopyIncludingDescendants(UnaryOperator<UniqueId> uniqueIdTransformer) Returns a deep copy (with copies of children) of this descriptor with the supplied unique ID.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.Get the set of exclusive resources required to execute this node.getTags()Get the set of tags associated with this descriptor.instantiateTestClass(JupiterEngineExecutionContext parentExecutionContext, ExtensionContextSupplier extensionContext, ExtensionRegistry registry, JupiterEngineExecutionContext context) booleanDetermine if this descriptor may register dynamic tests during execution.voidprune()Remove this descriptor from the hierarchy unless it is a root or contains tests.protected voidprotected voidprotected ClassTemplateTestDescriptorwithUniqueId(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.ClassBasedTestDescriptor
after, before, getDefaultChildExecutionMode, getExclusiveResourceCollector, getExplicitExecutionMode, getLegacyReportingName, getTestClass, getType, instantiateTestClass, prepare, setDefaultChildExecutionMode, validateMethods inherited from class org.junit.jupiter.engine.descriptor.JupiterTestDescriptor
getExecutionMode, shouldBeSkipped, toExecutionModeMethods inherited from class org.junit.platform.engine.support.descriptor.AbstractTestDescriptor
addChild, equals, findByUniqueId, getChildren, getDisplayName, getParent, getSource, 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, getUniqueId, isContainer, isRoot, isTest, orderChildren, removeChild, removeFromHierarchy, setParent
-
Field Details
-
STANDALONE_CLASS_SEGMENT_TYPE
- See Also:
-
NESTED_CLASS_SEGMENT_TYPE
- See Also:
-
-
Constructor Details
-
ClassTemplateTestDescriptor
-
-
Method Details
-
getTags
Description copied from interface:TestDescriptorGet the set of tags associated with this descriptor.- Specified by:
getTagsin interfaceTestDescriptor- Overrides:
getTagsin classAbstractTestDescriptor- Returns:
- the set of tags associated with this descriptor; never
nullbut potentially empty - See Also:
-
validateCoreLifecycleMethods
- Overrides:
validateCoreLifecycleMethodsin classClassBasedTestDescriptor
-
validateClassTemplateInvocationLifecycleMethods
- Overrides:
validateClassTemplateInvocationLifecycleMethodsin classClassBasedTestDescriptor
-
getDynamicDescendantFilter
- Specified by:
getDynamicDescendantFilterin interfaceFilterable
-
copyIncludingDescendants
protected JupiterTestDescriptor copyIncludingDescendants(UnaryOperator<UniqueId> uniqueIdTransformer) Description copied from class:JupiterTestDescriptorReturns a deep copy (with copies of children) of this descriptor with the supplied unique ID.- Overrides:
copyIncludingDescendantsin classJupiterTestDescriptor- Returns:
- a deep copy (with copies of children) of this descriptor with the supplied unique ID
-
withUniqueId
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
-
prune
public void prune()Description copied from interface:TestDescriptorRemove this descriptor from the hierarchy unless it is a root or contains tests.A concrete
TestEnginemay override this method in order to implement a different algorithm or to skip pruning altogether.- Specified by:
prunein interfaceTestDescriptor- See Also:
-
mayRegisterTests
public boolean mayRegisterTests()Description copied from interface:TestDescriptorDetermine 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:
mayRegisterTestsin interfaceTestDescriptor
-
getEnclosingTestClasses
- Specified by:
getEnclosingTestClassesin interfaceTestClassAware
-
instantiateTestClass
public TestInstances instantiateTestClass(JupiterEngineExecutionContext parentExecutionContext, ExtensionContextSupplier extensionContext, ExtensionRegistry registry, JupiterEngineExecutionContext context) - Specified by:
instantiateTestClassin classClassBasedTestDescriptor
-
getResourceLocksProviderEvaluator
public Function<ResourceLocksProvider, Set<ResourceLocksProvider.Lock>> getResourceLocksProviderEvaluator() -
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:
-
cleanUp
Description copied from interface:NodeClean up the suppliedcontextafter execution.The default implementation does nothing.
- Specified by:
cleanUpin interfaceNode<JupiterEngineExecutionContext>- Overrides:
cleanUpin classClassBasedTestDescriptor- Parameters:
context- the context to execute in- 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:
-
determineExclusiveResources
-
determineOwnExclusiveResources
default Stream<ExclusiveResource> determineOwnExclusiveResources(Function<ResourceLocksProvider, Set<ResourceLocksProvider.Lock>> providerToLocks)
-