public class Synchroniser extends java.lang.Object implements ThreadingPolicy
Modifier and Type | Field and Description |
---|---|
private java.lang.Error |
firstError |
private java.lang.Object |
sync |
Constructor and Description |
---|
Synchroniser() |
Modifier and Type | Method and Description |
---|---|
Invokable |
synchroniseAccessTo(Invokable mockObject) |
private java.lang.Object |
synchroniseInvocation(Invokable mockObject,
Invocation invocation) |
void |
waitUntil(StatePredicate p)
Waits for a StatePredicate to become active.
|
void |
waitUntil(StatePredicate p,
long timeoutMs)
Waits up to a timeout for a StatePredicate to become active.
|
private void |
waitUntil(StatePredicate p,
Timeout timeout) |
public void waitUntil(StatePredicate p) throws java.lang.InterruptedException
p
- the StatePredicate to wait forjava.lang.InterruptedException
public void waitUntil(StatePredicate p, long timeoutMs) throws java.lang.InterruptedException
p
- the StatePredicate to wait fortimeoutMs
- the timeout in millisecondsjava.lang.InterruptedException
private void waitUntil(StatePredicate p, Timeout timeout) throws java.lang.InterruptedException
java.lang.InterruptedException
public Invokable synchroniseAccessTo(Invokable mockObject)
synchroniseAccessTo
in interface ThreadingPolicy
private java.lang.Object synchroniseInvocation(Invokable mockObject, Invocation invocation) throws java.lang.Throwable
java.lang.Throwable