Class ExclusiveResource
- java.lang.Object
-
- org.junit.platform.engine.support.hierarchical.ExclusiveResource
-
@API(status=EXPERIMENTAL, since="1.3") public class ExclusiveResource extends Object
An exclusive resource identified by a key with a lock mode that is used to synchronize access to shared resources when executing nodes in parallel.- Since:
- 1.3
- See Also:
Node.getExecutionMode()
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classExclusiveResource.LockModeLockModetranslates to the respectiveReadWriteLocklocks.
-
Constructor Summary
Constructors Constructor Description ExclusiveResource(String key, ExclusiveResource.LockMode lockMode)Create a newExclusiveResource.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object o)StringgetKey()Get the key of this resource.ExclusiveResource.LockModegetLockMode()Get the lock mode of this resource.inthashCode()StringtoString()
-
-
-
Constructor Detail
-
ExclusiveResource
public ExclusiveResource(String key, ExclusiveResource.LockMode lockMode)
Create a newExclusiveResource.- Parameters:
key- the identifier of the resource; nevernullor blanklockMode- the lock mode to use to synchronize access to the resource; nevernull
-
-
Method Detail
-
getKey
public String getKey()
Get the key of this resource.
-
getLockMode
public ExclusiveResource.LockMode getLockMode()
Get the lock mode of this resource.
-
-