Class LauncherConstants
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intDefault maximum number of bytes for buffering to use per thread and output type if output capturing is enabled.static final StringProperty name used to configure the maximum number of bytes for buffering to use per thread and output type if output capturing is enabled: "junit.platform.output.capture.maxBuffer"static final StringProperty name used to enable capturing output toSystem.err: "junit.platform.output.capture.stderr"static final StringProperty name used to enable capturing output toSystem.out: "junit.platform.output.capture.stdout"static final StringProperty name used to configure the critical severity of issues encountered during test discovery.static final StringWildcard pattern which signals that all listeners registered via theServiceLoadermechanism should be deactivated: "*"static final StringProperty name used to provide patterns for deactivating listeners registered via theServiceLoadermechanism: "junit.platform.execution.listeners.deactivate"static final StringProperty name used to configure the phase that critical discovery issues should cause a failurestatic final StringProperty name used to enable dry-run mode for test execution.static final StringProperty name used to enable support forLauncherInterceptorinstances to be registered via theServiceLoadermechanism: "junit.platform.launcher.interceptors.enabled"static final StringProperty name used to configure the output directory for reporting.static final StringPlaceholder for use inOUTPUT_DIR_PROPERTY_NAMEthat will be replaced with a unique number.static final StringProperty name used to enable or disable stack trace pruning.static final StringKey used to publish captured output toSystem.erras part of aReportEntry: "stderr"static final StringKey used to publish captured output toSystem.outas part of aReportEntry: "stdout" -
Method Summary
-
Field Details
-
CAPTURE_STDOUT_PROPERTY_NAME
Property name used to enable capturing output toSystem.out: "junit.platform.output.capture.stdout"By default, output to
System.outis not captured.If enabled, the JUnit Platform captures the corresponding output and publishes it as a
ReportEntryusing the "stdout" key immediately before reporting the test identifier as finished.- See Also:
-
CAPTURE_STDERR_PROPERTY_NAME
Property name used to enable capturing output toSystem.err: "junit.platform.output.capture.stderr"By default, output to
System.erris not captured.If enabled, the JUnit Platform captures the corresponding output and publishes it as a
ReportEntryusing the "stderr" key immediately before reporting the test identifier as finished.- See Also:
-
CAPTURE_MAX_BUFFER_PROPERTY_NAME
-
CAPTURE_MAX_BUFFER_DEFAULT
public static final int CAPTURE_MAX_BUFFER_DEFAULTDefault maximum number of bytes for buffering to use per thread and output type if output capturing is enabled.- See Also:
-
STDOUT_REPORT_ENTRY_KEY
Key used to publish captured output toSystem.outas part of aReportEntry: "stdout"- See Also:
-
STDERR_REPORT_ENTRY_KEY
Key used to publish captured output toSystem.erras part of aReportEntry: "stderr"- See Also:
-
DEACTIVATE_LISTENERS_PATTERN_PROPERTY_NAME
Property name used to provide patterns for deactivating listeners registered via theServiceLoadermechanism: "junit.platform.execution.listeners.deactivate"Pattern Matching Syntax
If the property value consists solely of an asterisk (
*), all listeners will be deactivated. Otherwise, the property value will be treated as a comma-separated list of patterns where each individual pattern will be matched against the fully qualified class name (FQCN) of each registered listener. Any dot (.) in a pattern will match against a dot (.) or a dollar sign ($) in a FQCN. Any asterisk (*) will match against one or more characters in a FQCN. All other characters in a pattern will be matched one-to-one against a FQCN.Examples
*: deactivates all listeners.org.junit.*: deactivates every listener under theorg.junitbase package and any of its subpackages.*.MyListener: deactivates every listener whose simple class name is exactlyMyListener.*System*, *Dev*: deactivates every listener whose FQCN containsSystemorDev.org.example.MyListener, org.example.TheirListener: deactivates listeners whose FQCN is exactlyorg.example.MyListenerororg.example.TheirListener.
Only listeners registered via the
ServiceLoadermechanism can be deactivated. In other words, any listener registered explicitly via theLauncherDiscoveryRequestcannot be deactivated via this configuration parameter.In addition, since execution listeners are registered before the test run starts, this configuration parameter can only be supplied as a JVM system property or via the JUnit Platform configuration file but cannot be supplied in the
LauncherDiscoveryRequest} that is passed to theLauncher.- See Also:
-
DEACTIVATE_ALL_LISTENERS_PATTERN
Wildcard pattern which signals that all listeners registered via theServiceLoadermechanism should be deactivated: "*"- See Also:
-
ENABLE_LAUNCHER_INTERCEPTORS
Property name used to enable support forLauncherInterceptorinstances to be registered via theServiceLoadermechanism: "junit.platform.launcher.interceptors.enabled"By default, interceptor registration is disabled.
Since interceptors are registered before the test run starts, this configuration parameter can only be supplied as a JVM system property or via the JUnit Platform configuration file but cannot be supplied in the
LauncherDiscoveryRequest} that is passed to theLauncher.- See Also:
-
DRY_RUN_PROPERTY_NAME
Property name used to enable dry-run mode for test execution.When dry-run mode is enabled, no tests will be executed. Instead, all registered
TestExecutionListenerswill receive events for all test descriptors that are part of the discoveredTestPlan. All containers will be reported as successful and all tests as skipped. This can be useful to test changes in the configuration of a build or to verify a listener is called as expected without having to wait for all tests to be executed.Value must be either
trueorfalse; defaults tofalse.- See Also:
-
STACKTRACE_PRUNING_ENABLED_PROPERTY_NAME
@API(status=MAINTAINED, since="1.13.3") public static final String STACKTRACE_PRUNING_ENABLED_PROPERTY_NAMEProperty name used to enable or disable stack trace pruning.By default, stack trace pruning is enabled.
- See Also:
-
OUTPUT_DIR_PROPERTY_NAME
Property name used to configure the output directory for reporting.If set, value must be a valid path that will be created if it doesn't exist. If not set, the default output directory will be determined by the reporting engine based on the current working directory.
- Since:
- 1.12
- See Also:
-
OUTPUT_DIR_UNIQUE_NUMBER_PLACEHOLDER
@API(status=MAINTAINED, since="1.13.3") public static final String OUTPUT_DIR_UNIQUE_NUMBER_PLACEHOLDERPlaceholder for use inOUTPUT_DIR_PROPERTY_NAMEthat will be replaced with a unique number.This can be used to create a unique output directory for each test run. For example, if multiple forks are used, each fork can be configured to write its output to a separate directory.
- Since:
- 1.12
- See Also:
-
CRITICAL_DISCOVERY_ISSUE_SEVERITY_PROPERTY_NAME
@API(status=EXPERIMENTAL, since="6.0") public static final String CRITICAL_DISCOVERY_ISSUE_SEVERITY_PROPERTY_NAMEProperty name used to configure the critical severity of issues encountered during test discovery.If an engine reports an issue with a severity equal to or higher than the configured critical severity, its tests will not be executed. Depending on
DISCOVERY_ISSUE_FAILURE_PHASE_PROPERTY_NAME, aDiscoveryIssueExceptionlisting all critical issues will be thrown during discovery or be reported as engine-level failure during execution.Supported Values
Supported values include names of enum constants defined in
Severity, ignoring case.If not specified, the default is "error" which corresponds to
Severity.ERROR).- Since:
- 1.13
- See Also:
-
DISCOVERY_ISSUE_FAILURE_PHASE_PROPERTY_NAME
@API(status=EXPERIMENTAL, since="6.0") public static final String DISCOVERY_ISSUE_FAILURE_PHASE_PROPERTY_NAMEProperty name used to configure the phase that critical discovery issues should cause a failureSupported Values
Supported values are "discovery" or "execution".
If not specified, the
Launcherwill report discovery issues during the discovery phase ifLauncher.discover(LauncherDiscoveryRequest)is called, and during the execution phase ifLauncher.execute(LauncherExecutionRequest)is called.- Since:
- 1.13
- See Also:
-