Class NestedClassTestDescriptor
- 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.NestedClassTestDescriptor
-
- All Implemented Interfaces:
ResourceLockAware,TestClassAware,Validatable,Node<JupiterEngineExecutionContext>,TestDescriptor
@API(status=INTERNAL, since="5.0") public class NestedClassTestDescriptor extends ClassBasedTestDescriptorTestDescriptorfor tests based on nested (but not static) Java classes.Default Display Names
The default display name for a non-static nested test class is the simple name of the class.
- Since:
- 5.0
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor
ClassBasedTestDescriptor.ClassInfo
-
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 static java.lang.StringSEGMENT_TYPE-
Fields inherited from class org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor
classInfo
-
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 Modifier Constructor Description privateNestedClassTestDescriptor(UniqueId uniqueId, java.lang.Class<?> testClass, java.lang.String displayName, JupiterConfiguration configuration)NestedClassTestDescriptor(UniqueId uniqueId, java.lang.Class<?> testClass, java.util.function.Supplier<java.util.List<java.lang.Class<?>>> enclosingInstanceTypes, JupiterConfiguration configuration)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.List<java.lang.Class<?>>getEnclosingTestClasses()static java.util.List<java.lang.Class<?>>getEnclosingTestClasses(TestDescriptor parent)java.util.function.Function<org.junit.jupiter.api.parallel.ResourceLocksProvider,java.util.Set<org.junit.jupiter.api.parallel.ResourceLocksProvider.Lock>>getResourceLocksProviderEvaluator()java.util.Set<TestTag>getTags()Get the set of tags associated with this descriptor.protected org.junit.jupiter.api.extension.TestInstancesinstantiateTestClass(JupiterEngineExecutionContext parentExecutionContext, ExtensionContextSupplier extensionContext, ExtensionRegistry registry, JupiterEngineExecutionContext context)protected NestedClassTestDescriptorwithUniqueId(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.ClassBasedTestDescriptor
after, before, cleanUp, getDefaultChildExecutionMode, getExclusiveResourceCollector, getExplicitExecutionMode, getLegacyReportingName, getTestClass, getType, instantiateTestClass, prepare, setDefaultChildExecutionMode, validate, validateClassTemplateInvocationLifecycleMethods, validateCoreLifecycleMethods
-
Methods inherited from class org.junit.jupiter.engine.descriptor.JupiterTestDescriptor
copyIncludingDescendants, getExclusiveResources, getExecutionMode, getExecutionModeFromAnnotation, getTags, invokeExecutionExceptionHandlers, shouldBeSkipped, toExecutionMode
-
Methods inherited from class org.junit.platform.engine.support.descriptor.AbstractTestDescriptor
addChild, equals, findByUniqueId, getChildren, getDisplayName, getParent, getSource, 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, execute, 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, 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
-
-
Constructor Detail
-
NestedClassTestDescriptor
public NestedClassTestDescriptor(UniqueId uniqueId, java.lang.Class<?> testClass, java.util.function.Supplier<java.util.List<java.lang.Class<?>>> enclosingInstanceTypes, JupiterConfiguration configuration)
-
NestedClassTestDescriptor
private NestedClassTestDescriptor(UniqueId uniqueId, java.lang.Class<?> testClass, java.lang.String displayName, JupiterConfiguration configuration)
-
-
Method Detail
-
withUniqueId
protected NestedClassTestDescriptor 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
-
getTags
public final java.util.Set<TestTag> 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:
TestTag
-
getEnclosingTestClasses
public java.util.List<java.lang.Class<?>> getEnclosingTestClasses()
-
getEnclosingTestClasses
@API(status=INTERNAL, since="5.12") public static java.util.List<java.lang.Class<?>> getEnclosingTestClasses(TestDescriptor parent)
-
instantiateTestClass
protected org.junit.jupiter.api.extension.TestInstances instantiateTestClass(JupiterEngineExecutionContext parentExecutionContext, ExtensionContextSupplier extensionContext, ExtensionRegistry registry, JupiterEngineExecutionContext context)
- Specified by:
instantiateTestClassin classClassBasedTestDescriptor
-
getResourceLocksProviderEvaluator
public java.util.function.Function<org.junit.jupiter.api.parallel.ResourceLocksProvider,java.util.Set<org.junit.jupiter.api.parallel.ResourceLocksProvider.Lock>> getResourceLocksProviderEvaluator()
-
-