@API(status=INTERNAL, since="5.0") public class ClassTestDescriptor extends JupiterTestDescriptor
TestDescriptor
for tests based on Java classes.
The default display name for a top-level or nested static test class is the fully qualified name of the class with the package name and leading dot (".") removed.
Node.DynamicTestExecutor, Node.SkipResult
TestDescriptor.Type, TestDescriptor.Visitor
children
Modifier | Constructor and Description |
---|---|
|
ClassTestDescriptor(UniqueId uniqueId,
Class<?> testClass) |
protected |
ClassTestDescriptor(UniqueId uniqueId,
Function<Class<?>,String> defaultDisplayNameGenerator,
Class<?> testClass) |
Modifier and Type | Method and Description |
---|---|
void |
after(JupiterEngineExecutionContext context)
Execute the after behavior of this node.
|
JupiterEngineExecutionContext |
before(JupiterEngineExecutionContext context)
Execute the before behavior of this node.
|
String |
getLegacyReportingName()
Get the name of this descriptor in a format that is suitable for legacy
reporting infrastructure — for example, for reporting systems built
on the Ant-based XML reporting format for JUnit 4.
|
Set<TestTag> |
getTags()
Get the set of tags associated with this descriptor.
|
Class<?> |
getTestClass() |
TestDescriptor.Type |
getType()
Determine the
TestDescriptor.Type of this descriptor. |
protected Object |
instantiateTestClass(JupiterEngineExecutionContext parentExecutionContext,
ExtensionRegistry registry,
ExtensionContext extensionContext) |
JupiterEngineExecutionContext |
prepare(JupiterEngineExecutionContext context)
Prepare the supplied
context prior to execution. |
determineDisplayName, executeAndMaskThrowable, getTags, populateNewExtensionRegistryFromExtendWith, shouldBeSkipped
addChild, equals, findByUniqueId, getChildren, getDisplayName, getParent, getSource, getUniqueId, hashCode, removeChild, removeFromHierarchy, setParent, toString
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
accept, containsTests, getDescendants, isContainer, isRoot, isTest, mayRegisterTests, prune
public Set<TestTag> getTags()
TestDescriptor
getTags
in interface TestDescriptor
getTags
in class AbstractTestDescriptor
null
but potentially emptyTestTag
public final Class<?> getTestClass()
public TestDescriptor.Type getType()
TestDescriptor
TestDescriptor.Type
of this descriptor.null
.TestDescriptor.isContainer()
,
TestDescriptor.isTest()
public String getLegacyReportingName()
TestDescriptor
The default implementation simply delegates to TestDescriptor.getDisplayName()
.
null
or blankpublic JupiterEngineExecutionContext prepare(JupiterEngineExecutionContext context)
Node
context
prior to execution.
The default implementation returns the supplied context
unmodified.
public JupiterEngineExecutionContext before(JupiterEngineExecutionContext context) throws Exception
Node
This method will be called once before execution of this node.
context
- the context to execute inException
Node.execute(C, org.junit.platform.engine.support.hierarchical.Node.DynamicTestExecutor)
,
Node.after(C)
public void after(JupiterEngineExecutionContext context) throws Exception
Node
This method will be called once after execution of this node.
context
- the context to execute inException
Node.before(C)
,
Node.execute(C, org.junit.platform.engine.support.hierarchical.Node.DynamicTestExecutor)
protected Object instantiateTestClass(JupiterEngineExecutionContext parentExecutionContext, ExtensionRegistry registry, ExtensionContext extensionContext)