akka.testkit

TestActorRef

class TestActorRef[T <: Actor] extends LocalActorRef

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.

Since

1.1

Linear Supertypes
LocalActorRef, LocalRef, ActorRefScope, ActorRefWithCell, InternalActorRef, ScalaActorRef, ActorRef, Serializable, Serializable, Comparable[ActorRef], AnyRef, Any
Known Subclasses
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. TestActorRef
  2. LocalActorRef
  3. LocalRef
  4. ActorRefScope
  5. ActorRefWithCell
  6. InternalActorRef
  7. ScalaActorRef
  8. ActorRef
  9. Serializable
  10. Serializable
  11. Comparable
  12. AnyRef
  13. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Instance Constructors

  1. new TestActorRef(_system: ActorSystemImpl, _prerequisites: DispatcherPrerequisites, _props: Props, _supervisor: InternalActorRef, name: String)

Value Members

  1. def !(message: Any)(implicit sender: ActorRef): Unit

    Definition Classes
    LocalActorRef → ScalaActorRef
  2. final def !=(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  3. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  4. final def ##(): Int

    Definition Classes
    AnyRef → Any
  5. final def ==(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  6. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  7. def actorContext: ActorContext

    Attributes
    protected
    Definition Classes
    LocalActorRef
  8. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  9. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  10. final def compareTo(other: ActorRef): Int

    Definition Classes
    ActorRef → Comparable
  11. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  12. final def equals(that: Any): Boolean

    Definition Classes
    ActorRef → AnyRef → Any
  13. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  14. def forward(message: Any)(implicit context: ActorContext): Unit

    Definition Classes
    ActorRef
  15. def getChild(names: Iterator[String]): InternalActorRef

    Definition Classes
    LocalActorRef → InternalActorRef
  16. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  17. def getParent: InternalActorRef

    Definition Classes
    LocalActorRef → InternalActorRef
  18. def getSingleChild(name: String): InternalActorRef

    Attributes
    protected
    Definition Classes
    LocalActorRef
  19. final def hashCode(): Int

    Definition Classes
    ActorRef → AnyRef → Any
  20. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  21. final def isLocal: Boolean

    Definition Classes
    LocalRef → ActorRefScope
  22. def isTerminated: Boolean

    Definition Classes
    LocalActorRef → ActorRef
  23. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  24. def newActorCell(system: ActorSystemImpl, ref: InternalActorRef, props: Props, supervisor: InternalActorRef): ActorCell

    Definition Classes
    TestActorRef → LocalActorRef
  25. final def notify(): Unit

    Definition Classes
    AnyRef
  26. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  27. val path: ActorPath

    Definition Classes
    LocalActorRef → ActorRef
  28. def provider: ActorRefProvider

    Definition Classes
    LocalActorRef → InternalActorRef
  29. def receive(o: Any, sender: ActorRef): Unit

    Directly inject messages into actor receive behavior.

    Directly inject messages into actor receive behavior. Any exceptions thrown will be available to you, while still being able to use become/unbecome.

  30. def receive(o: Any): Unit

    Directly inject messages into actor receive behavior.

    Directly inject messages into actor receive behavior. Any exceptions thrown will be available to you, while still being able to use become/unbecome.

  31. def restart(cause: Throwable): Unit

    Definition Classes
    LocalActorRef → InternalActorRef
  32. def resume(causedByFailure: Throwable): Unit

    Definition Classes
    LocalActorRef → InternalActorRef
  33. def sendSystemMessage(message: SystemMessage): Unit

    Definition Classes
    LocalActorRef → InternalActorRef
  34. def start(): Unit

    Definition Classes
    LocalActorRef → InternalActorRef
  35. def stop(): Unit

    Definition Classes
    LocalActorRef → InternalActorRef
  36. def suspend(): Unit

    Definition Classes
    LocalActorRef → InternalActorRef
  37. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  38. final def tell(msg: Any, sender: ActorRef): Unit

    Definition Classes
    ActorRef
  39. def toString(): String

    Definition Classes
    TestActorRef → ActorRef → AnyRef → Any
  40. def underlying: ActorCell

    Definition Classes
    LocalActorRef → ActorRefWithCell
  41. def underlyingActor: T

    Retrieve reference to the underlying actor, where the static type matches the factory used inside the constructor.

    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 reference be linked to a supervisor). The old Actor may of course still be used in post-mortem assertions.

  42. def unwatch(subject: ActorRef): ActorRef

    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.

    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.

    returns

    the same ActorRef that is provided to it, to allow for cleaner invocations

  43. final def wait(): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws()
  44. final def wait(arg0: Long, arg1: Int): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws()
  45. final def wait(arg0: Long): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws()
  46. def watch(subject: ActorRef): ActorRef

    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.

    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.

    returns

    the same ActorRef that is provided to it, to allow for cleaner invocations

  47. def writeReplace(): AnyRef

    Attributes
    protected
    Definition Classes
    LocalActorRef
    Annotations
    @throws()

Deprecated Value Members

  1. final def tell(msg: Any): Unit

    Definition Classes
    ActorRef
    Annotations
    @deprecated
    Deprecated

    (Since version 2.1) use the two-arg variant (typically getSelf() as second arg)

Inherited from LocalActorRef

Inherited from LocalRef

Inherited from ActorRefScope

Inherited from ActorRefWithCell

Inherited from InternalActorRef

Inherited from ScalaActorRef

Inherited from ActorRef

Inherited from Serializable

Inherited from Serializable

Inherited from Comparable[ActorRef]

Inherited from AnyRef

Inherited from Any

Ungrouped