File tree 4 files changed +26
-5
lines changed
documentation/src/docs/asciidoc/user-guide
junit-jupiter-api/src/main/java/org/junit/jupiter/api
4 files changed +26
-5
lines changed Original file line number Diff line number Diff line change @@ -2698,11 +2698,11 @@ junit.jupiter.execution.parallel.mode.default = concurrent
2698
2698
2699
2699
The default execution mode is applied to all nodes of the test tree with a few notable
2700
2700
exceptions, namely test classes that use the `Lifecycle.PER_CLASS` mode or a
2701
- `{MethodOrderer}` (except for `{MethodOrderer_Random}`) . In the former case, test authors
2702
- have to ensure that the test class is thread-safe; in the latter, concurrent execution
2703
- might conflict with the configured execution order. Thus, in both cases, test methods in
2704
- such test classes are only executed concurrently if the `@Execution(CONCURRENT)`
2705
- annotation is present on the test class or method.
2701
+ `{MethodOrderer}`. In the former case, test authors have to ensure that the test class is
2702
+ thread-safe; in the latter, concurrent execution might conflict with the configured
2703
+ execution order. Thus, in both cases, test methods in such test classes are only executed
2704
+ concurrently if the `@Execution(CONCURRENT)` annotation is present on the test class or
2705
+ method.
2706
2706
2707
2707
When parallel execution is enabled and a default `{ClassOrderer}` is registered (see
2708
2708
<<writing-tests-test-execution-order-classes>> for details), top-level test classes will
Original file line number Diff line number Diff line change 20
20
import java .lang .annotation .Target ;
21
21
22
22
import org .apiguardian .api .API ;
23
+ import org .junit .jupiter .api .parallel .Execution ;
23
24
24
25
/**
25
26
* {@code @TestInstance} is a type-level annotation that is used to configure
59
60
* create a custom <em>composed annotation</em> that inherits the semantics
60
61
* of {@code @TestInstance}.
61
62
*
63
+ * <h2>Parallel Execution</h2>
64
+ * <p>Using the {@link Lifecycle#PER_CLASS PER_CLASS} lifecycle mode disables
65
+ * parallel execution unless the test class or test method is annotated with
66
+ * {@link Execution @Execution(CONCURRENT)}.
67
+ *
62
68
* @since 5.0
63
69
* @see Nested @Nested
70
+ * @see Execution @Execution
64
71
*/
65
72
@ Target (ElementType .TYPE )
66
73
@ Retention (RetentionPolicy .RUNTIME )
Original file line number Diff line number Diff line change 20
20
import java .lang .annotation .Target ;
21
21
22
22
import org .apiguardian .api .API ;
23
+ import org .junit .jupiter .api .parallel .Execution ;
23
24
24
25
/**
25
26
* {@code @TestMethodOrder} is a type-level annotation that is used to configure
64
65
* }
65
66
* </pre>
66
67
*
68
+ * <h2>Parallel Execution</h2>
69
+ * <p>Using a {@link MethodOrderer} disables parallel execution unless the test
70
+ * class or test method is annotated with
71
+ * {@link Execution @Execution(CONCURRENT)}.
72
+ *
67
73
* @since 5.4
68
74
* @see MethodOrderer
69
75
* @see TestClassOrder
Original file line number Diff line number Diff line change 20
20
import java .lang .annotation .Target ;
21
21
22
22
import org .apiguardian .api .API ;
23
+ import org .junit .jupiter .api .MethodOrderer ;
24
+ import org .junit .jupiter .api .TestInstance ;
23
25
24
26
/**
25
27
* {@code @Execution} is used to configure the parallel execution
44
46
* <p>{@value #DEFAULT_CLASSES_EXECUTION_MODE_PROPERTY_NAME} overrides
45
47
* {@value #DEFAULT_EXECUTION_MODE_PROPERTY_NAME} for top-level classes.
46
48
*
49
+ * <p>The default execution mode is not applied to classes that use the
50
+ * {@link TestInstance.Lifecycle#PER_CLASS PER_CLASS} lifecycle or a
51
+ * {@link MethodOrderer}. In both cases, test methods in such test classes are
52
+ * only executed concurrently if the {@code @Execution(CONCURRENT)} annotation
53
+ * is present on the test class or method.
54
+ *
47
55
* @see Isolated
48
56
* @see ResourceLock
49
57
* @since 5.3
You can’t perform that action at this time.
0 commit comments