Examples of ellapsedTime()


Examples of org.fest.swing.test.util.StopWatch.ellapsedTime()

  public void should_pause_for_the_given_amount_of_time() {
    StopWatch watch = startNewStopWatch();
    long delay = 2000;
    Pause.pause(2, TimeUnit.SECONDS);
    watch.stop();
    assertThat(watch.ellapsedTime() >= delay).isTrue();
  }

  @Test(expected = NullPointerException.class)
  public void should_throw_error_if_unit_is_null() {
    Pause.pause(2, null);
View Full Code Here

Examples of org.fest.swing.test.util.StopWatch.ellapsedTime()

    int timeToWaitTillSatisfied = 1000;
    SatisfiedCondition condition = new SatisfiedCondition(timeToWaitTillSatisfied);
    StopWatch watch = startNewStopWatch();
    Pause.pause(condition);
    watch.stop();
    assertThat(watch.ellapsedTime() >= timeToWaitTillSatisfied).isTrue();
    assertThat(condition.satisfied).isTrue();
  }

  @Test(expected = WaitTimedOutError.class)
  public void should_timeout_if_Condition_is_never_satisfied() {
View Full Code Here

Examples of org.fest.swing.test.util.StopWatch.ellapsedTime()

    SatisfiedCondition one = new SatisfiedCondition(timeToWaitTillSatisfied);
    SatisfiedCondition two = new SatisfiedCondition(timeToWaitTillSatisfied);
    StopWatch watch = startNewStopWatch();
    Pause.pause(new Condition[] { one, two });
    watch.stop();
    assertThat(watch.ellapsedTime() >= timeToWaitTillSatisfied).isTrue();
    assertThat(one.satisfied).isTrue();
    assertThat(two.satisfied).isTrue();
  }

  @Test(expected = WaitTimedOutError.class)
View Full Code Here

Examples of org.fest.swing.test.util.StopWatch.ellapsedTime()

  public void should_pause_for_the_given_amount_of_time() {
    StopWatch watch = startNewStopWatch();
    long delay = 2000;
    Pause.pause(delay);
    watch.stop();
    assertThat(watch.ellapsedTime() >= delay).isTrue();
  }
}
View Full Code Here

Examples of org.fest.swing.test.util.StopWatch.ellapsedTime()

  private void postEventAndAssertItWaited(Component c) {
    StopWatch stopWatch = startNewStopWatch();
    poster.postEvent(c, event);
    stopWatch.stop();
    assertThat(stopWatch.ellapsedTime()).isGreaterThanOrEqualTo(WAIT_DELAY);
  }
}
View Full Code Here

Examples of org.fest.swing.test.util.StopWatch.ellapsedTime()

      ComponentShownWaiter.waitTillShown(window, timeout);
      failWhenExpectingException();
    } catch (WaitTimedOutError e) {
      stopWatch.stop();
    }
    assertThat(stopWatch.ellapsedTime()).isGreaterThanOrEqualTo(timeout);
  }

  @Test
  public void should_wait_till_Component_is_shown() {
    StopWatch stopWatch = startNewStopWatch();
View Full Code Here

Examples of org.fest.swing.test.util.StopWatch.ellapsedTime()

        robot.showWindow(window);
      }
    }.start();
    ComponentShownWaiter.waitTillShown(window, timeout);
    stopWatch.stop();
    assertThat(stopWatch.ellapsedTime()).isLessThan(timeout);
  }

  @Test
  public void should_not_wait_if_Component_is_already_shown() {
    robot.showWindow(window);
View Full Code Here

Examples of org.fest.swing.test.util.StopWatch.ellapsedTime()

  public void should_not_wait_if_Component_is_already_shown() {
    robot.showWindow(window);
    StopWatch stopWatch = startNewStopWatch();
    ComponentShownWaiter.waitTillShown(window, 10000);
    stopWatch.stop();
    assertThat(stopWatch.ellapsedTime()).isLessThan(10);
  }
}
View Full Code Here

Examples of org.fest.swing.test.util.StopWatch.ellapsedTime()

      ComponentShownWaiter.waitTillShown(window);
      failWhenExpectingException();
    } catch (WaitTimedOutError e) {
      stopWatch.stop();
    }
    assertThat(stopWatch.ellapsedTime()).isGreaterThanOrEqualTo(5000);
  }
}
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.