Class JupiterTestDescriptor

java.lang.Object
org.junit.platform.engine.support.descriptor.AbstractTestDescriptor
org.junit.jupiter.engine.descriptor.JupiterTestDescriptor
All Implemented Interfaces:
org.junit.platform.engine.support.hierarchical.Node<JupiterEngineExecutionContext>, org.junit.platform.engine.TestDescriptor
Direct Known Subclasses:
ClassBasedTestDescriptor, ClassTemplateInvocationTestDescriptor, MethodBasedTestDescriptor

@API(status=INTERNAL, since="5.0") public abstract class JupiterTestDescriptor extends org.junit.platform.engine.support.descriptor.AbstractTestDescriptor implements org.junit.platform.engine.support.hierarchical.Node<JupiterEngineExecutionContext>
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
    void
     
    copyIncludingDescendants(UnaryOperator<org.junit.platform.engine.UniqueId> uniqueIdTransformer)
    Returns a deep copy (with copies of children) of this descriptor with the supplied unique ID.
    Set<org.junit.platform.engine.support.hierarchical.ExclusiveResource>
     
    org.junit.platform.engine.support.hierarchical.Node.ExecutionMode
     
    Must be overridden and return a new context with a new ExtensionContext so cleanUp() does not accidentally close the parent context.
    org.junit.platform.engine.support.hierarchical.Node.SkipResult
     
    static org.junit.platform.engine.support.hierarchical.Node.ExecutionMode
    toExecutionMode(org.junit.jupiter.api.parallel.ExecutionMode mode)
     
    protected abstract JupiterTestDescriptor
    withUniqueId(UnaryOperator<org.junit.platform.engine.UniqueId> uniqueIdTransformer)
    Returns shallow copy (without children) of this descriptor with the supplied unique ID.

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

    addChild, equals, findByUniqueId, getChildren, getDisplayName, getParent, getSource, getTags, 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, nodeSkipped

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

    accept, getAncestors, getDescendants, getLegacyReportingName, getType, isContainer, isRoot, isTest, mayRegisterTests, prune
  • Method Details

    • getExecutionMode

      public org.junit.platform.engine.support.hierarchical.Node.ExecutionMode getExecutionMode()
      Specified by:
      getExecutionMode in interface org.junit.platform.engine.support.hierarchical.Node<JupiterEngineExecutionContext>
    • toExecutionMode

      public static org.junit.platform.engine.support.hierarchical.Node.ExecutionMode toExecutionMode(org.junit.jupiter.api.parallel.ExecutionMode mode)
    • getExclusiveResources

      public Set<org.junit.platform.engine.support.hierarchical.ExclusiveResource> getExclusiveResources()
      Specified by:
      getExclusiveResources in interface org.junit.platform.engine.support.hierarchical.Node<JupiterEngineExecutionContext>
    • shouldBeSkipped

      public org.junit.platform.engine.support.hierarchical.Node.SkipResult shouldBeSkipped(JupiterEngineExecutionContext context)
      Specified by:
      shouldBeSkipped in interface org.junit.platform.engine.support.hierarchical.Node<JupiterEngineExecutionContext>
    • prepare

      public abstract JupiterEngineExecutionContext prepare(JupiterEngineExecutionContext context) throws Exception
      Must be overridden and return a new context with a new ExtensionContext so cleanUp() does not accidentally close the parent context.
      Specified by:
      prepare in interface org.junit.platform.engine.support.hierarchical.Node<JupiterEngineExecutionContext>
      Throws:
      Exception
    • cleanUp

      public void cleanUp(JupiterEngineExecutionContext context) throws Exception
      Specified by:
      cleanUp in interface org.junit.platform.engine.support.hierarchical.Node<JupiterEngineExecutionContext>
      Throws:
      Exception
    • copyIncludingDescendants

      protected JupiterTestDescriptor copyIncludingDescendants(UnaryOperator<org.junit.platform.engine.UniqueId> uniqueIdTransformer)
      Returns a deep copy (with copies of children) of this descriptor with the supplied unique ID.
      Returns:
      a deep copy (with copies of children) of this descriptor with the supplied unique ID
    • withUniqueId

      protected abstract JupiterTestDescriptor withUniqueId(UnaryOperator<org.junit.platform.engine.UniqueId> uniqueIdTransformer)
      Returns shallow copy (without children) of this descriptor with the supplied unique ID.
      Returns:
      shallow copy (without children) of this descriptor with the supplied unique ID