Class Constants
- java.lang.Object
-
- org.junit.jupiter.engine.Constants
-
@API(status=STABLE, since="5.0") public final class Constants extends java.lang.ObjectCollection of constants related to theJupiterTestEngine.Supported Values for Timeouts
Values for timeouts must be in the following, case-insensitive format:
<number> [ns|μs|ms|s|m|h|d]. The space between the number and the unit may be omitted. Specifying no unit is equivalent to using seconds.Value Equivalent annotation 42@Timeout(42)42 ns@Timeout(value = 42, unit = NANOSECONDS)42 μs@Timeout(value = 42, unit = MICROSECONDS)42 ms@Timeout(value = 42, unit = MILLISECONDS)42 s@Timeout(value = 42, unit = SECONDS)42 m@Timeout(value = 42, unit = MINUTES)42 h@Timeout(value = 42, unit = HOURS)42 d@Timeout(value = 42, unit = DAYS)- Since:
- 5.0
- See Also:
ConfigurationParameters
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringDEACTIVATE_ALL_CONDITIONS_PATTERNWildcard pattern which signals that all conditions should be deactivated: "*"static java.lang.StringDEACTIVATE_CONDITIONS_PATTERN_PROPERTY_NAMEProperty name used to provide a pattern for deactivating conditions: "junit.jupiter.conditions.deactivate"static java.lang.StringDEFAULT_AFTER_ALL_METHOD_TIMEOUT_PROPERTY_NAMEProperty name used to set the default timeout for all@AfterAllmethods.static java.lang.StringDEFAULT_AFTER_EACH_METHOD_TIMEOUT_PROPERTY_NAMEProperty name used to set the default timeout for all@AfterEachmethods.static java.lang.StringDEFAULT_BEFORE_ALL_METHOD_TIMEOUT_PROPERTY_NAMEProperty name used to set the default timeout for all@BeforeAllmethods.static java.lang.StringDEFAULT_BEFORE_EACH_METHOD_TIMEOUT_PROPERTY_NAMEProperty name used to set the default timeout for all@BeforeEachmethods.static java.lang.StringDEFAULT_CLASSES_EXECUTION_MODE_PROPERTY_NAMEProperty name used to set the default test execution mode for top-level classes: "junit.jupiter.execution.parallel.mode.classes.default"static java.lang.StringDEFAULT_DISPLAY_NAME_GENERATOR_PROPERTY_NAMEProperty name used to set the default display name generator class name: "junit.jupiter.displayname.generator.default"static java.lang.StringDEFAULT_LIFECYCLE_METHOD_TIMEOUT_PROPERTY_NAMEProperty name used to set the default timeout for all lifecycle methods.static java.lang.StringDEFAULT_PARALLEL_EXECUTION_MODEProperty name used to set the default test execution mode: "junit.jupiter.execution.parallel.mode.default"static java.lang.StringDEFAULT_TEST_FACTORY_METHOD_TIMEOUT_PROPERTY_NAMEProperty name used to set the default timeout for all@TestFactorymethods.static java.lang.StringDEFAULT_TEST_INSTANCE_LIFECYCLE_PROPERTY_NAMEProperty name used to set the default test instance lifecycle mode: "junit.jupiter.testinstance.lifecycle.default"static java.lang.StringDEFAULT_TEST_METHOD_TIMEOUT_PROPERTY_NAMEProperty name used to set the default timeout for all@Testmethods.static java.lang.StringDEFAULT_TEST_TEMPLATE_METHOD_TIMEOUT_PROPERTY_NAMEProperty name used to set the default timeout for all@TestTemplatemethods.static java.lang.StringDEFAULT_TESTABLE_METHOD_TIMEOUT_PROPERTY_NAMEProperty name used to set the default timeout for all testable methods.static java.lang.StringDEFAULT_TIMEOUT_PROPERTY_NAMEProperty name used to set the default timeout for all testable and lifecycle methods.static java.lang.StringEXTENSIONS_AUTODETECTION_ENABLED_PROPERTY_NAMEProperty name used to enable auto-detection and registration of extensions via Java'sServiceLoadermechanism: "junit.jupiter.extensions.autodetection.enabled"static java.lang.StringPARALLEL_CONFIG_CUSTOM_CLASS_PROPERTY_NAMEProperty name used to specify the fully qualified class name of theParallelExecutionConfigurationStrategyto be used for thecustomconfiguration strategy: "junit.jupiter.execution.parallel.config.custom.class"static java.lang.StringPARALLEL_CONFIG_DYNAMIC_FACTOR_PROPERTY_NAMEProperty name used to set the factor to be multiplied with the number of available processors/cores to determine the desired parallelism for thedynamicconfiguration strategy: "junit.jupiter.execution.parallel.config.dynamic.factor"static java.lang.StringPARALLEL_CONFIG_FIXED_PARALLELISM_PROPERTY_NAMEProperty name used to set the desired parallelism for thefixedconfiguration strategy: "junit.jupiter.execution.parallel.config.fixed.parallelism"static java.lang.StringPARALLEL_CONFIG_STRATEGY_PROPERTY_NAMEProperty name used to select theParallelExecutionConfigurationStrategy: "junit.jupiter.execution.parallel.config.strategy"static java.lang.StringPARALLEL_EXECUTION_ENABLED_PROPERTY_NAMEProperty name used to enable parallel test execution: "junit.jupiter.execution.parallel.enabled"static java.lang.StringTIMEOUT_MODE_PROPERTY_NAMEProperty used to determine if timeouts are applied to tests: "junit.jupiter.execution.timeout.mode".
-
-
-
Field Detail
-
DEACTIVATE_CONDITIONS_PATTERN_PROPERTY_NAME
public static final java.lang.String DEACTIVATE_CONDITIONS_PATTERN_PROPERTY_NAME
Property name used to provide a pattern for deactivating conditions: "junit.jupiter.conditions.deactivate"Pattern Matching Syntax
If the pattern consists solely of an asterisk (
*), all conditions will be deactivated. Otherwise, the pattern will be used to match against the fully qualified class name (FQCN) of each registered condition. Any dot (.) in the pattern will match against a dot (.) or a dollar sign ($) in the FQCN. Any asterisk (*) will match against one or more characters in the FQCN. All other characters in the pattern will be matched one-to-one against the FQCN.Examples
*: deactivates all conditions.org.junit.*: deactivates every condition under theorg.junitbase package and any of its subpackages.*.MyCondition: deactivates every condition whose simple class name is exactlyMyCondition.*System*: deactivates every condition whose simple class name containsSystem.org.example.MyCondition: deactivates the condition whose FQCN is exactlyorg.example.MyCondition.
- See Also:
DEACTIVATE_ALL_CONDITIONS_PATTERN,ExecutionCondition, Constant Field Values
-
DEACTIVATE_ALL_CONDITIONS_PATTERN
public static final java.lang.String DEACTIVATE_ALL_CONDITIONS_PATTERN
Wildcard pattern which signals that all conditions should be deactivated: "*"- See Also:
DEACTIVATE_CONDITIONS_PATTERN_PROPERTY_NAME,ExecutionCondition, Constant Field Values
-
DEFAULT_DISPLAY_NAME_GENERATOR_PROPERTY_NAME
public static final java.lang.String DEFAULT_DISPLAY_NAME_GENERATOR_PROPERTY_NAME
Property name used to set the default display name generator class name: "junit.jupiter.displayname.generator.default"Supported Values
Supported values include fully qualified class names for types that implement
DisplayNameGenerator.If not specified, the default is
DisplayNameGenerator.Standard.- See Also:
- Constant Field Values
-
EXTENSIONS_AUTODETECTION_ENABLED_PROPERTY_NAME
public static final java.lang.String EXTENSIONS_AUTODETECTION_ENABLED_PROPERTY_NAME
Property name used to enable auto-detection and registration of extensions via Java'sServiceLoadermechanism: "junit.jupiter.extensions.autodetection.enabled"The default behavior is not to perform auto-detection.
- See Also:
- Constant Field Values
-
DEFAULT_TEST_INSTANCE_LIFECYCLE_PROPERTY_NAME
public static final java.lang.String DEFAULT_TEST_INSTANCE_LIFECYCLE_PROPERTY_NAME
Property name used to set the default test instance lifecycle mode: "junit.jupiter.testinstance.lifecycle.default"Supported Values
Supported values include names of enum constants defined in
TestInstance.Lifecycle, ignoring case.If not specified, the default is "per_method" which corresponds to
@TestInstance(Lifecycle.PER_METHOD).- See Also:
TestInstance, Constant Field Values
-
PARALLEL_EXECUTION_ENABLED_PROPERTY_NAME
@API(status=EXPERIMENTAL, since="5.3") public static final java.lang.String PARALLEL_EXECUTION_ENABLED_PROPERTY_NAMEProperty name used to enable parallel test execution: "junit.jupiter.execution.parallel.enabled"By default, tests are executed sequentially in a single thread.
- Since:
- 5.3
- See Also:
- Constant Field Values
-
DEFAULT_PARALLEL_EXECUTION_MODE
@API(status=EXPERIMENTAL, since="5.4") public static final java.lang.String DEFAULT_PARALLEL_EXECUTION_MODEProperty name used to set the default test execution mode: "junit.jupiter.execution.parallel.mode.default"This setting is only effective if parallel execution is enabled.
Supported Values
Supported values include names of enum constants defined in
ExecutionMode, ignoring case.If not specified, the default is "same_thread" which corresponds to
@Execution(ExecutionMode.SAME_THREAD).- Since:
- 5.4
- See Also:
Execution,ExecutionMode, Constant Field Values
-
DEFAULT_CLASSES_EXECUTION_MODE_PROPERTY_NAME
@API(status=EXPERIMENTAL, since="5.5") public static final java.lang.String DEFAULT_CLASSES_EXECUTION_MODE_PROPERTY_NAMEProperty name used to set the default test execution mode for top-level classes: "junit.jupiter.execution.parallel.mode.classes.default"This setting is only effective if parallel execution is enabled.
Supported Values
Supported values include names of enum constants defined in
ExecutionMode, ignoring case.If not specified, it will be resolved into the same value as
DEFAULT_PARALLEL_EXECUTION_MODE.- Since:
- 5.4
- See Also:
Execution,ExecutionMode, Constant Field Values
-
PARALLEL_CONFIG_STRATEGY_PROPERTY_NAME
@API(status=EXPERIMENTAL, since="5.3") public static final java.lang.String PARALLEL_CONFIG_STRATEGY_PROPERTY_NAMEProperty name used to select theParallelExecutionConfigurationStrategy: "junit.jupiter.execution.parallel.config.strategy"Potential values:
dynamic(default),fixed, orcustom.- Since:
- 5.3
- See Also:
- Constant Field Values
-
PARALLEL_CONFIG_FIXED_PARALLELISM_PROPERTY_NAME
@API(status=EXPERIMENTAL, since="5.3") public static final java.lang.String PARALLEL_CONFIG_FIXED_PARALLELISM_PROPERTY_NAMEProperty name used to set the desired parallelism for thefixedconfiguration strategy: "junit.jupiter.execution.parallel.config.fixed.parallelism"No default value; must be a positive integer.
- Since:
- 5.3
- See Also:
- Constant Field Values
-
PARALLEL_CONFIG_DYNAMIC_FACTOR_PROPERTY_NAME
@API(status=EXPERIMENTAL, since="5.3") public static final java.lang.String PARALLEL_CONFIG_DYNAMIC_FACTOR_PROPERTY_NAMEProperty name used to set the factor to be multiplied with the number of available processors/cores to determine the desired parallelism for thedynamicconfiguration strategy: "junit.jupiter.execution.parallel.config.dynamic.factor"Value must be a positive decimal number; defaults to
1.- Since:
- 5.3
- See Also:
- Constant Field Values
-
PARALLEL_CONFIG_CUSTOM_CLASS_PROPERTY_NAME
@API(status=EXPERIMENTAL, since="5.3") public static final java.lang.String PARALLEL_CONFIG_CUSTOM_CLASS_PROPERTY_NAMEProperty name used to specify the fully qualified class name of theParallelExecutionConfigurationStrategyto be used for thecustomconfiguration strategy: "junit.jupiter.execution.parallel.config.custom.class"- Since:
- 5.3
- See Also:
- Constant Field Values
-
DEFAULT_TIMEOUT_PROPERTY_NAME
@API(status=EXPERIMENTAL, since="5.5") public static final java.lang.String DEFAULT_TIMEOUT_PROPERTY_NAMEProperty name used to set the default timeout for all testable and lifecycle methods.The value of this property will be used unless overridden by a more specific property or a
@Timeoutannotation present on the method or on an enclosing test class (for testable methods).Please refer to the class description for the definition of supported values.
- Since:
- 5.5
- See Also:
Timeout, Constant Field Values
-
DEFAULT_TESTABLE_METHOD_TIMEOUT_PROPERTY_NAME
@API(status=EXPERIMENTAL, since="5.5") public static final java.lang.String DEFAULT_TESTABLE_METHOD_TIMEOUT_PROPERTY_NAMEProperty name used to set the default timeout for all testable methods.The value of this property will be used unless overridden by a more specific property or a
@Timeoutannotation present on the testable method or on an enclosing test class.This property overrides the "junit.jupiter.execution.timeout.default" property.
Please refer to the class description for the definition of supported values.
- Since:
- 5.5
- See Also:
Timeout, Constant Field Values
-
DEFAULT_TEST_METHOD_TIMEOUT_PROPERTY_NAME
@API(status=EXPERIMENTAL, since="5.5") public static final java.lang.String DEFAULT_TEST_METHOD_TIMEOUT_PROPERTY_NAMEProperty name used to set the default timeout for all@Testmethods.The value of this property will be used unless overridden by a
@Timeoutannotation present on the@Testmethod or on an enclosing test class.This property overrides the "junit.jupiter.execution.timeout.testable.method.default" property.
Please refer to the class description for the definition of supported values.
- Since:
- 5.5
- See Also:
Timeout, Constant Field Values
-
DEFAULT_TEST_TEMPLATE_METHOD_TIMEOUT_PROPERTY_NAME
@API(status=EXPERIMENTAL, since="5.5") public static final java.lang.String DEFAULT_TEST_TEMPLATE_METHOD_TIMEOUT_PROPERTY_NAMEProperty name used to set the default timeout for all@TestTemplatemethods.The value of this property will be used unless overridden by a
@Timeoutannotation present on the@TestTemplatemethod or on an enclosing test class.This property overrides the "junit.jupiter.execution.timeout.testable.method.default" property.
Please refer to the class description for the definition of supported values.
- Since:
- 5.5
- See Also:
Timeout, Constant Field Values
-
DEFAULT_TEST_FACTORY_METHOD_TIMEOUT_PROPERTY_NAME
@API(status=EXPERIMENTAL, since="5.5") public static final java.lang.String DEFAULT_TEST_FACTORY_METHOD_TIMEOUT_PROPERTY_NAMEProperty name used to set the default timeout for all@TestFactorymethods.The value of this property will be used unless overridden by a
@Timeoutannotation present on the@TestFactorymethod or on an enclosing test class.This property overrides the "junit.jupiter.execution.timeout.testable.method.default" property.
Please refer to the class description for the definition of supported values.
- Since:
- 5.5
- See Also:
Timeout, Constant Field Values
-
DEFAULT_LIFECYCLE_METHOD_TIMEOUT_PROPERTY_NAME
@API(status=EXPERIMENTAL, since="5.5") public static final java.lang.String DEFAULT_LIFECYCLE_METHOD_TIMEOUT_PROPERTY_NAMEProperty name used to set the default timeout for all lifecycle methods.The value of this property will be used unless overridden by a more specific property or a
@Timeoutannotation present on the lifecycle method.This property overrides the "junit.jupiter.execution.timeout.default" property.
Please refer to the class description for the definition of supported values.
- Since:
- 5.5
- See Also:
Timeout, Constant Field Values
-
DEFAULT_BEFORE_ALL_METHOD_TIMEOUT_PROPERTY_NAME
@API(status=EXPERIMENTAL, since="5.5") public static final java.lang.String DEFAULT_BEFORE_ALL_METHOD_TIMEOUT_PROPERTY_NAMEProperty name used to set the default timeout for all@BeforeAllmethods.The value of this property will be used unless overridden by a
@Timeoutannotation present on the@BeforeAllmethod.This property overrides the "junit.jupiter.execution.timeout.lifecycle.method.default" property.
Please refer to the class description for the definition of supported values.
- Since:
- 5.5
- See Also:
Timeout, Constant Field Values
-
DEFAULT_BEFORE_EACH_METHOD_TIMEOUT_PROPERTY_NAME
@API(status=EXPERIMENTAL, since="5.5") public static final java.lang.String DEFAULT_BEFORE_EACH_METHOD_TIMEOUT_PROPERTY_NAMEProperty name used to set the default timeout for all@BeforeEachmethods.The value of this property will be used unless overridden by a
@Timeoutannotation present on the@BeforeEachmethod.This property overrides the "junit.jupiter.execution.timeout.lifecycle.method.default" property.
Please refer to the class description for the definition of supported values.
- Since:
- 5.5
- See Also:
Timeout, Constant Field Values
-
DEFAULT_AFTER_EACH_METHOD_TIMEOUT_PROPERTY_NAME
@API(status=EXPERIMENTAL, since="5.5") public static final java.lang.String DEFAULT_AFTER_EACH_METHOD_TIMEOUT_PROPERTY_NAMEProperty name used to set the default timeout for all@AfterEachmethods.The value of this property will be used unless overridden by a
@Timeoutannotation present on the@AfterEachmethod.This property overrides the "junit.jupiter.execution.timeout.lifecycle.method.default" property.
Please refer to the class description for the definition of supported values.
- Since:
- 5.5
- See Also:
Timeout, Constant Field Values
-
DEFAULT_AFTER_ALL_METHOD_TIMEOUT_PROPERTY_NAME
@API(status=EXPERIMENTAL, since="5.5") public static final java.lang.String DEFAULT_AFTER_ALL_METHOD_TIMEOUT_PROPERTY_NAMEProperty name used to set the default timeout for all@AfterAllmethods.The value of this property will be used unless overridden by a
@Timeoutannotation present on the@AfterAllmethod.This property overrides the "junit.jupiter.execution.timeout.lifecycle.method.default" property.
Please refer to the class description for the definition of supported values.
- Since:
- 5.5
- See Also:
Timeout, Constant Field Values
-
TIMEOUT_MODE_PROPERTY_NAME
@API(status=EXPERIMENTAL, since="5.6") public static final java.lang.String TIMEOUT_MODE_PROPERTY_NAMEProperty used to determine if timeouts are applied to tests: "junit.jupiter.execution.timeout.mode".The value of this property will be used to toggle whether
@Timeoutis applied to tests.Supported timeout mode values:
enabled: enables timeoutsdisabled: disables timeoutsdisabled_on_debug: disables timeouts while debugging
If not specified, the default is
"enabled".- Since:
- 5.6
- See Also:
- Constant Field Values
-
-