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 ClassesModifier and TypeClassDescription(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>, 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
FieldsModifier and TypeFieldDescriptionprivate static final ConditionEvaluator(package private) final JupiterConfigurationFields inherited from class org.junit.platform.engine.support.descriptor.AbstractTestDescriptor
children -
Constructor Summary
ConstructorsConstructorDescriptionJupiterTestDescriptor(org.junit.platform.engine.UniqueId uniqueId, AnnotatedElement element, Supplier<String> displayNameSupplier, org.junit.platform.engine.TestSource source, JupiterConfiguration configuration) JupiterTestDescriptor(org.junit.platform.engine.UniqueId uniqueId, String displayName, org.junit.platform.engine.TestSource source, JupiterConfiguration configuration) -
Method Summary
Modifier and TypeMethodDescriptionprivate IntStreamasStream(OptionalInt optInt) voidcleanUp(JupiterEngineExecutionContext context) protected JupiterTestDescriptorcopyIncludingDescendants(UnaryOperator<org.junit.platform.engine.UniqueId> uniqueIdTransformer) Returns a deep copy (with copies of children) of this descriptor with the supplied unique ID.(package private) Optional<org.junit.platform.engine.support.hierarchical.Node.ExecutionMode> Set<org.junit.platform.engine.support.hierarchical.ExclusiveResource> org.junit.platform.engine.support.hierarchical.Node.ExecutionMode(package private) Optional<org.junit.platform.engine.support.hierarchical.Node.ExecutionMode> (package private) Optional<org.junit.platform.engine.support.hierarchical.Node.ExecutionMode> protected Stringprotected OptionalIntprivate IntStreamfinal String(package private) static Set<org.junit.platform.engine.TestTag> getTags(AnnotatedElement element, Supplier<String> elementDescription, Supplier<org.junit.platform.engine.TestSource> sourceProvider, Consumer<org.junit.platform.engine.DiscoveryIssue> issueCollector) (package private) <E extends org.junit.jupiter.api.extension.Extension>
voidinvokeExecutionExceptionHandlers(Class<E> handlerType, ExtensionRegistry registry, 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(List<E> exceptionHandlers, 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.SkipResultstatic 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(UnaryOperator<org.junit.platform.engine.UniqueId> uniqueIdTransformer) Returns 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, toStringMethods inherited from interface org.junit.platform.engine.support.hierarchical.Node
after, around, before, execute, nodeFinished, nodeSkippedMethods inherited from interface org.junit.platform.engine.TestDescriptor
accept, getAncestors, getDescendants, getType, isContainer, isRoot, isTest, mayRegisterTests, prune
-
Field Details
-
conditionEvaluator
-
configuration
-
-
Constructor Details
-
JupiterTestDescriptor
JupiterTestDescriptor(org.junit.platform.engine.UniqueId uniqueId, AnnotatedElement element, Supplier<String> displayNameSupplier, org.junit.platform.engine.TestSource source, JupiterConfiguration configuration) -
JupiterTestDescriptor
JupiterTestDescriptor(org.junit.platform.engine.UniqueId uniqueId, String displayName, org.junit.platform.engine.TestSource source, JupiterConfiguration configuration)
-
-
Method Details
-
getLegacyReportingName
- Specified by:
getLegacyReportingNamein interfaceorg.junit.platform.engine.TestDescriptor
-
getLegacyReportingBaseName
-
getLegacyReportingIndexes
-
asStream
-
getLegacyReportingIndex
-
getTags
-
invokeExecutionExceptionHandlers
<E extends org.junit.jupiter.api.extension.Extension> void invokeExecutionExceptionHandlers(Class<E> handlerType, ExtensionRegistry registry, 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(List<E> exceptionHandlers, 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
Optional<org.junit.platform.engine.support.hierarchical.Node.ExecutionMode> getExplicitExecutionMode() -
getDefaultChildExecutionMode
Optional<org.junit.platform.engine.support.hierarchical.Node.ExecutionMode> getDefaultChildExecutionMode() -
getExecutionModeFromAnnotation
Optional<org.junit.platform.engine.support.hierarchical.Node.ExecutionMode> getExecutionModeFromAnnotation(AnnotatedElement element) -
toExecutionMode
public static org.junit.platform.engine.support.hierarchical.Node.ExecutionMode toExecutionMode(org.junit.jupiter.api.parallel.ExecutionMode mode) -
getExclusiveResources
public 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 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:
Exception
-
cleanUp
- Specified by:
cleanUpin interfaceorg.junit.platform.engine.support.hierarchical.Node<JupiterEngineExecutionContext>- Throws:
Exception
-
copyIncludingDescendants
protected JupiterTestDescriptor copyIncludingDescendants(UnaryOperator<org.junit.platform.engine.UniqueId> uniqueIdTransformer) Returns a deep copy (with copies of children) of this descriptor with the supplied unique ID.- Returns:
- a deep copy (with copies of children) of this descriptor with the supplied unique ID
-
withUniqueId
protected abstract JupiterTestDescriptor withUniqueId(UnaryOperator<org.junit.platform.engine.UniqueId> uniqueIdTransformer) Returns shallow copy (without children) of this descriptor with the supplied unique ID.- Returns:
- shallow copy (without children) of this descriptor with the supplied unique ID
-