Package akka.testkit
Class TestProbe
- java.lang.Object
-
- akka.testkit.TestKit
-
- akka.testkit.TestProbe
-
- All Implemented Interfaces:
TestKitBase
public class TestProbe extends TestKit
TestKit-based probe which allows sending, reception and reply.
-
-
Constructor Summary
Constructors Constructor Description TestProbe(ActorSystem _application)TestProbe(ActorSystem _application, java.lang.String name)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static TestProbeapply(ActorSystem system)static TestProbeapply(java.lang.String name, ActorSystem system)voidforward(ActorRef actor, java.lang.Object msg)Forward this message as if in the TestActor's receive method with self.forward.java.lang.Objectforward$default$2()ActorRefref()Shorthand to get the testActor.voidreply(java.lang.Object msg)Send message to the sender of the last dequeued message.voidsend(ActorRef actor, java.lang.Object msg)Send message to an actor while using the probe's TestActor as the sender.ActorRefsender()Get sender of last received message.protected java.lang.StringtestActorName()Defines the testActor name.-
Methods inherited from class akka.testkit.TestKit
awaitCond, awaitCond$default$3, awaitCond$default$4, now, shutdownActorSystem, shutdownActorSystem$default$2, shutdownActorSystem$default$3, system, testActor
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface akka.testkit.TestKitBase
assertForDuration, assertForDuration$default$3, awaitAssert, awaitAssert$default$2, awaitAssert$default$3, awaitCond, awaitCond$default$2, awaitCond$default$3, awaitCond$default$4, checkMissingAndUnexpected, childActorOf, childActorOf, childActorOf, childActorOf, end_$eq, expectMsg, expectMsg, expectMsg, expectMsg_internal, expectMsg_internal$default$3, expectMsgAllClassOf, expectMsgAllClassOf, expectMsgAllConformingOf, expectMsgAllConformingOf, expectMsgAllOf, expectMsgAllOf, expectMsgAllOf_internal, expectMsgAnyClassOf, expectMsgAnyClassOf, expectMsgAnyClassOf_internal, expectMsgAnyOf, expectMsgAnyOf, expectMsgAnyOf_internal, expectMsgClass, expectMsgClass, expectMsgClass_internal, expectMsgPF, expectMsgPF$default$1, expectMsgPF$default$2, expectMsgType, expectMsgType, expectNoMessage, expectNoMessage, expectNoMsg_internal, expectTerminated, expectTerminated$default$2, fishForMessage, fishForMessage$default$1, fishForMessage$default$2, fishForSpecificMessage, fishForSpecificMessage$default$1, fishForSpecificMessage$default$2, format, ignoreMsg, ignoreNoMsg, internalExpectMsgAllClassOf, internalExpectMsgAllConformingOf, lastSender, lastWasNoMsg_$eq, msgAvailable, now, receiveN, receiveN, receiveN_internal, receiveOne, receiveWhile, receiveWhile$default$1, receiveWhile$default$2, receiveWhile$default$3, remaining, remainingOr, remainingOrDefault, remainingOrDilated, setAutoPilot, shutdown, shutdown$default$1, shutdown$default$2, shutdown$default$3, testKitSettings, unwatch, watch, within, within
-
-
-
-
Constructor Detail
-
TestProbe
public TestProbe(ActorSystem _application, java.lang.String name)
-
TestProbe
public TestProbe(ActorSystem _application)
-
-
Method Detail
-
apply
public static TestProbe apply(ActorSystem system)
-
apply
public static TestProbe apply(java.lang.String name, ActorSystem system)
-
ref
public ActorRef ref()
Shorthand to get the testActor.
-
testActorName
protected java.lang.String testActorName()
Description copied from interface:TestKitBaseDefines the testActor name.
-
send
public void send(ActorRef actor, java.lang.Object msg)
Send message to an actor while using the probe's TestActor as the sender. Replies will be available for inspection with all of TestKit's assertion methods.
-
forward
public void forward(ActorRef actor, java.lang.Object msg)
Forward this message as if in the TestActor's receive method with self.forward.
-
forward$default$2
public java.lang.Object forward$default$2()
-
sender
public ActorRef sender()
Get sender of last received message.
-
reply
public void reply(java.lang.Object msg)
Send message to the sender of the last dequeued message.
-
-