|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectakka.actor.ActorRef
akka.actor.InternalActorRef
akka.actor.ActorRefWithCell
akka.actor.LocalActorRef
akka.testkit.TestActorRef<T>
public class TestActorRef<T extends Actor>
This special ActorRef is exclusively for use during unit testing in a single-threaded environment. Therefore, it overrides the dispatcher to CallingThreadDispatcher and sets the receiveTimeout to None. Otherwise, it acts just like a normal ActorRef. You may retrieve a reference to the underlying actor to test internal logic.
| Constructor Summary | |
|---|---|
TestActorRef(ActorSystem _system,
Props _props,
ActorRef _supervisor,
java.lang.String name)
|
|
| Method Summary | ||
|---|---|---|
static
|
apply(scala.reflect.ClassTag<T> t,
ActorSystem system)
|
|
static
|
apply(scala.Function0<T> factory,
scala.reflect.ClassTag<T> evidence$1,
ActorSystem system)
|
|
static
|
apply(scala.Function0<T> factory,
java.lang.String name,
scala.reflect.ClassTag<T> evidence$2,
ActorSystem system)
|
|
static
|
apply(Props props,
ActorRef supervisor,
java.lang.String name,
ActorSystem system)
|
|
static
|
apply(Props props,
ActorSystem system)
|
|
static
|
apply(Props props,
java.lang.String name,
ActorSystem system)
|
|
static
|
apply(java.lang.String name,
scala.reflect.ClassTag<T> t,
ActorSystem system)
|
|
static
|
create(ActorSystem system,
Props props)
Java API: create a TestActorRef in the given system for the given props, with a random name. |
|
static
|
create(ActorSystem system,
Props props,
java.lang.String name)
Java API: create a TestActorRef in the given system for the given props, with the given name. |
|
MessageDispatcher |
dispatcher()
|
|
protected ActorCell |
newActorCell(ActorSystemImpl system,
InternalActorRef ref,
Props props,
MessageDispatcher dispatcher,
InternalActorRef supervisor)
|
|
Props |
props()
|
|
static java.lang.String |
randomName()
|
|
void |
receive(java.lang.Object o)
Directly inject messages into actor receive behavior. |
|
void |
receive(java.lang.Object o,
ActorRef sender)
Directly inject messages into actor receive behavior. |
|
java.lang.String |
toString()
|
|
T |
underlyingActor()
Retrieve reference to the underlying actor, where the static type matches the factory used inside the constructor. |
|
ActorRef |
unwatch(ActorRef subject)
Deregisters this actor from being a death monitor of the provided ActorRef This means that this actor will not get a Terminated()-message when the provided actor is permanently terminated. |
|
ActorRef |
watch(ActorRef subject)
Registers this actor to be a death monitor of the provided ActorRef This means that this actor will get a Terminated()-message when the provided actor is permanently terminated. |
|
| Methods inherited from class akka.actor.LocalActorRef |
|---|
actorContext, children, getChild, getParent, getSingleChild, isTerminated, path, provider, restart, resume, sendSystemMessage, start, stop, suspend, underlying, writeReplace |
| Methods inherited from class akka.actor.InternalActorRef |
|---|
isLocal |
| Methods inherited from class akka.actor.ActorRef |
|---|
compareTo, equals, forward, hashCode, noSender, tell |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface akka.actor.LocalRef |
|---|
isLocal |
| Constructor Detail |
|---|
public TestActorRef(ActorSystem _system,
Props _props,
ActorRef _supervisor,
java.lang.String name)
| Method Detail |
|---|
public static java.lang.String randomName()
public static <T extends Actor> TestActorRef<T> apply(scala.Function0<T> factory,
scala.reflect.ClassTag<T> evidence$1,
ActorSystem system)
public static <T extends Actor> TestActorRef<T> apply(scala.Function0<T> factory,
java.lang.String name,
scala.reflect.ClassTag<T> evidence$2,
ActorSystem system)
public static <T extends Actor> TestActorRef<T> apply(Props props,
ActorSystem system)
public static <T extends Actor> TestActorRef<T> apply(Props props,
java.lang.String name,
ActorSystem system)
public static <T extends Actor> TestActorRef<T> apply(Props props,
ActorRef supervisor,
java.lang.String name,
ActorSystem system)
public static <T extends Actor> TestActorRef<T> apply(scala.reflect.ClassTag<T> t,
ActorSystem system)
public static <T extends Actor> TestActorRef<T> apply(java.lang.String name,
scala.reflect.ClassTag<T> t,
ActorSystem system)
public static <T extends Actor> TestActorRef<T> create(ActorSystem system,
Props props,
java.lang.String name)
system - (undocumented)props - (undocumented)name - (undocumented)
public static <T extends Actor> TestActorRef<T> create(ActorSystem system,
Props props)
system - (undocumented)props - (undocumented)
public Props props()
public MessageDispatcher dispatcher()
protected ActorCell newActorCell(ActorSystemImpl system,
InternalActorRef ref,
Props props,
MessageDispatcher dispatcher,
InternalActorRef supervisor)
newActorCell in class LocalActorRefpublic void receive(java.lang.Object o)
o - (undocumented)
public void receive(java.lang.Object o,
ActorRef sender)
o - (undocumented)sender - (undocumented)public T underlyingActor()
public ActorRef watch(ActorRef subject)
subject - (undocumented)
public ActorRef unwatch(ActorRef subject)
subject - (undocumented)
public java.lang.String toString()
toString in class ActorRef
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||