Class MethodBasedTestDescriptor
java.lang.Object
org.junit.platform.engine.support.descriptor.AbstractTestDescriptor
org.junit.jupiter.engine.descriptor.JupiterTestDescriptor
org.junit.jupiter.engine.descriptor.MethodBasedTestDescriptor
- All Implemented Interfaces:
ResourceLockAware, TestClassAware, Validatable, Node<JupiterEngineExecutionContext>, TestDescriptor
- Direct Known Subclasses:
TestMethodTestDescriptor, TestTemplateTestDescriptor
@API(status=INTERNAL,
since="5.0")
public abstract class MethodBasedTestDescriptor
extends JupiterTestDescriptor
implements ResourceLockAware, TestClassAware, Validatable
Base class for
TestDescriptors based on Java methods.- Since:
- 5.0
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class JupiterTestDescriptor
JupiterTestDescriptor.ExceptionHandlerInvoker<E>Nested classes/interfaces inherited from interface Node
Node.DynamicTestExecutor, Node.ExecutionMode, Node.Invocation<C>, Node.SkipResultNested classes/interfaces inherited from interface TestDescriptor
TestDescriptor.Type, TestDescriptor.Visitor -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final org.junit.platform.commons.logging.Loggerprivate final MethodBasedTestDescriptor.MethodInfoFields inherited from class JupiterTestDescriptor
configurationFields inherited from class AbstractTestDescriptor
children -
Constructor Summary
ConstructorsConstructorDescriptionMethodBasedTestDescriptor(UniqueId uniqueId, Class<?> testClass, Method testMethod, Supplier<List<Class<?>>> enclosingInstanceTypes, JupiterConfiguration configuration) MethodBasedTestDescriptor(UniqueId uniqueId, String displayName, Class<?> testClass, Method testMethod, JupiterConfiguration configuration) -
Method Summary
Modifier and TypeMethodDescriptionprotected Optional<Node.ExecutionMode> 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.Function<org.junit.jupiter.api.parallel.ResourceLocksProvider, Set<org.junit.jupiter.api.parallel.ResourceLocksProvider.Lock>> getTags()Get the set of tags associated with this descriptor.final Class<?> final Methodprotected voidinvokeTestWatchers(JupiterEngineExecutionContext context, boolean reverseOrder, Consumer<org.junit.jupiter.api.extension.TestWatcher> callback) voidnodeSkipped(JupiterEngineExecutionContext context, TestDescriptor descriptor, Node.SkipResult result) InvokeTestWatcher.testDisabled(ExtensionContext, Optional)on each registeredTestWatcher, in registration order.voidvalidate(DiscoveryIssueReporter reporter) Validate the state of this descriptor and report any issues found to the suppliedDiscoveryIssueReporter.Methods inherited from class JupiterTestDescriptor
cleanUp, copyIncludingDescendants, getDefaultChildExecutionMode, getExclusiveResources, getExecutionMode, getExecutionModeFromAnnotation, getTags, invokeExecutionExceptionHandlers, prepare, shouldBeSkipped, toExecutionMode, withUniqueIdMethods inherited from class AbstractTestDescriptor
addChild, equals, findByUniqueId, getChildren, getDisplayName, getParent, getSource, getUniqueId, hashCode, orderChildren, removeChild, removeFromHierarchy, setParent, toStringMethods inherited from interface ResourceLockAware
determineExclusiveResources, determineOwnExclusiveResourcesMethods inherited from interface TestDescriptor
accept, addChild, findByUniqueId, getAncestors, getChildren, getDescendants, getDisplayName, getParent, getSource, getType, getUniqueId, isContainer, isRoot, isTest, mayRegisterTests, orderChildren, prune, removeChild, removeFromHierarchy, setParent
-
Field Details
-
logger
private static final org.junit.platform.commons.logging.Logger logger -
methodInfo
-
-
Constructor Details
-
MethodBasedTestDescriptor
-
MethodBasedTestDescriptor
MethodBasedTestDescriptor(UniqueId uniqueId, String displayName, Class<?> testClass, Method testMethod, JupiterConfiguration configuration)
-
-
Method Details
-
getTestMethod
-
getTags
Description copied from interface:TestDescriptorGet the set of tags associated with this descriptor.- Specified by:
getTagsin interfaceTestDescriptor- Overrides:
getTagsin classAbstractTestDescriptor- Returns:
- the set of tags associated with this descriptor; never
nullbut potentially empty - See Also:
-
getLegacyReportingName
Description copied from interface:TestDescriptorGet 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.The default implementation delegates to
TestDescriptor.getDisplayName().- Specified by:
getLegacyReportingNamein interfaceTestDescriptor- Returns:
- the legacy reporting name; never
nullor blank
-
getTestClass
- Specified by:
getTestClassin interfaceTestClassAware
-
getEnclosingTestClasses
- Specified by:
getEnclosingTestClassesin interfaceTestClassAware
-
validate
Description copied from interface:ValidatableValidate the state of this descriptor and report any issues found to the suppliedDiscoveryIssueReporter.- Specified by:
validatein interfaceValidatable
-
getExclusiveResourceCollector
- Specified by:
getExclusiveResourceCollectorin interfaceResourceLockAware
-
getResourceLocksProviderEvaluator
public Function<org.junit.jupiter.api.parallel.ResourceLocksProvider, Set<org.junit.jupiter.api.parallel.ResourceLocksProvider.Lock>> getResourceLocksProviderEvaluator()- Specified by:
getResourceLocksProviderEvaluatorin interfaceResourceLockAware
-
getExplicitExecutionMode
- Overrides:
getExplicitExecutionModein classJupiterTestDescriptor
-
nodeSkipped
public void nodeSkipped(JupiterEngineExecutionContext context, TestDescriptor descriptor, Node.SkipResult result) InvokeTestWatcher.testDisabled(ExtensionContext, Optional)on each registeredTestWatcher, in registration order.- Specified by:
nodeSkippedin interfaceNode<JupiterEngineExecutionContext>- Parameters:
context- the execution contextdescriptor- the test descriptor that was skippedresult- the result of skipped execution- Since:
- 5.4
-
invokeTestWatchers
protected void invokeTestWatchers(JupiterEngineExecutionContext context, boolean reverseOrder, Consumer<org.junit.jupiter.api.extension.TestWatcher> callback) - Since:
- 5.4
-