Annotation Type Execution
-
@API(status=STABLE, since="5.10") @Retention(RUNTIME) @Target({TYPE,METHOD}) @Inherited public @interface Execution
@Execution
is used to configure the parallel execution mode of a test class or test method.Since JUnit Jupiter 5.4, this annotation is inherited within class hierarchies.
Default Execution Mode
If this annotation is not present,
ExecutionMode.SAME_THREAD
is used unless a default execution mode is defined via one of the following configuration parameters:- "junit.jupiter.execution.parallel.mode.default"
- Default execution mode for all classes and tests
- "junit.jupiter.execution.parallel.mode.classes.default"
- Default execution mode for top-level classes
"junit.jupiter.execution.parallel.mode.classes.default" overrides "junit.jupiter.execution.parallel.mode.default" for top-level classes.
- Since:
- 5.3
- See Also:
Isolated
,ResourceLock
-
-
Field Summary
Fields Modifier and Type Fields Description static java.lang.String
DEFAULT_CLASSES_EXECUTION_MODE_PROPERTY_NAME
Property name used to set the default test execution mode for top-level classes: "junit.jupiter.execution.parallel.mode.classes.default"static java.lang.String
DEFAULT_EXECUTION_MODE_PROPERTY_NAME
Property name used to set the default test execution mode: "junit.jupiter.execution.parallel.mode.default"
-
Required Element Summary
Required Elements Modifier and Type Required Element Description ExecutionMode
value
The required/preferred execution mode.
-
Optional Element Summary
Optional Elements Modifier and Type Optional Element Description java.lang.String
reason
The reason for using the selected execution mode.
-
-
-
Field Detail
-
DEFAULT_EXECUTION_MODE_PROPERTY_NAME
@API(status=EXPERIMENTAL, since="5.9") static final java.lang.String DEFAULT_EXECUTION_MODE_PROPERTY_NAME
Property 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
-
-
-
DEFAULT_CLASSES_EXECUTION_MODE_PROPERTY_NAME
@API(status=EXPERIMENTAL, since="5.9") static final java.lang.String DEFAULT_CLASSES_EXECUTION_MODE_PROPERTY_NAME
Property 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_EXECUTION_MODE_PROPERTY_NAME
.- Since:
- 5.4
-
-
Element Detail
-
value
ExecutionMode value
The required/preferred execution mode.- See Also:
ExecutionMode
-
-