This is a specialized form of the TestActorRef with support for querying and setting the state of a FSM. Use a LoggingFSM with this class if you also need to inspect event traces.
val fsm = TestFSMRef(new Actor with LoggingFSM[Int, Null] {
override def logDepth = 12
startWith(1, null)
when(1) {
case Event("hello", _) => goto(2)
}
when(2) {
case Event("world", _) => goto(1)
}
})
assert (fsm.stateName == 1)
fsm ! "hallo"
assert (fsm.stateName == 2)
assert (fsm.underlyingActor.getLog == IndexedSeq(FSMLogEntry(1, null, "hallo")))
Attributes
- Since
-
1.2
- Companion
- object
- Source
- TestFSMRef.scala
- Graph
-
- Supertypes
-
class TestActorRef[T]trait ScalaActorRefclass ActorReftrait Serializabletrait Comparable[ActorRef]class Objecttrait Matchableclass AnyShow all
Members list
Value members
Concrete methods
Proxy for pekko.actor.FSM#cancelTimer.
Proxy for pekko.actor.FSM#isStateTimerActive.
Proxy for pekko.actor.FSM#isStateTimerActive.
Change FSM state; any value left out defaults to the current FSM state (timeout defaults to None). This method is directly equivalent to a corresponding transition initiated from within the FSM, including timeout and stop handling.
Change FSM state; any value left out defaults to the current FSM state (timeout defaults to None). This method is directly equivalent to a corresponding transition initiated from within the FSM, including timeout and stop handling.
Attributes
- Source
- TestFSMRef.scala
Proxy for pekko.actor.FSM#startSingleTimer.
Proxy for pekko.actor.FSM#startTimerAtFixedRate.
Proxy for pekko.actor.FSM#startTimerWithFixedDelay.
Get current state data of this FSM.
Get current state name of this FSM.
Deprecated methods
Proxy for pekko.actor.FSM#setTimer.
Proxy for pekko.actor.FSM#setTimer.
Attributes
- Deprecated
-
[Since version Akka 2.6.0] - Source
- TestFSMRef.scala
Inherited methods
Sends a one-way asynchronous message. E.g. fire-and-forget semantics.
Sends a one-way asynchronous message. E.g. fire-and-forget semantics.
If invoked from within an actor then the actor reference is implicitly passed on as the implicit 'sender' argument.
This actor 'sender' reference is then available in the receiving actor in the 'sender()' member variable, if invoked from within an Actor. If not then no sender is available.
actor ! message
Attributes
- Definition Classes
- Inherited from:
- LocalActorRef (hidden)
- Source
- ActorRef.scala
Attributes
- Inherited from:
- LocalActorRef (hidden)
- Source
- ActorRef.scala
Comparison takes path and the unique id of the actor cell into account.
Comparison takes path and the unique id of the actor cell into account.
Attributes
- Inherited from:
- ActorRef
- Source
- ActorRef.scala
Equals takes path and the unique id of the actor cell into account.
Equals takes path and the unique id of the actor cell into account.
Attributes
- Definition Classes
-
ActorRef -> Any
- Inherited from:
- ActorRef
- Source
- ActorRef.scala
Forwards the message and passes the original sender actor as the sender.
Forwards the message and passes the original sender actor as the sender.
Works, no matter whether originally sent with tell/'!' or ask/'?'.
Attributes
- Inherited from:
- ActorRef
- Source
- ActorRef.scala
Obtain ActorRef by possibly traversing the actor tree or looking it up at some provider-specific location. This method shall return the end result, i.e. not only the next step in the look-up; this will typically involve recursive invocation. A path element of ".." signifies the parent, a trailing "" element must be disregarded. If the requested path does not exist, return Nobody.
Obtain ActorRef by possibly traversing the actor tree or looking it up at some provider-specific location. This method shall return the end result, i.e. not only the next step in the look-up; this will typically involve recursive invocation. A path element of ".." signifies the parent, a trailing "" element must be disregarded. If the requested path does not exist, return Nobody.
Attributes
Obtain parent of this ref; used by getChild for ".." paths.
Obtain parent of this ref; used by getChild for ".." paths.
Attributes
- Definition Classes
- Inherited from:
- LocalActorRef (hidden)
- Source
- ActorRef.scala
Method for looking up a single child beneath this actor. Override in order to inject “synthetic” actor paths like “/temp”. It is racy if called from the outside.
Method for looking up a single child beneath this actor. Override in order to inject “synthetic” actor paths like “/temp”. It is racy if called from the outside.
Attributes
- Inherited from:
- LocalActorRef (hidden)
- Source
- ActorRef.scala
Calculate a hash code value for the object.
Calculate a hash code value for the object.
The default hashing algorithm is platform dependent.
Note that it is allowed for two objects to have identical hash codes (o1.hashCode.equals(o2.hashCode)) yet not be equal (o1.equals(o2) returns false). A degenerate implementation could always return 0. However, it is required that if two objects are equal (o1.equals(o2) returns true) that they have identical hash codes (o1.hashCode.equals(o2.hashCode)). Therefore, when overriding this method, be sure to verify that the behavior is consistent with the equals method.
Attributes
- Returns
-
the hash code value for this object.
- Definition Classes
-
ActorRef -> Any
- Inherited from:
- ActorRef
- Source
- ActorRef.scala
Attributes
- Inherited from:
- LocalRef (hidden)
- Source
- ActorRef.scala
Get a reference to the actor ref provider which created this ref.
Get a reference to the actor ref provider which created this ref.
Attributes
- Definition Classes
- Inherited from:
- LocalActorRef (hidden)
- Source
- ActorRef.scala
Directly inject messages into actor receive behavior. Any exceptions thrown will be available to you, while still being able to use become/unbecome.
Directly inject messages into actor receive behavior. Any exceptions thrown will be available to you, while still being able to use become/unbecome.
Attributes
- Inherited from:
- TestActorRef
- Source
- TestActorRef.scala
Directly inject messages into actor receive behavior. Any exceptions thrown will be available to you, while still being able to use become/unbecome.
Directly inject messages into actor receive behavior. Any exceptions thrown will be available to you, while still being able to use become/unbecome.
Attributes
- Inherited from:
- TestActorRef
- Source
- TestActorRef.scala
Attributes
- Definition Classes
- Inherited from:
- LocalActorRef (hidden)
- Source
- ActorRef.scala
Resumes a suspended actor.
Resumes a suspended actor.
Attributes
- Definition Classes
- Inherited from:
- LocalActorRef (hidden)
- Source
- ActorRef.scala
Attributes
- Definition Classes
- Inherited from:
- LocalActorRef (hidden)
- Source
- ActorRef.scala
Starts the actor after initialization.
Starts the actor after initialization.
Attributes
- Definition Classes
- Inherited from:
- LocalActorRef (hidden)
- Source
- ActorRef.scala
Shuts down the actor and its message queue
Shuts down the actor and its message queue
Attributes
- Definition Classes
- Inherited from:
- LocalActorRef (hidden)
- Source
- ActorRef.scala
Suspends the actor so that it will not process messages until resumed. The suspend request is processed asynchronously to the caller of this method as well as to normal message sends: the only ordering guarantee is that message sends done from the same thread after calling this method will not be processed until resumed.
Suspends the actor so that it will not process messages until resumed. The suspend request is processed asynchronously to the caller of this method as well as to normal message sends: the only ordering guarantee is that message sends done from the same thread after calling this method will not be processed until resumed.
Attributes
- Definition Classes
- Inherited from:
- LocalActorRef (hidden)
- Source
- ActorRef.scala
Sends the specified message to this ActorRef, i.e. fire-and-forget semantics, including the sender reference if possible.
Sends the specified message to this ActorRef, i.e. fire-and-forget semantics, including the sender reference if possible.
Pass pekko.actor.ActorRef noSender or null as sender if there is nobody to reply to
Attributes
- Inherited from:
- ActorRef
- Source
- ActorRef.scala
Returns a string representation of the object.
Returns a string representation of the object.
The default representation is platform dependent.
Attributes
- Returns
-
a string representation of the object.
- Definition Classes
- Inherited from:
- TestActorRef
- Source
- TestActorRef.scala
Attributes
- Inherited from:
- LocalActorRef (hidden)
- Source
- ActorRef.scala
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.
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.
Attributes
- Inherited from:
- TestActorRef
- Source
- TestActorRef.scala
Unregisters 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.
Unregisters 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.
Attributes
- Returns
-
the same ActorRef that is provided to it, to allow for cleaner invocations
- Inherited from:
- TestActorRef
- Source
- TestActorRef.scala
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.
Attributes
- Returns
-
the same ActorRef that is provided to it, to allow for cleaner invocations
- Inherited from:
- TestActorRef
- Source
- TestActorRef.scala
Inherited fields
Attributes
- Inherited from:
- TestActorRef
- Source
- TestActorRef.scala
Returns the path for this actor (from this actor up to the root actor).
Returns the path for this actor (from this actor up to the root actor).
Attributes
- Inherited from:
- LocalActorRef (hidden)
- Source
- ActorRef.scala