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 intprivate static final int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static booleanareSatisfied(Condition[] conditions) private static voidstatic voidpause()Sleeps for 10 milliseconds.static voidpause(long ms) Sleeps for the specified time.static voidSleeps for the specified time.static voidWaits until the given condition is satisfied.static voidWaits until the given conditions are satisfied.static voidWaits until the given conditions are satisfied.static voidWaits until the given conditions are satisfied.static voidWaits until the given condition is satisfied.static voidWaits until the given condition is satisfied.private static WaitTimedOutErrortimeoutExpired(Condition condition) private static WaitTimedOutErrortimeoutExpired(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 morenullvalues.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 morenullvalues.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 morenullvalues.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- ifunitisnull.- See Also:
-
pause
public static void pause(long ms) Sleeps for the specified time.To catch any
InterruptedExceptions 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.
-