Class JupiterTestDescriptor
- java.lang.Object
-
- org.junit.platform.engine.support.descriptor.AbstractTestDescriptor
-
- org.junit.jupiter.engine.descriptor.JupiterTestDescriptor
-
- All Implemented Interfaces:
org.junit.platform.engine.support.hierarchical.Node<JupiterEngineExecutionContext>,org.junit.platform.engine.TestDescriptor
- Direct Known Subclasses:
ClassBasedTestDescriptor,ClassTemplateInvocationTestDescriptor,DynamicNodeTestDescriptor,MethodBasedTestDescriptor
@API(status=INTERNAL, since="5.0") public abstract class JupiterTestDescriptor extends org.junit.platform.engine.support.descriptor.AbstractTestDescriptor implements org.junit.platform.engine.support.hierarchical.Node<JupiterEngineExecutionContext>- Since:
- 5.0
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static interfaceJupiterTestDescriptor.ExceptionHandlerInvoker<E extends org.junit.jupiter.api.extension.Extension>-
Nested 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.SkipResult
-
-
Field Summary
Fields Modifier and Type Field Description private static ConditionEvaluatorconditionEvaluator(package private) JupiterConfigurationconfiguration
-
Constructor Summary
Constructors Constructor Description JupiterTestDescriptor(org.junit.platform.engine.UniqueId uniqueId, java.lang.reflect.AnnotatedElement element, java.util.function.Supplier<java.lang.String> displayNameSupplier, org.junit.platform.engine.TestSource source, JupiterConfiguration configuration)JupiterTestDescriptor(org.junit.platform.engine.UniqueId uniqueId, java.lang.String displayName, org.junit.platform.engine.TestSource source, JupiterConfiguration configuration)
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description private java.util.stream.IntStreamasStream(java.util.OptionalInt optInt)voidcleanUp(JupiterEngineExecutionContext context)protected JupiterTestDescriptorcopyIncludingDescendants(java.util.function.UnaryOperator<org.junit.platform.engine.UniqueId> uniqueIdTransformer){@return a deep copy (with copies of children) of this descriptor with the supplied unique ID}(package private) java.util.Optional<org.junit.platform.engine.support.hierarchical.Node.ExecutionMode>getDefaultChildExecutionMode()java.util.Set<org.junit.platform.engine.support.hierarchical.ExclusiveResource>getExclusiveResources()org.junit.platform.engine.support.hierarchical.Node.ExecutionModegetExecutionMode()(package private) java.util.Optional<org.junit.platform.engine.support.hierarchical.Node.ExecutionMode>getExecutionModeFromAnnotation(java.lang.reflect.AnnotatedElement element)(package private) java.util.Optional<org.junit.platform.engine.support.hierarchical.Node.ExecutionMode>getExplicitExecutionMode()protected java.lang.StringgetLegacyReportingBaseName()protected java.util.OptionalIntgetLegacyReportingIndex()private java.util.stream.IntStreamgetLegacyReportingIndexes()java.lang.StringgetLegacyReportingName()(package private) static java.util.Set<org.junit.platform.engine.TestTag>getTags(java.lang.reflect.AnnotatedElement element, java.util.function.Supplier<java.lang.String> elementDescription, java.util.function.Supplier<org.junit.platform.engine.TestSource> sourceProvider, java.util.function.Consumer<org.junit.platform.engine.DiscoveryIssue> issueCollector)(package private) <E extends org.junit.jupiter.api.extension.Extension>
voidinvokeExecutionExceptionHandlers(java.lang.Class<E> handlerType, ExtensionRegistry registry, java.lang.Throwable throwable, JupiterTestDescriptor.ExceptionHandlerInvoker<E> handlerInvoker)Invoke exception handlers for the suppliedThrowableone-by-one until none are left or the throwable to handle has been swallowed.private <E extends org.junit.jupiter.api.extension.Extension>
voidinvokeExecutionExceptionHandlers(java.util.List<E> exceptionHandlers, java.lang.Throwable throwable, JupiterTestDescriptor.ExceptionHandlerInvoker<E> handlerInvoker)abstract JupiterEngineExecutionContextprepare(JupiterEngineExecutionContext context)Must be overridden and return a new context with a newExtensionContextso cleanUp() does not accidentally close the parent context.org.junit.platform.engine.support.hierarchical.Node.SkipResultshouldBeSkipped(JupiterEngineExecutionContext context)static org.junit.platform.engine.support.hierarchical.Node.ExecutionModetoExecutionMode(org.junit.jupiter.api.parallel.ExecutionMode mode)private org.junit.platform.engine.support.hierarchical.Node.SkipResulttoSkipResult(org.junit.jupiter.api.extension.ConditionEvaluationResult evaluationResult)protected abstract JupiterTestDescriptorwithUniqueId(java.util.function.UnaryOperator<org.junit.platform.engine.UniqueId> uniqueIdTransformer){@return shallow copy (without children) of this descriptor with the supplied unique ID}-
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
-
-
-
-
Field Detail
-
conditionEvaluator
private static final ConditionEvaluator conditionEvaluator
-
configuration
final JupiterConfiguration configuration
-
-
Constructor Detail
-
JupiterTestDescriptor
JupiterTestDescriptor(org.junit.platform.engine.UniqueId uniqueId, java.lang.reflect.AnnotatedElement element, java.util.function.Supplier<java.lang.String> displayNameSupplier, org.junit.platform.engine.TestSource source, JupiterConfiguration configuration)
-
JupiterTestDescriptor
JupiterTestDescriptor(org.junit.platform.engine.UniqueId uniqueId, java.lang.String displayName, org.junit.platform.engine.TestSource source, JupiterConfiguration configuration)
-
-
Method Detail
-
getLegacyReportingName
public final java.lang.String getLegacyReportingName()
- Specified by:
getLegacyReportingNamein interfaceorg.junit.platform.engine.TestDescriptor
-
getLegacyReportingBaseName
protected java.lang.String getLegacyReportingBaseName()
-
getLegacyReportingIndexes
private java.util.stream.IntStream getLegacyReportingIndexes()
-
asStream
private java.util.stream.IntStream asStream(java.util.OptionalInt optInt)
-
getLegacyReportingIndex
protected java.util.OptionalInt getLegacyReportingIndex()
-
getTags
static java.util.Set<org.junit.platform.engine.TestTag> getTags(java.lang.reflect.AnnotatedElement element, java.util.function.Supplier<java.lang.String> elementDescription, java.util.function.Supplier<org.junit.platform.engine.TestSource> sourceProvider, java.util.function.Consumer<org.junit.platform.engine.DiscoveryIssue> issueCollector)
-
invokeExecutionExceptionHandlers
<E extends org.junit.jupiter.api.extension.Extension> void invokeExecutionExceptionHandlers(java.lang.Class<E> handlerType, ExtensionRegistry registry, java.lang.Throwable throwable, JupiterTestDescriptor.ExceptionHandlerInvoker<E> handlerInvoker)Invoke exception handlers for the suppliedThrowableone-by-one until none are left or the throwable to handle has been swallowed.
-
invokeExecutionExceptionHandlers
private <E extends org.junit.jupiter.api.extension.Extension> void invokeExecutionExceptionHandlers(java.util.List<E> exceptionHandlers, java.lang.Throwable throwable, JupiterTestDescriptor.ExceptionHandlerInvoker<E> handlerInvoker)
-
getExecutionMode
public org.junit.platform.engine.support.hierarchical.Node.ExecutionMode getExecutionMode()
- Specified by:
getExecutionModein interfaceorg.junit.platform.engine.support.hierarchical.Node<JupiterEngineExecutionContext>
-
getExplicitExecutionMode
java.util.Optional<org.junit.platform.engine.support.hierarchical.Node.ExecutionMode> getExplicitExecutionMode()
-
getDefaultChildExecutionMode
java.util.Optional<org.junit.platform.engine.support.hierarchical.Node.ExecutionMode> getDefaultChildExecutionMode()
-
getExecutionModeFromAnnotation
java.util.Optional<org.junit.platform.engine.support.hierarchical.Node.ExecutionMode> getExecutionModeFromAnnotation(java.lang.reflect.AnnotatedElement element)
-
toExecutionMode
public static org.junit.platform.engine.support.hierarchical.Node.ExecutionMode toExecutionMode(org.junit.jupiter.api.parallel.ExecutionMode mode)
-
getExclusiveResources
public java.util.Set<org.junit.platform.engine.support.hierarchical.ExclusiveResource> getExclusiveResources()
- Specified by:
getExclusiveResourcesin interfaceorg.junit.platform.engine.support.hierarchical.Node<JupiterEngineExecutionContext>
-
shouldBeSkipped
public org.junit.platform.engine.support.hierarchical.Node.SkipResult shouldBeSkipped(JupiterEngineExecutionContext context)
- Specified by:
shouldBeSkippedin interfaceorg.junit.platform.engine.support.hierarchical.Node<JupiterEngineExecutionContext>
-
toSkipResult
private org.junit.platform.engine.support.hierarchical.Node.SkipResult toSkipResult(org.junit.jupiter.api.extension.ConditionEvaluationResult evaluationResult)
-
prepare
public abstract JupiterEngineExecutionContext prepare(JupiterEngineExecutionContext context) throws java.lang.Exception
Must 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>- Throws:
java.lang.Exception
-
cleanUp
public void cleanUp(JupiterEngineExecutionContext context) throws java.lang.Exception
- Specified by:
cleanUpin interfaceorg.junit.platform.engine.support.hierarchical.Node<JupiterEngineExecutionContext>- Throws:
java.lang.Exception
-
copyIncludingDescendants
protected JupiterTestDescriptor copyIncludingDescendants(java.util.function.UnaryOperator<org.junit.platform.engine.UniqueId> uniqueIdTransformer)
{@return a deep copy (with copies of children) of this descriptor with the supplied unique ID}
-
withUniqueId
protected abstract JupiterTestDescriptor withUniqueId(java.util.function.UnaryOperator<org.junit.platform.engine.UniqueId> uniqueIdTransformer)
{@return shallow copy (without children) of this descriptor with the supplied unique ID}
-
-