Top Description Methods
org.junit.platform.suite.api

public @Interface Suite

extends Annotation
Annotations
@Retention:RUNTIME
@Target:TYPE
@Inherited
@Documented
@API
status:STABLE
since:1.10
@Testable
Static Imports
org.apiguardian.api.API.Status.STABLE

@Suite marks a class as a test suite on the JUnit Platform.

Selector and filter annotations are used to control the contents of the suite. Additionally, configuration can be passed to the suite via the configuration annotations.

When the @IncludeClassNamePatterns annotation is not present, the default include pattern org.junit.platform.engine.discovery.ClassNameFilter#STANDARD_INCLUDE_PATTERN will be used in order to avoid loading classes unnecessarily (see ClassNameFilter#STANDARD_INCLUDE_PATTERN).

By default a suite discovers tests using the configuration parameters explicitly configured by @ConfigurationParameter and the configuration parameters from the discovery request that discovered the suite. Annotating a suite with @DisableParentConfigurationParameters annotation disables the latter as a source of parameters so that only explicit configuration parameters are taken into account.

Note

Depending on the declared test selection, different suites may contain the same tests, potentially with different configurations. Moreover, tests in a suite are executed in addition to the tests executed by every other test engine. This can result in the same tests being executed twice and can be prevented by configuring your build tool to only include the junit-platform-suite engine. Or by using a naming pattern. For example, name all suites *Suite and all tests *Test and configure your build tool to only include the former.

Alternatively, consider using tags to select specific groups of tests.

Since
1.8
See Also
Select, SelectClasses, SelectClasspathResource, SelectDirectories, SelectFile, SelectModules, SelectPackages, SelectUris, IncludeClassNamePatterns, ExcludeClassNamePatterns, IncludeEngines, ExcludeEngines, IncludePackages, ExcludePackages, IncludeTags, ExcludeTags, SuiteDisplayName, ConfigurationParameter, ConfigurationParametersResource, DisableParentConfigurationParameters, org.junit.platform.launcher.LauncherDiscoveryRequest, org.junit.platform.launcher.core.LauncherDiscoveryRequestBuilder, org.junit.platform.launcher.Launcher

Method Summary

Modifier and TypeMethod and Description
public boolean
failIfNoTests()

Fail suite if no tests were discovered.

Inherited from java.lang.annotation.Annotation:
annotationTypeequalshashCodetoString

Method Detail

failIfNoTestsback to summary
public boolean failIfNoTests()

Fail suite if no tests were discovered.

Annotations
@API
status:STABLE
since:1.11
Since
1.9