Class ClassBasedTestDescriptor
java.lang.Object
org.junit.platform.engine.support.descriptor.AbstractTestDescriptor
org.junit.jupiter.engine.descriptor.JupiterTestDescriptor
org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor
- All Implemented Interfaces:
TestClassAware,Validatable,Node<JupiterEngineExecutionContext>,TestDescriptor
- Direct Known Subclasses:
ClassTemplateTestDescriptor,ClassTestDescriptor,NestedClassTestDescriptor
@API(status=INTERNAL,
since="5.5")
public abstract class ClassBasedTestDescriptor
extends JupiterTestDescriptor
implements TestClassAware, Validatable
TestDescriptor for tests based on Java classes.- Since:
- 5.5
-
Nested Class Summary
Nested ClassesNested 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 -
Method Summary
Modifier and TypeMethodDescriptionfinal voidafter(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) protected final Optional<Node.ExecutionMode> final org.junit.jupiter.engine.descriptor.ExclusiveResourceCollectorprotected final Optional<Node.ExecutionMode> final StringGet 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.final Class<?> final TestDescriptor.TypegetType()Determine theTestDescriptor.Typeof this descriptor.protected final TestInstancesinstantiateTestClass(Optional<TestInstances> outerInstances, ExtensionRegistry registry, ExtensionContextSupplier extensionContext) protected abstract TestInstancesinstantiateTestClass(JupiterEngineExecutionContext parentExecutionContext, ExtensionContextSupplier extensionContext, ExtensionRegistry registry, JupiterEngineExecutionContext context) prepare(JupiterEngineExecutionContext context) Must be overridden and return a new context with a newExtensionContextso cleanUp() does not accidentally close the parent context.final voidsetDefaultChildExecutionMode(Node.ExecutionMode defaultChildExecutionMode) final voidvalidate(DiscoveryIssueReporter reporter) Validate the state of this descriptor and report any issues found to the suppliedDiscoveryIssueReporter.protected voidprotected voidMethods inherited from class org.junit.jupiter.engine.descriptor.JupiterTestDescriptor
copyIncludingDescendants, getExclusiveResources, getExecutionMode, shouldBeSkipped, toExecutionMode, withUniqueIdMethods 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, execute, nodeFinished, nodeSkippedMethods inherited from interface org.junit.jupiter.engine.descriptor.TestClassAware
getEnclosingTestClassesMethods 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
-
classInfo
-
-
Method Details
-
getTestClass
- Specified by:
getTestClassin interfaceTestClassAware
-
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
-
validate
Description copied from interface:ValidatableValidate the state of this descriptor and report any issues found to the suppliedDiscoveryIssueReporter.- Specified by:
validatein interfaceValidatable
-
validateCoreLifecycleMethods
-
validateClassTemplateInvocationLifecycleMethods
-
getExplicitExecutionMode
-
getDefaultChildExecutionMode
-
setDefaultChildExecutionMode
-
getExclusiveResourceCollector
public final org.junit.jupiter.engine.descriptor.ExclusiveResourceCollector getExclusiveResourceCollector() -
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:
-
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 - 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- 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:
-
instantiateTestClass
protected abstract TestInstances instantiateTestClass(JupiterEngineExecutionContext parentExecutionContext, ExtensionContextSupplier extensionContext, ExtensionRegistry registry, JupiterEngineExecutionContext context) -
instantiateTestClass
protected final TestInstances instantiateTestClass(Optional<TestInstances> outerInstances, ExtensionRegistry registry, ExtensionContextSupplier extensionContext) -
determineExclusiveResources
-
determineOwnExclusiveResources
default Stream<ExclusiveResource> determineOwnExclusiveResources(Function<ResourceLocksProvider, Set<ResourceLocksProvider.Lock>> providerToLocks) -
getResourceLocksProviderEvaluator
Function<ResourceLocksProvider, Set<ResourceLocksProvider.Lock>> getResourceLocksProviderEvaluator()
-