Class RunnableParameterTestDescriptor

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

    public final class RunnableParameterTestDescriptor
    extends org.junit.platform.engine.support.descriptor.AbstractTestDescriptor
    Class to implement a Runnable 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
    • Constructor Detail

      • RunnableParameterTestDescriptor

        public RunnableParameterTestDescriptor​(org.junit.platform.engine.UniqueId uniqueId,
                                               String displayName,
                                               Class<?> testClass,
                                               Parameter testParameter)
        Constructor
        Parameters:
        uniqueId -
        displayName -
        testClass -
        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:
      • getType

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

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

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

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

        public Parameter getTestParameter()
        Method to get the test parameter
        Returns:
      • run

        public void run()
        Method to run the test descriptor
        The TestExecutionContext must be set prior to the call
        Specified by:
        run in interface Runnable
      • getChildren

        public <T> List<T> getChildren​(Class<T> clazz)
        Method to get a List of children cast as a specific class
        Type Parameters:
        T -
        Parameters:
        clazz -
        Returns:
      • setTestExecutionContext

        public void setTestExecutionContext​(TestExecutionContext testExecutionContext)
        Method to set the TestExecutionContext
        Parameters:
        testExecutionContext -
      • getTestExecutionContext

        protected TestExecutionContext getTestExecutionContext()
        Method to get the TestExecutionContext
        Returns:
      • getThrowableCollector

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

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

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