Examples of expectMsgClass()


Examples of akka.testkit.JavaTestKit.expectMsgClass()

      'lowpriority
    */
    //#prio-dispatcher

    probe.watch(myActor);
    probe.expectMsgClass(Terminated.class);
  }

  @Test
  public void controlAwareDispatcher() throws Exception {
    JavaTestKit probe = new JavaTestKit(system);
View Full Code Here

Examples of akka.testkit.JavaTestKit.expectMsgClass()

      'bar
    */
    //#control-aware-dispatcher

    probe.watch(myActor);
    probe.expectMsgClass(Terminated.class);
  }

  static
  //#prio-mailbox
  public class MyPrioMailbox extends UnboundedPriorityMailbox {
View Full Code Here

Examples of akka.testkit.TestProbe.expectMsgClass()

    TestProbe probe = new TestProbe(_system);
    probe.watch(workerActor);

    supervisor.tell(Long.parseLong("10"));

    probe.expectMsgClass(Terminated.class);
  }
}
View Full Code Here

Examples of akka.testkit.TestProbe.expectMsgClass()

    probe2.watch(workerActor2);

    supervisor.tell(Long.parseLong("10"));

    probe1.expectMsgClass(Terminated.class);
    probe2.expectMsgClass(Terminated.class);
  }
}
View Full Code Here

Examples of akka.testkit.TestProbe.expectMsgClass()

        new Props(SupervisorActor.class), _system);
    ActorRef workerActor = supervisor.underlyingActor().getWorker();
    TestProbe probe = new TestProbe(_system);
    probe.watch(workerActor);
    supervisor.tell("10");
    probe.expectMsgClass(Terminated.class);

    Thread.sleep(2000);
    // the actor should get restarted
    // lets send a new value and retrieve the same
    supervisor.tell(Integer.valueOf(10));
View Full Code Here

Examples of akka.testkit.TestProbe.expectMsgClass()

    buncher.tell(new SetTarget(probe.ref()), ActorRef.noSender());
    buncher.tell(new Queue(1), ActorRef.noSender());
    buncher.tell(new Queue(2), ActorRef.noSender());
    buncher.tell(flush, ActorRef.noSender());
    buncher.tell(new Queue(3), ActorRef.noSender());
    final Batch b = probe.expectMsgClass(Batch.class);
    assert b.objects.size() == 2;
    assert b.objects.contains(1);
    assert b.objects.contains(2);
  }
View Full Code Here

Examples of akka.testkit.TestProbe.expectMsgClass()

    //#stop
    final TestProbe probe = new TestProbe(system);
    probe.watch(child);
    child.tell(new IllegalArgumentException(), ActorRef.noSender());
    probe.expectMsgClass(Terminated.class);
    //#stop

    //#escalate-kill
    child = (ActorRef) Await.result(ask(supervisor,
      Props.create(Child.class), 5000), timeout);
View Full Code Here

Examples of akka.testkit.TestProbe.expectMsgClass()

    child = (ActorRef) Await.result(ask(supervisor,
      Props.create(Child.class), 5000), timeout);
    probe.watch(child);
    assert Await.result(ask(child, "get", 5000), timeout).equals(0);
    child.tell(new Exception(), ActorRef.noSender());
    probe.expectMsgClass(Terminated.class);
    //#escalate-kill

    //#escalate-restart
    superprops = Props.create(Supervisor2.class);
    supervisor = system.actorOf(superprops);
View Full Code Here

Examples of akka.testkit.TestProbe.expectMsgClass()

    //#stop
    final TestProbe probe = new TestProbe(system);
    probe.watch(child);
    child.tell(new IllegalArgumentException(), ActorRef.noSender());
    probe.expectMsgClass(Terminated.class);
    //#stop

    //#escalate-kill
    child = (ActorRef) Await.result(ask(supervisor,
      Props.create(Child.class), 5000), timeout);
View Full Code Here

Examples of akka.testkit.TestProbe.expectMsgClass()

    child = (ActorRef) Await.result(ask(supervisor,
      Props.create(Child.class), 5000), timeout);
    probe.watch(child);
    assert Await.result(ask(child, "get", 5000), timeout).equals(0);
    child.tell(new Exception(), ActorRef.noSender());
    probe.expectMsgClass(Terminated.class);
    //#escalate-kill

    //#escalate-restart
    superprops = Props.create(Supervisor2.class);
    supervisor = system.actorOf(superprops);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.