Ejemplo n.º 1
0
  @Test
  public void testChangingCondition() throws Exception {
    Condition cond =
        new Condition() {
          private int intValue = 10;

          public boolean getValue() {
            return (--intValue <= 0);
          }
        };

    Condition.waitForCondition(5000L, cond);
    assertTrue(cond.getValue());
  }
Ejemplo n.º 2
0
 @Test
 public void testTimeout() throws Exception {
   Condition.waitForCondition(1000L, falseCondition);
   assertTrue(!falseCondition.getValue());
   assertTrue(true, "Condition timed out");
 }
Ejemplo n.º 3
0
  @Test
  public void testGetValue() throws Exception {

    assertTrue(trueCondition.getValue());
  }