@API(status=INTERNAL, since="5.0") public class TestMethodTestDescriptor extends MethodBasedTestDescriptor
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.SkipResult
TestDescriptor.Type, TestDescriptor.Visitor
Modifier and Type | Field and Description |
---|---|
private static ExecutableInvoker |
executableInvoker |
children
Constructor and Description |
---|
TestMethodTestDescriptor(UniqueId uniqueId,
java.lang.Class<?> testClass,
java.lang.reflect.Method testMethod) |
TestMethodTestDescriptor(UniqueId uniqueId,
java.lang.String displayName,
java.lang.Class<?> testClass,
java.lang.reflect.Method testMethod) |
getLegacyReportingName, getTags, getTestClass, getTestMethod
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
private static final ExecutableInvoker executableInvoker
public TestMethodTestDescriptor(UniqueId uniqueId, java.lang.Class<?> testClass, java.lang.reflect.Method testMethod)
TestMethodTestDescriptor(UniqueId uniqueId, java.lang.String displayName, java.lang.Class<?> testClass, java.lang.reflect.Method testMethod)
public TestDescriptor.Type getType()
TestDescriptor
TestDescriptor.Type
of this descriptor.null
.TestDescriptor.isContainer()
,
TestDescriptor.isTest()
public JupiterEngineExecutionContext prepare(JupiterEngineExecutionContext context) throws java.lang.Exception
Node
context
prior to execution.
The default implementation returns the supplied context
unmodified.
java.lang.Exception
protected ExtensionRegistry populateNewExtensionRegistry(JupiterEngineExecutionContext context)
public JupiterEngineExecutionContext execute(JupiterEngineExecutionContext context, Node.DynamicTestExecutor dynamicTestExecutor) throws java.lang.Exception
Node
Containers 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.Exception
Node.before(C)
,
Node.after(C)
private void invokeBeforeEachCallbacks(JupiterEngineExecutionContext context)
private void invokeBeforeEachMethods(JupiterEngineExecutionContext context)
private void invokeBeforeTestExecutionCallbacks(JupiterEngineExecutionContext context)
private <T extends Extension> void invokeBeforeMethodsOrCallbacksUntilExceptionOccurs(JupiterEngineExecutionContext context, java.util.function.BiFunction<ExtensionContext,T,Executable> generator, java.lang.Class<T> type)
protected void invokeTestMethod(JupiterEngineExecutionContext context, Node.DynamicTestExecutor dynamicTestExecutor)
private void invokeTestExecutionExceptionHandlers(ExtensionRegistry registry, ExtensionContext context, java.lang.Throwable ex)
private void invokeTestExecutionExceptionHandlers(java.lang.Throwable ex, java.util.List<TestExecutionExceptionHandler> handlers, ExtensionContext context)
private void invokeAfterTestExecutionCallbacks(JupiterEngineExecutionContext context)
private void invokeAfterEachMethods(JupiterEngineExecutionContext context)
private void invokeAfterEachCallbacks(JupiterEngineExecutionContext context)
private <T extends Extension> void invokeAllAfterMethodsOrCallbacks(JupiterEngineExecutionContext context, java.util.function.BiFunction<ExtensionContext,T,Executable> generator, java.lang.Class<T> type)