Class RunnableClassTestDescriptor

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

    public final class RunnableClassTestDescriptor
    extends org.junit.platform.engine.support.descriptor.AbstractTestDescriptor
    Class to implement a Runnable class 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 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
      protected TestExecutionContext getTestExecutionContext()
      Method to get the TestExecutionContext
      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 run()
      Method to run the test descriptor
      The TestExecutionContext must be set prior to the call
      void setTestExecutionContext​(TestExecutionContext testExecutionContext)
      Method to set the TestExecutionContext
      • 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

      • RunnableClassTestDescriptor

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