stashin commit so Iulian can play with it

This commit is contained in:
Roland 2012-06-25 19:30:13 +02:00
parent e85d996fd5
commit be74eb835b
10 changed files with 935 additions and 45 deletions

View file

@ -13,6 +13,7 @@ import scala.annotation.tailrec
import akka.actor.ActorSystem
import akka.util.Timeout
import akka.util.BoxedType
import scala.annotation.varargs
object TestActor {
type Ignore = Option[PartialFunction[AnyRef, Boolean]]
@ -241,6 +242,22 @@ trait TestKitBase {
*/
def within[T](max: Duration)(f: T): T = within(0 seconds, max)(f)
/**
* Java API for within():
*
* {{{
* new Within(Duration.parse("3 seconds")) {
* public void run() {
* // your test code here
* }
* }
* }}}
*/
abstract class Within(max: Duration) {
def run(): Unit
within(max)(run())
}
/**
* Same as `expectMsg(remaining, obj)`, but correctly treating the timeFactor.
*/