Class JUnitPlatform

  • All Implemented Interfaces:
    org.junit.runner.Describable, org.junit.runner.manipulation.Filterable

    @API(status=DEPRECATED,
         since="1.8")
    @Deprecated
    public class JUnitPlatform
    extends org.junit.runner.Runner
    implements org.junit.runner.manipulation.Filterable
    Deprecated.
    since 1.8, in favor of the @Suite support provided by the junit-platform-suite-engine module; to be removed in JUnit Platform 2.0
    JUnit 4 based Runner which runs tests on the JUnit Platform in a JUnit 4 environment.

    Annotating a class with @RunWith(JUnitPlatform.class) allows it to be run with IDEs and build systems that support JUnit 4 but do not yet support the JUnit Platform directly.

    Please note that test classes and suites annotated with @RunWith(JUnitPlatform.class) cannot be executed directly on the JUnit Platform (or as a "JUnit 5" test as documented in some IDEs). Such classes and suites can only be executed using JUnit 4 infrastructure.

    Consult the various annotations in the org.junit.platform.suite.api package for configuration options.

    If you do not use any configuration annotations from the org.junit.platform.suite.api package, you can use this runner on a test class whose programming model is supported on the JUnit Platform — for example, a JUnit Jupiter test class. Note, however, that any test class run with this runner must be public in order to be picked up by IDEs and build tools.

    When used on a class that serves as a test suite and the @IncludeClassNamePatterns annotation is not present, the default include pattern "^(Test.*|.+[.$]Test.*|.*Tests?)$" will be used in order to avoid loading classes unnecessarily (see ClassNameFilter#STANDARD_INCLUDE_PATTERN).

    Since:
    1.0
    See Also:
    Select, SelectClasses, SelectClasspathResource, SelectDirectories, SelectFile, SelectModules, SelectPackages, SelectUris, IncludeClassNamePatterns, ExcludeClassNamePatterns, IncludeEngines, ExcludeEngines, IncludePackages, ExcludePackages, IncludeTags, ExcludeTags, SuiteDisplayName, UseTechnicalNames, ConfigurationParameter, ConfigurationParametersResource
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private static java.util.List<java.lang.Class<? extends java.lang.annotation.Annotation>> IMPLICIT_SUITE_ANNOTATIONS
      Deprecated.
       
      private org.junit.platform.launcher.Launcher launcher
      Deprecated.
       
      private java.lang.Class<?> testClass
      Deprecated.
       
      private JUnitPlatformTestTree testTree
      Deprecated.
       
    • Constructor Summary

      Constructors 
      Constructor Description
      JUnitPlatform​(java.lang.Class<?> testClass)
      Deprecated.
       
      JUnitPlatform​(java.lang.Class<?> testClass, org.junit.platform.launcher.Launcher launcher)
      Deprecated.
       
    • Method Summary

      All Methods Instance Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      private org.junit.platform.launcher.LauncherDiscoveryRequest createDiscoveryRequest()
      Deprecated.
       
      private org.junit.platform.launcher.LauncherDiscoveryRequest createDiscoveryRequestForUniqueIds​(java.util.Set<org.junit.platform.launcher.TestIdentifier> testIdentifiers)
      Deprecated.
       
      void filter​(org.junit.runner.manipulation.Filter filter)
      Deprecated.
       
      private JUnitPlatformTestTree generateTestTree​(org.junit.platform.launcher.LauncherDiscoveryRequest discoveryRequest)
      Deprecated.
       
      org.junit.runner.Description getDescription()
      Deprecated.
       
      private boolean isSuite()
      Deprecated.
       
      void run​(org.junit.runner.notification.RunNotifier notifier)
      Deprecated.
       
      • Methods inherited from class org.junit.runner.Runner

        testCount
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • IMPLICIT_SUITE_ANNOTATIONS

        private static final java.util.List<java.lang.Class<? extends java.lang.annotation.Annotation>> IMPLICIT_SUITE_ANNOTATIONS
        Deprecated.
      • testClass

        private final java.lang.Class<?> testClass
        Deprecated.
      • launcher

        private final org.junit.platform.launcher.Launcher launcher
        Deprecated.
    • Constructor Detail

      • JUnitPlatform

        public JUnitPlatform​(java.lang.Class<?> testClass)
        Deprecated.
      • JUnitPlatform

        JUnitPlatform​(java.lang.Class<?> testClass,
                      org.junit.platform.launcher.Launcher launcher)
        Deprecated.
    • Method Detail

      • getDescription

        public org.junit.runner.Description getDescription()
        Deprecated.
        Specified by:
        getDescription in interface org.junit.runner.Describable
        Specified by:
        getDescription in class org.junit.runner.Runner
      • run

        public void run​(org.junit.runner.notification.RunNotifier notifier)
        Deprecated.
        Specified by:
        run in class org.junit.runner.Runner
      • generateTestTree

        private JUnitPlatformTestTree generateTestTree​(org.junit.platform.launcher.LauncherDiscoveryRequest discoveryRequest)
        Deprecated.
      • createDiscoveryRequest

        private org.junit.platform.launcher.LauncherDiscoveryRequest createDiscoveryRequest()
        Deprecated.
      • isSuite

        private boolean isSuite()
        Deprecated.
      • filter

        public void filter​(org.junit.runner.manipulation.Filter filter)
                    throws org.junit.runner.manipulation.NoTestsRemainException
        Deprecated.
        Specified by:
        filter in interface org.junit.runner.manipulation.Filterable
        Throws:
        org.junit.runner.manipulation.NoTestsRemainException
      • createDiscoveryRequestForUniqueIds

        private org.junit.platform.launcher.LauncherDiscoveryRequest createDiscoveryRequestForUniqueIds​(java.util.Set<org.junit.platform.launcher.TestIdentifier> testIdentifiers)
        Deprecated.