awaitCond = awaitCond with better error reporting, see #3168
This commit is contained in:
parent
d49b8aa47c
commit
118917d2be
6 changed files with 130 additions and 31 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue