Class ParameterTestDescriptor

  • All Implemented Interfaces:
    org.junit.platform.engine.TestDescriptor

    public final class ParameterTestDescriptor
    extends org.junit.platform.engine.support.descriptor.AbstractTestDescriptor
    Class to implement an extended parameter test descriptor
    • Nested Class Summary

      • 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

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void execute​(TestExecutionContext testExecutionContext)
      Method to test the test descriptor
      void flush()
      Method to flush System.out and System.err PrintStreams
      <T> List<T> getChildren​(Class<T> clazz)
      Method to get a List of children cast as a specific Class
      Optional<org.junit.platform.engine.TestSource> getSource()
      Method to get the TestSource
      Class<?> getTestClass()
      Method to get the test class
      Parameter getTestParameter()
      Method to get the test parameter
      protected ThrowableCollector getThrowableCollector()
      Method to get the test descriptors ThrowableCollector
      org.junit.platform.engine.TestDescriptor.Type getType()
      Method to get the test descriptor Type
      boolean isContainer()
      Method to return whether the test descriptor is a container
      boolean isTest()
      Method to return whether the test descriptor is a test
      protected static Throwable resolve​(Throwable t)
      Method to resolve an Exception to the underlying Exception
      void skip​(TestExecutionContext testExecutionContext)
      Method to skip the TestDescriptor's children, then the TestDescriptor (recursively)
      • Methods inherited from class org.junit.platform.engine.support.descriptor.AbstractTestDescriptor

        addChild, equals, findByUniqueId, getChildren, getDisplayName, getParent, getTags, getUniqueId, hashCode, removeChild, removeFromHierarchy, setParent, toString
      • Methods inherited from interface org.junit.platform.engine.TestDescriptor

        accept, getDescendants, getLegacyReportingName, isRoot, mayRegisterTests, prune
    • Constructor Detail

      • ParameterTestDescriptor

        public ParameterTestDescriptor​(org.junit.platform.engine.UniqueId uniqueId,
                                       String displayName,
                                       Class<?> testClass,
                                       Parameter testParameter)
        Constructor
        Parameters:
        uniqueId - uniqueId
        displayName - displayName
        testClass - testClass
        testParameter - testParameter
    • Method Detail

      • getSource

        public Optional<org.junit.platform.engine.TestSource> getSource()
        Method to get the TestSource
        Specified by:
        getSource in interface org.junit.platform.engine.TestDescriptor
        Overrides:
        getSource in class org.junit.platform.engine.support.descriptor.AbstractTestDescriptor
        Returns:
        the return value
      • getType

        public org.junit.platform.engine.TestDescriptor.Type getType()
        Method to get the test descriptor Type
        Returns:
        the return value
      • isTest

        public boolean isTest()
        Method to return whether the test descriptor is a test
        Returns:
        the return value
      • isContainer

        public boolean isContainer()
        Method to return whether the test descriptor is a container
        Returns:
        the return value
      • getTestClass

        public Class<?> getTestClass()
        Method to get the test class
        Returns:
        the return value
      • getTestParameter

        public Parameter getTestParameter()
        Method to get the test parameter
        Returns:
        the return value
      • execute

        public void execute​(TestExecutionContext testExecutionContext)
        Method to test the test descriptor
        Parameters:
        testExecutionContext - testExecutionContext
      • getChildren

        public <T> List<T> getChildren​(Class<T> clazz)
        Method to get a List of children cast as a specific Class
        Type Parameters:
        T - the return type
        Parameters:
        clazz - clazz
        Returns:
        the return value
      • getThrowableCollector

        protected ThrowableCollector getThrowableCollector()
        Method to get the test descriptors ThrowableCollector
        Returns:
        the return value
      • resolve

        protected static Throwable resolve​(Throwable t)
        Method to resolve an Exception to the underlying Exception
        Parameters:
        t - t
        Returns:
        the return value
      • flush

        public void flush()
        Method to flush System.out and System.err PrintStreams
      • skip

        public void skip​(TestExecutionContext testExecutionContext)
        Method to skip the TestDescriptor's children, then the TestDescriptor (recursively)
        Parameters:
        testExecutionContext - testExecutionContext