Package org.junit.jupiter.api.parallel
Annotation Type ResourceLock
-
@API(status=EXPERIMENTAL, since="5.3") @Retention(RUNTIME) @Target({TYPE,METHOD}) @Repeatable(ResourceLocks.class) public @interface ResourceLock@ResourceLockis used to declare that the annotated test class or test method requires access to a resource identified by a key.The resource key is specified using
value(). In addition,mode()allows to specify whether the annotated test class or test method requiresResourceAccessMode.READ_WRITEor onlyResourceAccessMode.READaccess to the resource. In the former case, execution of the annotated element will occur while no other test class or test method that uses this resource is being executed. In the latter case, the annotated element may be executed concurrently with other test classes or methods that also requireResourceAccessMode.READaccess but not at the same time as any other test that requiresResourceAccessMode.READ_WRITEaccess.This annotation can be repeated to declare the use of multiple resources.
- Since:
- 5.3
- See Also:
Resources,ResourceAccessMode,ResourceLocks
-
-
Required Element Summary
Required Elements Modifier and Type Required Element Description java.lang.StringvalueThe resource key.
-
Optional Element Summary
Optional Elements Modifier and Type Optional Element Description ResourceAccessModemodeThe resource access mode.
-
-
-
Element Detail
-
value
java.lang.String value
The resource key.- See Also:
Resources
-
-
-
mode
ResourceAccessMode mode
The resource access mode.- See Also:
ResourceAccessMode
- Default:
- org.junit.jupiter.api.parallel.ResourceAccessMode.READ_WRITE
-
-