awaitCond = awaitCond with better error reporting, see #3168

This commit is contained in:
Patrik Nordwall 2013-03-22 18:33:14 +01:00
parent d49b8aa47c
commit 118917d2be
6 changed files with 130 additions and 31 deletions

View file

@ -187,6 +187,24 @@ public class TestKitDocTest {
}};
//#test-awaitCond
}
@Test
public void demonstrateAwaitAssert() {
//#test-awaitAssert
new JavaTestKit(system) {{
getRef().tell(42, null);
new AwaitAssert(
duration("1 second"), // maximum wait time
duration("100 millis") // interval at which to check the condition
) {
// do not put code outside this method, will run afterwards
protected void check() {
assertEquals(msgAvailable(), true);
}
};
}};
//#test-awaitAssert
}
@Test
@SuppressWarnings("unchecked") // due to generic varargs