Class Pause

java.lang.Object
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.
  • Field Details

  • Constructor Details

    • Pause

      private Pause()
  • Method Details

    • 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.
    • timeoutExpired

      private static WaitTimedOutError timeoutExpired(Condition condition)
    • 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.
    • validate

      private static void validate(Condition[] conditions)
    • areSatisfied

      private static boolean areSatisfied(Condition[] conditions)
    • done

      private static void done(Condition[] conditions)
    • timeoutExpired

      private static WaitTimedOutError timeoutExpired(Condition[] conditions)
    • 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

      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.