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:
TestClassAware, Validatable, org.junit.platform.engine.support.hierarchical.Node<JupiterEngineExecutionContext>, org.junit.platform.engine.TestDescriptor
Direct Known Subclasses:
TestMethodTestDescriptor, TestTemplateTestDescriptor

@API(status=INTERNAL, since="5.0") public abstract class MethodBasedTestDescriptor extends JupiterTestDescriptor implements TestClassAware, Validatable
Base class for TestDescriptors based on Java methods.
Since:
5.0
  • Nested Class Summary

    Nested classes/interfaces inherited from interface org.junit.platform.engine.support.hierarchical.Node

    org.junit.platform.engine.support.hierarchical.Node.DynamicTestExecutor, org.junit.platform.engine.support.hierarchical.Node.ExecutionMode, org.junit.platform.engine.support.hierarchical.Node.Invocation<C extends org.junit.platform.engine.support.hierarchical.EngineExecutionContext>, org.junit.platform.engine.support.hierarchical.Node.SkipResult

    Nested classes/interfaces inherited from interface org.junit.platform.engine.TestDescriptor

    org.junit.platform.engine.TestDescriptor.Type, org.junit.platform.engine.TestDescriptor.Visitor
  • Field Summary

    Fields inherited from class org.junit.platform.engine.support.descriptor.AbstractTestDescriptor

    children
  • Method Summary

    Modifier and Type
    Method
    Description
    default Stream<org.junit.platform.engine.support.hierarchical.ExclusiveResource>
     
    default Stream<org.junit.platform.engine.support.hierarchical.ExclusiveResource>
    determineOwnExclusiveResources(Function<org.junit.jupiter.api.parallel.ResourceLocksProvider,Set<org.junit.jupiter.api.parallel.ResourceLocksProvider.Lock>> providerToLocks)
     
     
    org.junit.jupiter.engine.descriptor.ExclusiveResourceCollector
     
    protected Optional<org.junit.platform.engine.support.hierarchical.Node.ExecutionMode>
     
     
    Function<org.junit.jupiter.api.parallel.ResourceLocksProvider,Set<org.junit.jupiter.api.parallel.ResourceLocksProvider.Lock>>
     
    final Set<org.junit.platform.engine.TestTag>
     
    final Class<?>
     
    final Method
     
    protected void
    invokeTestWatchers(JupiterEngineExecutionContext context, boolean reverseOrder, Consumer<org.junit.jupiter.api.extension.TestWatcher> callback)
     
    void
    nodeSkipped(JupiterEngineExecutionContext context, org.junit.platform.engine.TestDescriptor descriptor, org.junit.platform.engine.support.hierarchical.Node.SkipResult result)
    Invoke TestWatcher.testDisabled(ExtensionContext, Optional) on each registered TestWatcher, in registration order.
    void
    validate(org.junit.platform.engine.support.discovery.DiscoveryIssueReporter reporter)
    Validate the state of this descriptor and report any issues found to the supplied DiscoveryIssueReporter.

    Methods inherited from class org.junit.platform.engine.support.descriptor.AbstractTestDescriptor

    addChild, equals, findByUniqueId, getChildren, getDisplayName, getParent, getSource, getUniqueId, hashCode, orderChildren, removeChild, removeFromHierarchy, setParent, toString

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait

    Methods inherited from interface org.junit.platform.engine.support.hierarchical.Node

    after, around, before, execute, nodeFinished

    Methods inherited from interface org.junit.platform.engine.TestDescriptor

    accept, addChild, findByUniqueId, getAncestors, getChildren, getDescendants, getDisplayName, getParent, getSource, getType, getUniqueId, isContainer, isRoot, isTest, mayRegisterTests, orderChildren, prune, removeChild, removeFromHierarchy, setParent
  • Method Details

    • getTestMethod

      public final Method getTestMethod()
    • getTags

      public final Set<org.junit.platform.engine.TestTag> getTags()
      Specified by:
      getTags in interface org.junit.platform.engine.TestDescriptor
      Overrides:
      getTags in class org.junit.platform.engine.support.descriptor.AbstractTestDescriptor
    • getLegacyReportingName

      public String getLegacyReportingName()
      Specified by:
      getLegacyReportingName in interface org.junit.platform.engine.TestDescriptor
    • getTestClass

      public final Class<?> getTestClass()
      Specified by:
      getTestClass in interface TestClassAware
    • getEnclosingTestClasses

      public List<Class<?>> getEnclosingTestClasses()
      Specified by:
      getEnclosingTestClasses in interface TestClassAware
    • validate

      public void validate(org.junit.platform.engine.support.discovery.DiscoveryIssueReporter reporter)
      Description copied from interface: Validatable
      Validate the state of this descriptor and report any issues found to the supplied DiscoveryIssueReporter.
      Specified by:
      validate in interface Validatable
    • getExclusiveResourceCollector

      public org.junit.jupiter.engine.descriptor.ExclusiveResourceCollector getExclusiveResourceCollector()
    • getResourceLocksProviderEvaluator

      public Function<org.junit.jupiter.api.parallel.ResourceLocksProvider,Set<org.junit.jupiter.api.parallel.ResourceLocksProvider.Lock>> getResourceLocksProviderEvaluator()
    • getExplicitExecutionMode

      protected Optional<org.junit.platform.engine.support.hierarchical.Node.ExecutionMode> getExplicitExecutionMode()
    • nodeSkipped

      public void nodeSkipped(JupiterEngineExecutionContext context, org.junit.platform.engine.TestDescriptor descriptor, org.junit.platform.engine.support.hierarchical.Node.SkipResult result)
      Invoke TestWatcher.testDisabled(ExtensionContext, Optional) on each registered TestWatcher, in registration order.
      Specified by:
      nodeSkipped in interface org.junit.platform.engine.support.hierarchical.Node<JupiterEngineExecutionContext>
      Since:
      5.4
    • invokeTestWatchers

      protected void invokeTestWatchers(JupiterEngineExecutionContext context, boolean reverseOrder, Consumer<org.junit.jupiter.api.extension.TestWatcher> callback)
      Since:
      5.4
    • determineExclusiveResources

      default Stream<org.junit.platform.engine.support.hierarchical.ExclusiveResource> determineExclusiveResources()
    • determineOwnExclusiveResources

      default Stream<org.junit.platform.engine.support.hierarchical.ExclusiveResource> determineOwnExclusiveResources(Function<org.junit.jupiter.api.parallel.ResourceLocksProvider,Set<org.junit.jupiter.api.parallel.ResourceLocksProvider.Lock>> providerToLocks)