akka.testkit
Class TestProbe

java.lang.Object
  extended by akka.testkit.TestKit
      extended by akka.testkit.TestProbe
All Implemented Interfaces:
TestKitBase

public class TestProbe
extends TestKit

TestKit-based probe which allows sending, reception and reply.


Constructor Summary
TestProbe(ActorSystem _application)
           
 
Method Summary
static TestProbe apply(ActorSystem system)
           
 void forward(ActorRef actor, java.lang.Object msg)
          Forward this message as if in the TestActor's receive method with self.forward.
 ActorRef ref()
          Shorthand to get the testActor.
 void reply(java.lang.Object msg)
          Send message to the sender of the last dequeued message.
 void send(ActorRef actor, java.lang.Object msg)
          Send message to an actor while using the probe's TestActor as the sender.
 ActorRef sender()
          Get sender of last received message.
 
Methods inherited from class akka.testkit.TestKit
awaitCond, dilated, now, system, testActorId
 
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
awaitCond, end, expectMsg_internal, expectMsg, expectMsg, expectMsgAllClassOf, expectMsgAllClassOf, expectMsgAllConformingOf, expectMsgAllConformingOf, expectMsgAllOf_internal, expectMsgAllOf, expectMsgAllOf, expectMsgAnyClassOf_internal, expectMsgAnyClassOf, expectMsgAnyClassOf, expectMsgAnyOf_internal, expectMsgAnyOf, expectMsgAnyOf, expectMsgClass_internal, expectMsgClass, expectMsgClass, expectMsgPF, expectMsgType, expectMsgType, expectNoMsg_internal, expectNoMsg, expectNoMsg, fishForMessage, format, ignoreMsg, ignoreNoMsg, internalExpectMsgAllClassOf, internalExpectMsgAllConformingOf, lastMessage, lastSender, lastWasNoMsg, msgAvailable, now, queue, receiveN_internal, receiveN, receiveN, receiveOne, receiveWhile, remaining, remainingOr, remainingOrDilated, setAutoPilot, testActor, testKitSettings, unwatch, watch, within, within
 

Constructor Detail

TestProbe

public TestProbe(ActorSystem _application)
Method Detail

apply

public static TestProbe apply(ActorSystem system)

ref

public ActorRef ref()
Shorthand to get the testActor.


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.


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.