com.google.code.tempusfugit.temporal
Class Conditions

java.lang.Object
  extended by com.google.code.tempusfugit.temporal.Conditions

public final class Conditions
extends Object


Constructor Summary
Conditions()
           
 
Method Summary
static
<T> Condition
assertion(T actual, org.hamcrest.Matcher<T> matcher)
          Useful when waiting for an assertion in tests, for example;
static void assertThat(Condition condition, org.hamcrest.Matcher<Boolean> booleanMatcher)
           
static void assertThat(String message, Condition condition, org.hamcrest.Matcher<Boolean> booleanMatcher)
           
static Condition is(Thread thread, Thread.State state)
           
static Condition isAlive(Thread thread)
           
static Condition isWaiting(Thread thread)
           
static Condition not(Condition condition)
           
static Condition shutdown(ExecutorService service)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Conditions

public Conditions()
Method Detail

not

public static Condition not(Condition condition)

shutdown

public static Condition shutdown(ExecutorService service)

isAlive

public static Condition isAlive(Thread thread)

isWaiting

public static Condition isWaiting(Thread thread)

is

public static Condition is(Thread thread,
                           Thread.State state)

assertThat

public static void assertThat(Condition condition,
                              org.hamcrest.Matcher<Boolean> booleanMatcher)

assertThat

public static void assertThat(String message,
                              Condition condition,
                              org.hamcrest.Matcher<Boolean> booleanMatcher)

assertion

public static <T> Condition assertion(T actual,
                                      org.hamcrest.Matcher<T> matcher)
Useful when waiting for an assertion in tests, for example;

WaitFor.waitOrTimeout(assertion(limit, is(5)), timeout(millis(500)))

Since:
1.1


Copyright © 2009-2012 tempus-fugit committers. All Rights Reserved.