Top Description Fields Constructors Methods
org.junit.platform.launcher

public Class LauncherConstants

extends Object
Class Inheritance
Annotations
@API
status:STABLE
since:1.7
Static Imports
org.apiguardian.api.API.Status.EXPERIMENTAL, .API.Status.MAINTAINED, .API.Status.STABLE

Collection of constants related to Launcher.
Since
1.3
See Also
org.junit.platform.engine.ConfigurationParameters

Field Summary

Modifier and TypeField and Description
public static final int
CAPTURE_MAX_BUFFER_DEFAULT

Default maximum number of bytes for buffering to use per thread and output type if output capturing is enabled.

public static final String
CAPTURE_MAX_BUFFER_PROPERTY_NAME

Property name used to configure the maximum number of bytes for buffering to use per thread and output type if output capturing is enabled:

Value must be an integer; defaults to 4194304.

public static final String
CAPTURE_STDERR_PROPERTY_NAME

Property name used to enable capturing output to System#err:

By default, output to System#err is not captured.

public static final String
CAPTURE_STDOUT_PROPERTY_NAME

Property name used to enable capturing output to System#out:

By default, output to System#out is not captured.

public static final String
CRITICAL_DISCOVERY_ISSUE_SEVERITY_PROPERTY_NAME

Property name used to configure the critical severity of issues encountered during test discovery.

public static final String
DEACTIVATE_ALL_LISTENERS_PATTERN

Wildcard pattern which signals that all listeners registered via the ServiceLoader mechanism should be deactivated:

public static final String
DEACTIVATE_LISTENERS_PATTERN_PROPERTY_NAME

Property name used to provide patterns for deactivating listeners registered via the ServiceLoader mechanism: Pattern Matching Syntax

If the property value consists solely of an asterisk (*), all listeners will be deactivated.

public static final String
DISCOVERY_ISSUE_FAILURE_PHASE_PROPERTY_NAME

Property name used to configure the phase that critical discovery issues should cause a failure Supported Values

Supported values are "discovery" or "execution".

public static final String
DRY_RUN_PROPERTY_NAME

Property name used to enable dry-run mode for test execution.

public static final String
ENABLE_LAUNCHER_INTERCEPTORS

Property name used to enable support for LauncherInterceptor instances to be registered via the ServiceLoader mechanism:

By default, interceptor registration is disabled.

public static final String
OUTPUT_DIR_PROPERTY_NAME

Property name used to configure the output directory for reporting.

public static final String
OUTPUT_DIR_UNIQUE_NUMBER_PLACEHOLDER

Placeholder for use in OUTPUT_DIR_PROPERTY_NAME that will be replaced with a unique number.

public static final String
STACKTRACE_PRUNING_ENABLED_PROPERTY_NAME

Property name used to enable or disable stack trace pruning.

public static final String
STDERR_REPORT_ENTRY_KEY

Key used to publish captured output to System#err as part of a ReportEntry:

public static final String
STDOUT_REPORT_ENTRY_KEY

Key used to publish captured output to System#out as part of a ReportEntry:

Constructor Summary

AccessConstructor and Description
private

Method Summary

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

CAPTURE_MAX_BUFFER_DEFAULTback to summary
public static final int CAPTURE_MAX_BUFFER_DEFAULT

Default maximum number of bytes for buffering to use per thread and output type if output capturing is enabled.

See Also
CAPTURE_MAX_BUFFER_PROPERTY_NAME
CAPTURE_MAX_BUFFER_PROPERTY_NAMEback to summary
public static final String CAPTURE_MAX_BUFFER_PROPERTY_NAME

Property name used to configure the maximum number of bytes for buffering to use per thread and output type if output capturing is enabled:

Value must be an integer; defaults to 4194304.

See Also
CAPTURE_MAX_BUFFER_DEFAULT
CAPTURE_STDERR_PROPERTY_NAMEback to summary
public static final String CAPTURE_STDERR_PROPERTY_NAME

Property name used to enable capturing output to System#err:

By default, output to System#err is not captured.

If enabled, the JUnit Platform captures the corresponding output and publishes it as a ReportEntry using the stderr key immediately before reporting the test identifier as finished.

See Also
STDERR_REPORT_ENTRY_KEY, ReportEntry, TestExecutionListener#reportingEntryPublished(TestIdentifier, ReportEntry)
CAPTURE_STDOUT_PROPERTY_NAMEback to summary
public static final String CAPTURE_STDOUT_PROPERTY_NAME

Property name used to enable capturing output to System#out:

By default, output to System#out is not captured.

If enabled, the JUnit Platform captures the corresponding output and publishes it as a ReportEntry using the stdout key immediately before reporting the test identifier as finished.

See Also
STDOUT_REPORT_ENTRY_KEY, ReportEntry, TestExecutionListener#reportingEntryPublished(TestIdentifier, ReportEntry)
CRITICAL_DISCOVERY_ISSUE_SEVERITY_PROPERTY_NAMEback to summary
public static final String CRITICAL_DISCOVERY_ISSUE_SEVERITY_PROPERTY_NAME

Property 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, a org.junit.platform.launcher.core.DiscoveryIssueException listing 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).

Annotations
@API
status:EXPERIMENTAL
since:6.0
Since
1.13
See Also
org.junit.platform.engine.DiscoveryIssue.Severity
DEACTIVATE_ALL_LISTENERS_PATTERNback to summary
public static final String DEACTIVATE_ALL_LISTENERS_PATTERN

Wildcard pattern which signals that all listeners registered via the ServiceLoader mechanism should be deactivated:

See Also
DEACTIVATE_LISTENERS_PATTERN_PROPERTY_NAME, org.junit.platform.launcher.TestExecutionListener
DEACTIVATE_LISTENERS_PATTERN_PROPERTY_NAMEback to summary
public static final String DEACTIVATE_LISTENERS_PATTERN_PROPERTY_NAME

Property name used to provide patterns for deactivating listeners registered via the ServiceLoader mechanism:

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 the org.junit base package and any of its subpackages.
  • *.MyListener: deactivates every listener whose simple class name is exactly MyListener.
  • *System*, *Dev*: deactivates every listener whose FQCN contains System or Dev.
  • org.example.MyListener, org.example.TheirListener: deactivates listeners whose FQCN is exactly org.example.MyListener or org.example.TheirListener.

Only listeners registered via the ServiceLoader mechanism can be deactivated. In other words, any listener registered explicitly via the LauncherDiscoveryRequest cannot 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 the Launcher.

See Also
DEACTIVATE_ALL_LISTENERS_PATTERN, org.junit.platform.launcher.TestExecutionListener
DISCOVERY_ISSUE_FAILURE_PHASE_PROPERTY_NAMEback to summary
public static final String DISCOVERY_ISSUE_FAILURE_PHASE_PROPERTY_NAME

Property name used to configure the phase that critical discovery issues should cause a failure

Supported Values

Supported values are "discovery" or "execution".

If not specified, the Launcher will report discovery issues during the discovery phase if Launcher#discover(LauncherDiscoveryRequest) is called, and during the execution phase if Launcher#execute(LauncherExecutionRequest) is called.

Annotations
@API
status:EXPERIMENTAL
since:6.0
Since
1.13
See Also
CRITICAL_DISCOVERY_ISSUE_SEVERITY_PROPERTY_NAME
DRY_RUN_PROPERTY_NAMEback to summary
public static final String 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 TestExecutionListeners will receive events for all test descriptors that are part of the discovered TestPlan. 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 true or false; defaults to false.

Annotations
@API
status:MAINTAINED
since:1.13.3
ENABLE_LAUNCHER_INTERCEPTORSback to summary
public static final String ENABLE_LAUNCHER_INTERCEPTORS

Property name used to enable support for LauncherInterceptor instances to be registered via the ServiceLoader mechanism:

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 the Launcher.

Annotations
@API
status:MAINTAINED
since:1.13.3
See Also
LauncherInterceptor
OUTPUT_DIR_PROPERTY_NAMEback to summary
public static final String 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.

Annotations
@API
status:MAINTAINED
since:1.13.3
Since
1.12
See Also
OUTPUT_DIR_UNIQUE_NUMBER_PLACEHOLDER, org.junit.platform.engine.OutputDirectoryCreator, EngineDiscoveryRequest#getOutputDirectoryCreator(), TestPlan#getOutputDirectoryCreator()
OUTPUT_DIR_UNIQUE_NUMBER_PLACEHOLDERback to summary
public static final String OUTPUT_DIR_UNIQUE_NUMBER_PLACEHOLDER

Placeholder for use in OUTPUT_DIR_PROPERTY_NAME that 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.

Annotations
@API
status:MAINTAINED
since:1.13.3
Since
1.12
See Also
OUTPUT_DIR_PROPERTY_NAME
STACKTRACE_PRUNING_ENABLED_PROPERTY_NAMEback to summary
public static final String STACKTRACE_PRUNING_ENABLED_PROPERTY_NAME

Property name used to enable or disable stack trace pruning.

By default, stack trace pruning is enabled.

Annotations
@API
status:MAINTAINED
since:1.13.3
See Also
org.junit.platform.launcher.core.EngineExecutionOrchestrator
STDERR_REPORT_ENTRY_KEYback to summary
public static final String STDERR_REPORT_ENTRY_KEY

Key used to publish captured output to System#err as part of a ReportEntry:

STDOUT_REPORT_ENTRY_KEYback to summary
public static final String STDOUT_REPORT_ENTRY_KEY

Key used to publish captured output to System#out as part of a ReportEntry:

Constructor Detail

LauncherConstantsback to summary
private LauncherConstants()