File tree Expand file tree Collapse file tree 4 files changed +13
-10
lines changed
documentation/src/docs/asciidoc
junit-jupiter-api/src/main/java/org/junit/jupiter/api/parallel Expand file tree Collapse file tree 4 files changed +13
-10
lines changed Original file line number Diff line number Diff line change @@ -90,7 +90,7 @@ JUnit repository on GitHub.
9090* Allow determining "shared resources" at runtime via the new `@ResourceLock#providers`
9191 attribute that accepts implementations of `ResourceLocksProvider`.
9292* Allow declaring "shared resources" for _direct_ child nodes via the new
93- `@ResourceLock(target = CHILDREN)` attribute. It may improve parallelization when
93+ `@ResourceLock(target = CHILDREN)` attribute. This may improve parallelization when
9494 a test class declares a `READ` lock, but only a few methods hold a `READ_WRITE` lock.
9595* Extensions that implement `TestInstancePreConstructCallback`, `TestInstanceFactory`,
9696 `TestInstancePostProcessor`, `ParameterResolver`, or `InvocationInterceptor` may
Original file line number Diff line number Diff line change @@ -3035,15 +3035,15 @@ the `{ResourceLockTarget}` enum.
30353035
30363036Using the `target = CHILDREN` in a class-level `{ResourceLock}` annotation
30373037has the same semantics as adding an annotation with the same `value` and `mode`
3038- to each test method declared in this class.
3038+ to each test method and nested test class declared in this class.
30393039
3040- It may improve parallelization when a test class declares a `READ` lock,
3040+ This may improve parallelization when a test class declares a `READ` lock,
30413041but only a few methods hold a `READ_WRITE` lock.
30423042
30433043Tests in the following example would run in the `SAME_THREAD` if the `{ResourceLock}`
3044- doesn 't have the `target = CHILDREN`. This is because the test class declares a `READ`
3044+ didn 't have `target = CHILDREN`. This is because the test class declares a `READ`
30453045shared resource, but one test method holds a `READ_WRITE` lock,
3046- which forces the `SAME_THREAD` execution mode for all the test methods.
3046+ which would force the `SAME_THREAD` execution mode for all the test methods.
30473047
30483048[source,java]
30493049.Declaring shared resources for child nodes with `target` attribute
Original file line number Diff line number Diff line change 6767 *
6868 * <p>Using the {@link ResourceLockTarget#CHILDREN} in a class-level
6969 * annotation has the same semantics as adding an annotation with the same
70- * {@link #value()} and {@link #mode()} to each test method declared
71- * in this class.
70+ * {@link #value()} and {@link #mode()} to each test method and nested test
71+ * class declared in this class.
7272 *
73- * <p>It may improve parallelization when a test class declares a
73+ * <p>This may improve parallelization when a test class declares a
7474 * {@link ResourceAccessMode#READ READ} lock, but only a few methods hold
7575 * {@link ResourceAccessMode#READ_WRITE READ_WRITE} lock.
7676 *
Original file line number Diff line number Diff line change @@ -37,8 +37,11 @@ public enum ResourceLockTarget {
3737 * <li>a test class
3838 * - test methods and nested test classes declared in the class.</li>
3939 * <li>a nested test class
40- * - test methods declared in the nested class.</li>
41- * <li>a test method - considered to have no children.</li>
40+ * - test methods and nested test classes declared in the nested class.
41+ * </li>
42+ * <li>a test method
43+ * - considered to have no children. Using {@code CHILDREN} for
44+ * a test method results in an exception.</li>
4245 * </ul>
4346 */
4447 CHILDREN
You can’t perform that action at this time.
0 commit comments