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, DynamicNodeTestDescriptor, 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
  • Field Details

  • Constructor Details

    • JupiterTestDescriptor

      JupiterTestDescriptor(org.junit.platform.engine.UniqueId uniqueId, AnnotatedElement element, Supplier<String> displayNameSupplier, org.junit.platform.engine.TestSource source, JupiterConfiguration configuration)
    • JupiterTestDescriptor

      JupiterTestDescriptor(org.junit.platform.engine.UniqueId uniqueId, String displayName, org.junit.platform.engine.TestSource source, JupiterConfiguration configuration)
  • Method Details

    • getLegacyReportingName

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

      protected String getLegacyReportingBaseName()
    • getLegacyReportingIndexes

      private IntStream getLegacyReportingIndexes()
    • asStream

      private IntStream asStream(OptionalInt optInt)
    • getLegacyReportingIndex

      protected OptionalInt getLegacyReportingIndex()
    • getTags

      static Set<org.junit.platform.engine.TestTag> getTags(AnnotatedElement element, Supplier<String> elementDescription, Supplier<org.junit.platform.engine.TestSource> sourceProvider, Consumer<org.junit.platform.engine.DiscoveryIssue> issueCollector)
    • invokeExecutionExceptionHandlers

      <E extends org.junit.jupiter.api.extension.Extension> void invokeExecutionExceptionHandlers(Class<E> handlerType, ExtensionRegistry registry, Throwable throwable, JupiterTestDescriptor.ExceptionHandlerInvoker<E> handlerInvoker)
      Invoke exception handlers for the supplied Throwable one-by-one until none are left or the throwable to handle has been swallowed.
    • invokeExecutionExceptionHandlers

      private <E extends org.junit.jupiter.api.extension.Extension> void invokeExecutionExceptionHandlers(List<E> exceptionHandlers, Throwable throwable, JupiterTestDescriptor.ExceptionHandlerInvoker<E> handlerInvoker)
    • getExecutionMode

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

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

      Optional<org.junit.platform.engine.support.hierarchical.Node.ExecutionMode> getDefaultChildExecutionMode()
    • getExecutionModeFromAnnotation

      Optional<org.junit.platform.engine.support.hierarchical.Node.ExecutionMode> getExecutionModeFromAnnotation(AnnotatedElement element)
    • 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>
    • toSkipResult

      private org.junit.platform.engine.support.hierarchical.Node.SkipResult toSkipResult(org.junit.jupiter.api.extension.ConditionEvaluationResult evaluationResult)
    • 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