proxy isDefinedAt/apply through TestActorRef
This commit is contained in:
parent
4868f726c5
commit
b6446f50dd
2 changed files with 26 additions and 2 deletions
|
|
@ -18,6 +18,18 @@ class TestActorRef[T <: Actor](factory: () => T) extends LocalActorRef(factory,
|
|||
dispatcher = CallingThreadDispatcher.global
|
||||
receiveTimeout = None
|
||||
|
||||
/**
|
||||
* Query actor's current receive behavior.
|
||||
*/
|
||||
override def isDefinedAt(o : Any) = actor.isDefinedAt(o)
|
||||
|
||||
/**
|
||||
* Directly inject messages into actor receive behavior. Any exceptions
|
||||
* thrown will be available to you, while still being able to use
|
||||
* become/unbecome and their message counterparts.
|
||||
*/
|
||||
def apply(o : Any) { actor(o) }
|
||||
|
||||
/**
|
||||
* Retrieve reference to the underlying actor, where the static type matches the factory used inside the
|
||||
* constructor. Beware that this reference is discarded by the ActorRef upon restarting the actor (should this
|
||||
|
|
@ -68,4 +80,4 @@ object TestActorRef {
|
|||
"\nOR try to change: 'actorOf[MyActor]' to 'actorOf(new MyActor)'."))
|
||||
})
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue