org.fest.swing.timing
Class Pause

java.lang.Object
  extended by org.fest.swing.timing.Pause

public final class Pause
extends Object

Understands waiting for period of time or for a particular condition to be satisfied.

Author:
Alex Ruiz, Yvonne Wang

Method Summary
static void pause()
          Sleeps for 10 milliseconds.
static void pause(Condition condition)
          Waits until the given condition is satisfied.
static void pause(Condition[] conditions)
          Waits until the given conditions are satisfied.
static void pause(Condition[] conditions, long timeout)
          Waits until the given conditions are satisfied.
static void pause(Condition[] conditions, Timeout timeout)
          Waits until the given conditions are satisfied.
static void pause(Condition condition, long timeout)
          Waits until the given condition is satisfied.
static void pause(Condition condition, Timeout timeout)
          Waits until the given condition is satisfied.
static void pause(long ms)
          Sleeps for the specified time.
static void pause(long timeout, TimeUnit unit)
          Sleeps for the specified time.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

pause

public static void pause(Condition condition)
Waits until the given condition is satisfied.

Parameters:
condition - the condition to verify.
Throws:
NullPointerException - if the given condition is null.
WaitTimedOutError - if the wait times out (more than 30 seconds).

pause

public static void pause(Condition condition,
                         Timeout timeout)
Waits until the given condition is satisfied.

Parameters:
condition - the condition to verify.
timeout - the timeout.
Throws:
NullPointerException - if the given timeout is null.
NullPointerException - if the given condition is null.
WaitTimedOutError - if the wait times out.

pause

public static void pause(Condition condition,
                         long timeout)
Waits until the given condition is satisfied.

Parameters:
condition - the condition to verify.
timeout - the timeout (in milliseconds.)
Throws:
NullPointerException - if the given condition is null.
WaitTimedOutError - if the wait times out.

pause

public static void pause(Condition[] conditions)
Waits until the given conditions are satisfied.

Parameters:
conditions - the conditions to verify.
Throws:
NullPointerException - if the array of conditions is null.
IllegalArgumentException - if the array of conditions is empty.
NullPointerException - if the array of conditions has one or more null values.
WaitTimedOutError - if the wait times out (more than 30 seconds).

pause

public static void pause(Condition[] conditions,
                         Timeout timeout)
Waits until the given conditions are satisfied.

Parameters:
conditions - the conditions to verify.
timeout - the timeout.
Throws:
NullPointerException - if the given timeout is null.
NullPointerException - if the array of conditions is null.
IllegalArgumentException - if the array of conditions is empty.
NullPointerException - if the array of conditions has one or more null values.
WaitTimedOutError - if the wait times out.

pause

public static void pause(Condition[] conditions,
                         long timeout)
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 is null.
IllegalArgumentException - if the array of conditions is empty.
NullPointerException - if the array of conditions has one or more null values.
WaitTimedOutError - if the wait times out.

pause

public static void pause(long timeout,
                         TimeUnit unit)
Sleeps for the specified time.

Parameters:
timeout - the quantity of time units to sleep.
unit - the time units.
Throws:
NullPointerException - if unit is null.
See Also:
pause(long)

pause

public static void pause(long ms)
Sleeps for the specified time.

To catch any InterruptedExceptions that occur, Thread.sleep(long)() may be used instead.

Parameters:
ms - the time to sleep in milliseconds.

pause

public static void pause()
Sleeps for 10 milliseconds.



Copyright © 2007-2011 FEST (Fixtures for Easy Software Testing). All Rights Reserved.