Class JupiterTestDescriptor
- java.lang.Object
-
- org.junit.platform.engine.support.descriptor.AbstractTestDescriptor
-
- org.junit.jupiter.engine.descriptor.JupiterTestDescriptor
-
- All Implemented Interfaces:
Node<JupiterEngineExecutionContext>
,TestDescriptor
- Direct Known Subclasses:
ClassTestDescriptor
,TestMethodTestDescriptor
,TestTemplateTestDescriptor
@API(status=INTERNAL, since="5.0") public abstract class JupiterTestDescriptor extends AbstractTestDescriptor implements Node<JupiterEngineExecutionContext>
- Since:
- 5.0
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.junit.platform.engine.support.hierarchical.Node
Node.DynamicTestExecutor, Node.SkipResult
-
Nested classes/interfaces inherited from interface org.junit.platform.engine.TestDescriptor
TestDescriptor.Type, TestDescriptor.Visitor
-
-
Field Summary
-
Fields inherited from class org.junit.platform.engine.support.descriptor.AbstractTestDescriptor
children
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
cleanUp(JupiterEngineExecutionContext context)
Cleanup the suppliedcontext
after execution.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(Executable executable)
Execute the suppliedExecutable
and mask any exception thrown as an unchecked exception.protected static java.util.Set<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.Node.SkipResult
shouldBeSkipped(JupiterEngineExecutionContext context)
Determine if the execution of the suppliedcontext
should be skipped.-
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
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.junit.platform.engine.TestDescriptor
accept, containsTests, getDescendants, getLegacyReportingName, getType, isContainer, isRoot, isTest, mayRegisterTests, prune
-
-
-
-
Method Detail
-
getTags
protected static java.util.Set<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)
-
shouldBeSkipped
public Node.SkipResult shouldBeSkipped(JupiterEngineExecutionContext context) throws java.lang.Exception
Description copied from interface:Node
Determine if the execution of the suppliedcontext
should be skipped.The default implementation returns
Node.SkipResult.doNotSkip()
.- Specified by:
shouldBeSkipped
in interfaceNode<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 interfaceNode<JupiterEngineExecutionContext>
- Throws:
java.lang.Exception
- See Also:
Node.cleanUp(EngineExecutionContext)
-
cleanUp
public void cleanUp(JupiterEngineExecutionContext context) throws java.lang.Exception
Description copied from interface:Node
Cleanup the suppliedcontext
after execution.The default implementation does nothing.
- Specified by:
cleanUp
in interfaceNode<JupiterEngineExecutionContext>
- Throws:
java.lang.Exception
- See Also:
Node.prepare(EngineExecutionContext)
-
executeAndMaskThrowable
protected void executeAndMaskThrowable(Executable executable)
Execute the suppliedExecutable
and mask any exception thrown as an unchecked exception.- Parameters:
executable
- theExecutable
to execute- See Also:
ExceptionUtils.throwAsUncheckedException(Throwable)
-
-