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,org.junit.platform.engine.support.hierarchical.Node<JupiterEngineExecutionContext>,org.junit.platform.engine.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
org.junit.platform.engine.support.hierarchical.Node.DynamicTestExecutor, org.junit.platform.engine.support.hierarchical.Node.ExecutionMode, org.junit.platform.engine.support.hierarchical.Node.Invocation<C extends org.junit.platform.engine.support.hierarchical.EngineExecutionContext>, org.junit.platform.engine.support.hierarchical.Node.SkipResultNested classes/interfaces inherited from interface org.junit.platform.engine.TestDescriptor
org.junit.platform.engine.TestDescriptor.Type, org.junit.platform.engine.TestDescriptor.Visitor -
Field Summary
FieldsFields inherited from class org.junit.platform.engine.support.descriptor.AbstractTestDescriptor
children -
Method Summary
Modifier and TypeMethodDescriptionfinal voidafter(JupiterEngineExecutionContext context) before(JupiterEngineExecutionContext context) voidcleanUp(JupiterEngineExecutionContext context) default Stream<org.junit.platform.engine.support.hierarchical.ExclusiveResource> default Stream<org.junit.platform.engine.support.hierarchical.ExclusiveResource> determineOwnExclusiveResources(Function<org.junit.jupiter.api.parallel.ResourceLocksProvider, Set<org.junit.jupiter.api.parallel.ResourceLocksProvider.Lock>> providerToLocks) protected final Optional<org.junit.platform.engine.support.hierarchical.Node.ExecutionMode> final org.junit.jupiter.engine.descriptor.ExclusiveResourceCollectorprotected final Optional<org.junit.platform.engine.support.hierarchical.Node.ExecutionMode> final StringFunction<org.junit.jupiter.api.parallel.ResourceLocksProvider, Set<org.junit.jupiter.api.parallel.ResourceLocksProvider.Lock>> final Class<?> final org.junit.platform.engine.TestDescriptor.TypegetType()protected final org.junit.jupiter.api.extension.TestInstancesinstantiateTestClass(Optional<org.junit.jupiter.api.extension.TestInstances> outerInstances, ExtensionRegistry registry, ExtensionContextSupplier extensionContext) protected abstract org.junit.jupiter.api.extension.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(org.junit.platform.engine.support.hierarchical.Node.ExecutionMode defaultChildExecutionMode) final voidvalidate(org.junit.platform.engine.support.discovery.DiscoveryIssueReporter reporter) Validate the state of this descriptor and report any issues found to the suppliedDiscoveryIssueReporter.protected voidvalidateClassTemplateInvocationLifecycleMethods(org.junit.platform.engine.support.discovery.DiscoveryIssueReporter reporter) protected voidvalidateCoreLifecycleMethods(org.junit.platform.engine.support.discovery.DiscoveryIssueReporter reporter) Methods 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
public final org.junit.platform.engine.TestDescriptor.Type getType()- Specified by:
getTypein interfaceorg.junit.platform.engine.TestDescriptor
-
getLegacyReportingName
- Specified by:
getLegacyReportingNamein interfaceorg.junit.platform.engine.TestDescriptor
-
validate
public final void validate(org.junit.platform.engine.support.discovery.DiscoveryIssueReporter reporter) Description copied from interface:ValidatableValidate the state of this descriptor and report any issues found to the suppliedDiscoveryIssueReporter.- Specified by:
validatein interfaceValidatable
-
validateCoreLifecycleMethods
protected void validateCoreLifecycleMethods(org.junit.platform.engine.support.discovery.DiscoveryIssueReporter reporter) -
validateClassTemplateInvocationLifecycleMethods
protected void validateClassTemplateInvocationLifecycleMethods(org.junit.platform.engine.support.discovery.DiscoveryIssueReporter reporter) -
getExplicitExecutionMode
protected final Optional<org.junit.platform.engine.support.hierarchical.Node.ExecutionMode> getExplicitExecutionMode() -
getDefaultChildExecutionMode
protected final Optional<org.junit.platform.engine.support.hierarchical.Node.ExecutionMode> getDefaultChildExecutionMode() -
setDefaultChildExecutionMode
public final void setDefaultChildExecutionMode(org.junit.platform.engine.support.hierarchical.Node.ExecutionMode defaultChildExecutionMode) -
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 interfaceorg.junit.platform.engine.support.hierarchical.Node<JupiterEngineExecutionContext>- Specified by:
preparein classJupiterTestDescriptor
-
before
- Specified by:
beforein interfaceorg.junit.platform.engine.support.hierarchical.Node<JupiterEngineExecutionContext>
-
after
- Specified by:
afterin interfaceorg.junit.platform.engine.support.hierarchical.Node<JupiterEngineExecutionContext>
-
cleanUp
- Specified by:
cleanUpin interfaceorg.junit.platform.engine.support.hierarchical.Node<JupiterEngineExecutionContext>- Overrides:
cleanUpin classJupiterTestDescriptor- Throws:
Exception
-
instantiateTestClass
protected abstract org.junit.jupiter.api.extension.TestInstances instantiateTestClass(JupiterEngineExecutionContext parentExecutionContext, ExtensionContextSupplier extensionContext, ExtensionRegistry registry, JupiterEngineExecutionContext context) -
instantiateTestClass
protected final org.junit.jupiter.api.extension.TestInstances instantiateTestClass(Optional<org.junit.jupiter.api.extension.TestInstances> outerInstances, ExtensionRegistry registry, ExtensionContextSupplier extensionContext) -
determineExclusiveResources
default Stream<org.junit.platform.engine.support.hierarchical.ExclusiveResource> determineExclusiveResources() -
determineOwnExclusiveResources
-
getResourceLocksProviderEvaluator
-