Package org.fest.swing.timing
Class Pause
java.lang.Object
org.fest.swing.timing.Pause
Understands waiting for period of time or for a particular condition to be satisfied.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final int
private static final int
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static boolean
areSatisfied
(Condition[] conditions) private static void
static void
pause()
Sleeps for 10 milliseconds.static void
pause
(long ms) Sleeps for the specified time.static void
Sleeps for the specified time.static void
Waits until the given condition is satisfied.static void
Waits until the given conditions are satisfied.static void
Waits until the given conditions are satisfied.static void
Waits until the given conditions are satisfied.static void
Waits until the given condition is satisfied.static void
Waits until the given condition is satisfied.private static WaitTimedOutError
timeoutExpired
(Condition condition) private static WaitTimedOutError
timeoutExpired
(Condition[] conditions) private static void
-
Field Details
-
DEFAULT_DELAY
private static final int DEFAULT_DELAY- See Also:
-
SLEEP_INTERVAL
private static final int SLEEP_INTERVAL- See Also:
-
-
Constructor Details
-
Pause
private Pause()
-
-
Method Details
-
pause
Waits until the given condition is satisfied.- Parameters:
condition
- the condition to verify.- Throws:
NullPointerException
- if the given condition isnull
.WaitTimedOutError
- if the wait times out (more than 30 seconds).
-
pause
Waits until the given condition is satisfied.- Parameters:
condition
- the condition to verify.timeout
- the timeout.- Throws:
NullPointerException
- if the given timeout isnull
.NullPointerException
- if the given condition isnull
.WaitTimedOutError
- if the wait times out.
-
pause
Waits until the given condition is satisfied.- Parameters:
condition
- the condition to verify.timeout
- the timeout (in milliseconds.)- Throws:
NullPointerException
- if the given condition isnull
.WaitTimedOutError
- if the wait times out.
-
timeoutExpired
-
pause
Waits until the given conditions are satisfied.- Parameters:
conditions
- the conditions to verify.- Throws:
NullPointerException
- if the array of conditions isnull
.IllegalArgumentException
- if the array of conditions is empty.NullPointerException
- if the array of conditions has one or morenull
values.WaitTimedOutError
- if the wait times out (more than 30 seconds).
-
pause
Waits until the given conditions are satisfied.- Parameters:
conditions
- the conditions to verify.timeout
- the timeout.- Throws:
NullPointerException
- if the given timeout isnull
.NullPointerException
- if the array of conditions isnull
.IllegalArgumentException
- if the array of conditions is empty.NullPointerException
- if the array of conditions has one or morenull
values.WaitTimedOutError
- if the wait times out.
-
pause
Waits until the given conditions are satisfied.- Parameters:
conditions
- the conditions to verify.timeout
- the timeout (in milliseconds.)- Throws:
NullPointerException
- if the array of conditions isnull
.IllegalArgumentException
- if the array of conditions is empty.NullPointerException
- if the array of conditions has one or morenull
values.WaitTimedOutError
- if the wait times out.
-
validate
-
areSatisfied
-
done
-
timeoutExpired
-
pause
Sleeps for the specified time.- Parameters:
timeout
- the quantity of time units to sleep.unit
- the time units.- Throws:
NullPointerException
- ifunit
isnull
.- See Also:
-
pause
public static void pause(long ms) Sleeps for the specified time.To catch any
InterruptedException
s that occur,
may be used instead.Thread.sleep(long)
()- Parameters:
ms
- the time to sleep in milliseconds.
-
pause
public static void pause()Sleeps for 10 milliseconds.
-