Examples of eventStream()


Examples of akka.actor.ActorSystem.eventStream()

    @Test
    public void mustSupportMdcNull() throws Exception {
        final ActorSystem system = ActorSystem.create("test-system", config);
        new LogJavaTestKit(system) {{
            system.eventStream().subscribe(getRef(), LogEvent.class);
            ActorRef ref = system.actorOf(Props.create(ActorWithMDC.class));

            ref.tell(new Log(InfoLevel(), "Null MDC"), system.deadLetters());
            expectLog(InfoLevel(), "Null MDC", "Map()");
        }};
View Full Code Here

Examples of akka.actor.ActorSystem.eventStream()

    @Test
    public void mustFormatMessage() {
        final ActorSystem system = ActorSystem.create("test-system", config);
        final LoggingAdapter log = Logging.getLogger(system, this);
        new LogJavaTestKit(system) {{
            system.eventStream().subscribe(getRef(), LogEvent.class);
            log.error("One arg message: {}", "the arg");
            expectLog(ErrorLevel(), "One arg message: the arg");

            Throwable cause = new IllegalStateException("This state is illegal");
            log.error(cause, "Two args message: {}, {}", "an arg", "another arg");
View Full Code Here

Examples of akka.actor.ActorSystem.eventStream()

    @Test
    public void mustCallMdcForEveryLog() throws Exception {
        final ActorSystem system = ActorSystem.create("test-system", config);
        new LogJavaTestKit(system) {{
            system.eventStream().subscribe(getRef(), LogEvent.class);
            ActorRef ref = system.actorOf(Props.create(ActorWithMDC.class));

            ref.tell(new Log(ErrorLevel(), "An Error"), system.deadLetters());
            expectLog(ErrorLevel(), "An Error", "Map(messageLength -> 8)");
            ref.tell(new Log(WarningLevel(), "A Warning"), system.deadLetters());
View Full Code Here

Examples of akka.actor.ActorSystem.eventStream()

  @Test
  public void subscribeToDeadLetters() {
    //#deadletters
    final ActorSystem system = ActorSystem.create("DeadLetters");
    final ActorRef actor = system.actorOf(Props.create(DeadLetterActor.class));
    system.eventStream().subscribe(actor, DeadLetter.class);
    //#deadletters
    JavaTestKit.shutdownActorSystem(system);
  }
 
  @Test
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.