/** * Shut down an actor system and wait for termination. * On failure debug output will be logged about the remaining actors in the system. * <p> * * If verifySystemShutdown is true, then an exception will be thrown on failure. */ public static void shutdownActorSystem(ActorSystem actorSystem, Duration duration, Boolean verifySystemShutdown) { boolean vss = verifySystemShutdown != null ? verifySystemShutdown : false; Duration dur = duration != null ? duration : FiniteDuration.create(10, TimeUnit.SECONDS); TestKit.shutdownActorSystem(actorSystem, dur, vss); }
@Test public void shouldSendMsgToDeadLetterWhenQueueIsFull() { final TestKit mockReceiver = new TestKit(actorSystem); actorSystem.eventStream().subscribe(mockReceiver.testActor(), DeadLetter.class); final FiniteDuration twentySeconds = new FiniteDuration(20, TimeUnit.SECONDS); ActorRef pingPongActor = actorSystem.actorOf(PingPongActor.props(lock).withMailbox(config.getMailBoxName()), "pingpongactor"); actorSystem.mailboxes().settings(); lock.lock(); try { //queue capacity = 10 //need to send 12 messages; 1 message is dequeued and actor waits on lock, //2nd to 11th messages are put on the queue //12th message is sent to dead letter. for (int i = 0; i < 12; i++) { pingPongActor.tell("ping", mockReceiver.testActor()); } mockReceiver.expectMsgClass(twentySeconds, DeadLetter.class); } finally { lock.unlock(); } mockReceiver.receiveN(11, twentySeconds); }
/** * Shut down an actor system and wait for termination. On failure debug output will be logged * about the remaining actors in the system. * * <p>If verifySystemShutdown is true, then an exception will be thrown on failure. */ public static void shutdownActorSystem( ActorSystem actorSystem, Duration duration, Boolean verifySystemShutdown) { boolean vss = verifySystemShutdown != null ? verifySystemShutdown : false; Duration dur = duration != null ? duration : FiniteDuration.create(10, TimeUnit.SECONDS); TestKit.shutdownActorSystem(actorSystem, dur, vss); }
/** * Shut down an actor system and wait for termination. On failure debug output will be logged * about the remaining actors in the system. * * <p>If verifySystemShutdown is true, then an exception will be thrown on failure. */ public static void shutdownActorSystem( ActorSystem actorSystem, Duration duration, Boolean verifySystemShutdown) { boolean vss = verifySystemShutdown != null ? verifySystemShutdown : false; Duration dur = duration != null ? duration : FiniteDuration.create(10, TimeUnit.SECONDS); TestKit.shutdownActorSystem(actorSystem, dur, vss); }
/** * Shut down an actor system and wait for termination. * On failure debug output will be logged about the remaining actors in the system. * <p> * * If verifySystemShutdown is true, then an exception will be thrown on failure. */ public static void shutdownActorSystem(ActorSystem actorSystem, Duration duration, Boolean verifySystemShutdown) { boolean vss = verifySystemShutdown != null ? verifySystemShutdown : false; Duration dur = duration != null ? duration : FiniteDuration.create(10, TimeUnit.SECONDS); TestKit.shutdownActorSystem(actorSystem, dur, vss); }
/** * Shut down an actor system and wait for termination. * On failure debug output will be logged about the remaining actors in the system. * <p> * * If verifySystemShutdown is true, then an exception will be thrown on failure. */ public static void shutdownActorSystem(ActorSystem actorSystem, Duration duration, Boolean verifySystemShutdown) { boolean vss = verifySystemShutdown != null ? verifySystemShutdown : false; Duration dur = duration != null ? duration : FiniteDuration.create(10, TimeUnit.SECONDS); TestKit.shutdownActorSystem(actorSystem, dur, vss); }
/** * Shut down an actor system and wait for termination. * On failure debug output will be logged about the remaining actors in the system. * <p> * * If verifySystemShutdown is true, then an exception will be thrown on failure. */ public static void shutdownActorSystem(ActorSystem actorSystem, Duration duration, Boolean verifySystemShutdown) { boolean vss = verifySystemShutdown != null ? verifySystemShutdown : false; Duration dur = duration != null ? duration : FiniteDuration.create(10, TimeUnit.SECONDS); TestKit.shutdownActorSystem(actorSystem, dur, vss); }
/** * Shut down an actor system and wait for termination. * On failure debug output will be logged about the remaining actors in the system. * <p> * * If verifySystemShutdown is true, then an exception will be thrown on failure. */ public static void shutdownActorSystem(ActorSystem actorSystem, Duration duration, Boolean verifySystemShutdown) { boolean vss = verifySystemShutdown != null ? verifySystemShutdown : false; Duration dur = duration != null ? duration : FiniteDuration.create(10, TimeUnit.SECONDS); TestKit.shutdownActorSystem(actorSystem, dur, vss); }
/** * Shut down an actor system and wait for termination. * On failure debug output will be logged about the remaining actors in the system. * <p> * * If verifySystemShutdown is true, then an exception will be thrown on failure. */ public static void shutdownActorSystem(ActorSystem actorSystem, Duration duration, Boolean verifySystemShutdown) { boolean vss = verifySystemShutdown != null ? verifySystemShutdown : false; Duration dur = duration != null ? duration : FiniteDuration.create(10, TimeUnit.SECONDS); TestKit.shutdownActorSystem(actorSystem, dur, vss); }
/** * Shut down an actor system and wait for termination. * On failure debug output will be logged about the remaining actors in the system. * <p> * * If verifySystemShutdown is true, then an exception will be thrown on failure. */ public static void shutdownActorSystem(ActorSystem actorSystem, Duration duration, Boolean verifySystemShutdown) { boolean vss = verifySystemShutdown != null ? verifySystemShutdown : false; Duration dur = duration != null ? duration : FiniteDuration.create(10, TimeUnit.SECONDS); TestKit.shutdownActorSystem(actorSystem, dur, vss); }