- java.lang.Object
-
- org.junit.runner.Runner
-
- org.junit.platform.runner.JUnitPlatform
-
- All Implemented Interfaces:
Describable,Filterable
@API(status=STABLE, since="1.0") public class JUnitPlatform extends Runner implements Filterable
JUnit 4 basedRunnerwhich 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.apipackage for configuration options.If you do not use any configuration annotations from the
org.junit.platform.suite.apipackage, you can simply 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 bepublicin order to be picked up by IDEs and build tools.When used on a class that serves as a test suite and the
@IncludeClassNamePatternsannotation is not present, the default include pattern "^(Test.*|.+[.$]Test.*|.*Tests?)$" will be used in order to avoid loading classes unnecessarily (seeClassNameFilter#STANDARD_INCLUDE_PATTERN).
-
-
Constructor Summary
Constructors Constructor Description JUnitPlatform(Class<?> testClass)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidfilter(Filter filter)DescriptiongetDescription()voidrun(RunNotifier notifier)
-
-
-
Constructor Detail
-
JUnitPlatform
public JUnitPlatform(Class<?> testClass)
-
-
Method Detail
-
getDescription
public Description getDescription()
- Specified by:
getDescriptionin interfaceDescribable- Specified by:
getDescriptionin classRunner
-
run
public void run(RunNotifier notifier)
-
filter
public void filter(Filter filter) throws NoTestsRemainException
- Specified by:
filterin interfaceFilterable- Throws:
NoTestsRemainException
-
-