Package org.springside.modules.log

Examples of org.springside.modules.log.MockLog4jAppender


  private NotifyMessageProducer notifyMessageProducer;

  @Test
  public void queueMessage() {
    ThreadUtils.sleep(1000);
    MockLog4jAppender appender = new MockLog4jAppender();
    appender.addToLogger(NotifyMessageListener.class);

    User user = new User();
    user.setName("calvin");
    user.setEmail("calvin@sringside.org.cn");

    notifyMessageProducer.sendQueue(user);
    logger.info("sended message");

    ThreadUtils.sleep(1000);
    assertNotNull(appender.getFirstLog());
    assertEquals("UserName:calvin, Email:calvin@sringside.org.cn", appender.getFirstLog().getMessage());
  }
View Full Code Here


  }

  @Test
  public void topicMessage() {
    ThreadUtils.sleep(1000);
    MockLog4jAppender appender = new MockLog4jAppender();
    appender.addToLogger(NotifyMessageListener.class);

    User user = new User();
    user.setName("calvin");
    user.setEmail("calvin@sringside.org.cn");

    notifyMessageProducer.sendTopic(user);
    logger.info("sended message");

    ThreadUtils.sleep(1000);
    assertNotNull(appender.getFirstLog());
    assertEquals("UserName:calvin, Email:calvin@sringside.org.cn", appender.getFirstLog().getMessage());
  }
View Full Code Here

TOP

Related Classes of org.springside.modules.log.MockLog4jAppender

Copyright © 2018 www.massapicom. 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.