Node<JupiterEngineExecutionContext>, TestDescriptorTestFactoryTestDescriptor, TestTemplateInvocationTestDescriptor@API(status=INTERNAL, since="5.0") public class TestMethodTestDescriptor extends JupiterTestDescriptor
TestDescriptor for tests based on Java methods.
The default display name for a test method is the name of the method
concatenated with a comma-separated list of parameter types in parentheses.
The names of parameter types are retrieved using Class.getSimpleName().
For example, the default display name for the following test method is
testUser(TestInfo, User).
@Test
void testUser(TestInfo testInfo, @Mock User user) { ... }
Node.DynamicTestExecutor, Node.SkipResultTestDescriptor.Type, TestDescriptor.Visitorchildren| Constructor | Description |
|---|---|
TestMethodTestDescriptor(UniqueId uniqueId,
java.lang.Class<?> testClass,
java.lang.reflect.Method testMethod) |
| Modifier and Type | Method | Description |
|---|---|---|
JupiterEngineExecutionContext |
execute(JupiterEngineExecutionContext context,
Node.DynamicTestExecutor dynamicTestExecutor) |
Execute the behavior of this node.
|
java.lang.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.
|
java.util.Set<TestTag> |
getTags() |
Get the set of tags associated with this descriptor.
|
java.lang.Class<?> |
getTestClass() |
|
java.lang.reflect.Method |
getTestMethod() |
|
TestDescriptor.Type |
getType() |
Determine the
TestDescriptor.Type of this descriptor. |
protected void |
invokeTestMethod(JupiterEngineExecutionContext context,
Node.DynamicTestExecutor dynamicTestExecutor) |
|
protected ExtensionRegistry |
populateNewExtensionRegistry(JupiterEngineExecutionContext context) |
|
JupiterEngineExecutionContext |
prepare(JupiterEngineExecutionContext context) |
Must be overridden and return a new context so cleanUp() does not accidentally close the parent context.
|
addChild, equals, findByUniqueId, getChildren, getDisplayName, getParent, getSource, getUniqueId, hashCode, removeChild, removeFromHierarchy, setParent, toStringcleanUp, determineDisplayName, executeAndMaskThrowable, getTags, shouldBeSkippedclone, finalize, getClass, notify, notifyAll, wait, wait, waitaccept, containsTests, getDescendants, isContainer, isRoot, isTest, mayRegisterTests, prunepublic TestMethodTestDescriptor(UniqueId uniqueId, java.lang.Class<?> testClass, java.lang.reflect.Method testMethod)
public TestDescriptor.Type getType()
TestDescriptorTestDescriptor.Type of this descriptor.null.TestDescriptor.isContainer(),
TestDescriptor.isTest()public JupiterEngineExecutionContext prepare(JupiterEngineExecutionContext context) throws java.lang.Exception
JupiterTestDescriptorprepare in interface Node<JupiterEngineExecutionContext>prepare in class JupiterTestDescriptorjava.lang.ExceptionNode.cleanUp(EngineExecutionContext)protected ExtensionRegistry populateNewExtensionRegistry(JupiterEngineExecutionContext context)
public JupiterEngineExecutionContext execute(JupiterEngineExecutionContext context, Node.DynamicTestExecutor dynamicTestExecutor) throws java.lang.Exception
NodeContainers typically do not implement this method since the
HierarchicalTestEngine handles execution of their children.
The supplied dynamicTestExecutor may be used to submit
additional dynamic tests for immediate execution.
context - the context to execute indynamicTestExecutor - the executor to submit dynamic tests tojava.lang.ExceptionNode.before(C),
Node.after(C)protected void invokeTestMethod(JupiterEngineExecutionContext context, Node.DynamicTestExecutor dynamicTestExecutor)
public final java.util.Set<TestTag> getTags()
TestDescriptorgetTags in interface TestDescriptorgetTags in class AbstractTestDescriptornull
but potentially emptyTestTagpublic final java.lang.Class<?> getTestClass()
public final java.lang.reflect.Method getTestMethod()
public java.lang.String getLegacyReportingName()
TestDescriptorThe default implementation simply delegates to TestDescriptor.getDisplayName().
null or blank