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:
ClassTestDescriptor
,TestMethodTestDescriptor
,TestTemplateTestDescriptor
@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/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.SkipResult
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
cleanUp(JupiterEngineExecutionContext context)
protected static <E extends java.lang.reflect.AnnotatedElement>
java.lang.StringdetermineDisplayName(E element, java.util.function.Function<E,java.lang.String> defaultDisplayNameGenerator)
protected void
executeAndMaskThrowable(org.junit.jupiter.api.function.Executable executable)
Execute the suppliedExecutable
and mask any exception thrown as an unchecked exception.protected java.util.Optional<org.junit.platform.engine.support.hierarchical.Node.ExecutionMode>
getDefaultChildExecutionMode()
protected java.util.Set<org.junit.platform.engine.support.hierarchical.ExclusiveResource>
getExclusiveResourcesFromAnnotation(java.lang.reflect.AnnotatedElement element)
org.junit.platform.engine.support.hierarchical.Node.ExecutionMode
getExecutionMode()
protected java.util.Optional<org.junit.platform.engine.support.hierarchical.Node.ExecutionMode>
getExecutionModeFromAnnotation(java.lang.reflect.AnnotatedElement element)
protected java.util.Optional<org.junit.platform.engine.support.hierarchical.Node.ExecutionMode>
getExplicitExecutionMode()
protected static java.util.Set<org.junit.platform.engine.TestTag>
getTags(java.lang.reflect.AnnotatedElement element)
abstract JupiterEngineExecutionContext
prepare(JupiterEngineExecutionContext context)
Must be overridden and return a new context so cleanUp() does not accidentally close the parent context.org.junit.platform.engine.support.hierarchical.Node.SkipResult
shouldBeSkipped(JupiterEngineExecutionContext context)
-
Methods inherited from class org.junit.platform.engine.support.descriptor.AbstractTestDescriptor
addChild, equals, findByUniqueId, getChildren, getDisplayName, getParent, getSource, getTags, getUniqueId, hashCode, removeChild, removeFromHierarchy, setParent, toString
-
Methods inherited from interface org.junit.platform.engine.support.hierarchical.Node
after, before, execute, getExclusiveResources
-
-
-
-
Method Detail
-
getTags
protected static java.util.Set<org.junit.platform.engine.TestTag> getTags(java.lang.reflect.AnnotatedElement element)
-
determineDisplayName
protected static <E extends java.lang.reflect.AnnotatedElement> java.lang.String determineDisplayName(E element, java.util.function.Function<E,java.lang.String> defaultDisplayNameGenerator)
-
getExecutionMode
public final org.junit.platform.engine.support.hierarchical.Node.ExecutionMode getExecutionMode()
- Specified by:
getExecutionMode
in interfaceorg.junit.platform.engine.support.hierarchical.Node<JupiterEngineExecutionContext>
-
getExplicitExecutionMode
protected java.util.Optional<org.junit.platform.engine.support.hierarchical.Node.ExecutionMode> getExplicitExecutionMode()
-
getDefaultChildExecutionMode
protected java.util.Optional<org.junit.platform.engine.support.hierarchical.Node.ExecutionMode> getDefaultChildExecutionMode()
-
getExecutionModeFromAnnotation
protected java.util.Optional<org.junit.platform.engine.support.hierarchical.Node.ExecutionMode> getExecutionModeFromAnnotation(java.lang.reflect.AnnotatedElement element)
-
getExclusiveResourcesFromAnnotation
protected java.util.Set<org.junit.platform.engine.support.hierarchical.ExclusiveResource> getExclusiveResourcesFromAnnotation(java.lang.reflect.AnnotatedElement element)
-
shouldBeSkipped
public org.junit.platform.engine.support.hierarchical.Node.SkipResult shouldBeSkipped(JupiterEngineExecutionContext context) throws java.lang.Exception
- Specified by:
shouldBeSkipped
in interfaceorg.junit.platform.engine.support.hierarchical.Node<JupiterEngineExecutionContext>
- Throws:
java.lang.Exception
-
prepare
public abstract JupiterEngineExecutionContext prepare(JupiterEngineExecutionContext context) throws java.lang.Exception
Must be overridden and return a new context so cleanUp() does not accidentally close the parent context.- Specified by:
prepare
in interfaceorg.junit.platform.engine.support.hierarchical.Node<JupiterEngineExecutionContext>
- Throws:
java.lang.Exception
-
cleanUp
public void cleanUp(JupiterEngineExecutionContext context) throws java.lang.Exception
- Specified by:
cleanUp
in interfaceorg.junit.platform.engine.support.hierarchical.Node<JupiterEngineExecutionContext>
- Throws:
java.lang.Exception
-
executeAndMaskThrowable
protected void executeAndMaskThrowable(org.junit.jupiter.api.function.Executable executable)
Execute the suppliedExecutable
and mask any exception thrown as an unchecked exception.- Parameters:
executable
- theExecutable
to execute- See Also:
ExceptionUtils.throwAsUncheckedException(Throwable)
-
-