@API(value=Maintained) public class JUnitPlatform extends org.junit.runner.Runner implements org.junit.runner.manipulation.Filterable
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.
Consult the various annotations in this package for configuration options.
If you do not use any configuration annotations from this package, 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 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
"^.*Tests?$"
will be used in order to avoid loading classes unnecessarily (see ClassNameFilter#STANDARD_INCLUDE_PATTERN
).
SelectPackages
,
SelectClasses
,
IncludeClassNamePatterns
,
ExcludeClassNamePatterns
,
IncludeTags
,
ExcludeTags
,
IncludeEngines
,
ExcludeEngines
,
UseTechnicalNames
Constructor and Description |
---|
JUnitPlatform(Class<?> testClass) |
Modifier and Type | Method and Description |
---|---|
void |
filter(org.junit.runner.manipulation.Filter filter) |
org.junit.runner.Description |
getDescription() |
void |
run(org.junit.runner.notification.RunNotifier notifier) |
public JUnitPlatform(Class<?> testClass) throws org.junit.runners.model.InitializationError
org.junit.runners.model.InitializationError
public org.junit.runner.Description getDescription()
getDescription
in interface org.junit.runner.Describable
getDescription
in class org.junit.runner.Runner
public void run(org.junit.runner.notification.RunNotifier notifier)
run
in class org.junit.runner.Runner
public void filter(org.junit.runner.manipulation.Filter filter) throws org.junit.runner.manipulation.NoTestsRemainException
filter
in interface org.junit.runner.manipulation.Filterable
org.junit.runner.manipulation.NoTestsRemainException