abstract class ExpectMsg[T] extends AnyRef
Receive one message from the test actor and assert that the given matching function accepts it. Wait time is bounded by the given duration, with an AssertionFailure being thrown in case of timeout.
The received object as transformed by the matching function can be retrieved with the
get
method.
Use this variant to implement more complicated or conditional processing.
final String out = new ExpectMsg<String>("match hint") {
protected String match(Object in) {
if (in instanceof Integer)
return "match";
else
throw noMatch();
}
}.get(); // this extracts the received message
- Source
- JavaTestKit.java
- Alphabetic
- By Inheritance
- ExpectMsg
- AnyRef
- Any
- by any2stringadd
- by StringFormat
- by Ensuring
- by ArrowAssoc
- Hide All
- Show All
- Public
- All