Package br.gov.frameworkdemoiselle.message

Examples of br.gov.frameworkdemoiselle.message.DefaultMessage


  @Deprecated
  public void testAddMessageWithoutParams() {
    RequestContext context = Beans.getReference(RequestContext.class);

    context.activate();
    Message message = new DefaultMessage("Menssage without param");
    DummyMessageAppender appender = Beans.getReference(DummyMessageAppender.class);

    messageContext.add(message);
    assertEquals(appender.getMessages().size(), 1);
    context.deactivate();
View Full Code Here


  @Deprecated
  public void testAddMessageWithoutParamsIfSeverityIsInfo() {
    RequestContext context = Beans.getReference(RequestContext.class);

    context.activate();
    Message message = new DefaultMessage("Menssage without param");
    DummyMessageAppender appender = Beans.getReference(DummyMessageAppender.class);

    messageContext.add(message);
    assertEquals(appender.getMessages().get(0).getSeverity(), SeverityType.INFO);
    context.deactivate();
View Full Code Here

  @Deprecated
  public void testAddMessageWitSeverityInfo() {
    RequestContext context = Beans.getReference(RequestContext.class);

    context.activate();
    Message message = new DefaultMessage("Menssage without param", SeverityType.INFO);
    DummyMessageAppender appender = Beans.getReference(DummyMessageAppender.class);

    messageContext.add(message);
    assertEquals(appender.getMessages().get(0).getSeverity(), SeverityType.INFO);
    context.deactivate();
View Full Code Here

  @Deprecated
  public void testAddMessageWitSeverityWarn() {
    RequestContext context = Beans.getReference(RequestContext.class);

    context.activate();
    Message message = new DefaultMessage("Menssage without param", SeverityType.WARN);
    DummyMessageAppender appender = Beans.getReference(DummyMessageAppender.class);

    messageContext.add(message);
    assertEquals(appender.getMessages().get(0).getSeverity(), SeverityType.WARN);
    context.deactivate();
View Full Code Here

  @Deprecated
  public void testAddMessageWitSeverityErro() {
    RequestContext context = Beans.getReference(RequestContext.class);

    context.activate();
    Message message = new DefaultMessage("Menssage without param", SeverityType.ERROR);
    DummyMessageAppender appender = Beans.getReference(DummyMessageAppender.class);

    messageContext.add(message);
    assertEquals(appender.getMessages().get(0).getSeverity(), SeverityType.ERROR);
    context.deactivate();
View Full Code Here

  @Deprecated
  public void testRecoverMessageWithParams() {
    RequestContext context = Beans.getReference(RequestContext.class);

    context.activate();
    Message message = new DefaultMessage("Message with {0} param");
    DummyMessageAppender appender = Beans.getReference(DummyMessageAppender.class);

    messageContext.add(message, 1);
    assertTrue(appender.getMessages().get(0).getText().equals("Message with 1 param"));
    context.deactivate();
View Full Code Here

  @Test
  public void testMessageParsedText() {
    RequestContext context = Beans.getReference(RequestContext.class);

    context.activate();
    Message MESSAGE_PARSED = new DefaultMessage("{MESSAGE_PARSED}");
    String expected = "Message parsed";
    String value = MESSAGE_PARSED.getText();
    Assert.assertEquals(expected, value);
    context.deactivate();
  }
View Full Code Here

  @Test
  public void testMessageIsNull() {
    RequestContext context = Beans.getReference(RequestContext.class);

    context.activate();
    Message NULL_MESSAGE = new DefaultMessage(null);
    String expected = null;
    String value = NULL_MESSAGE.getText();
    Assert.assertEquals(expected, value);
    context.deactivate();
  }
View Full Code Here

TOP

Related Classes of br.gov.frameworkdemoiselle.message.DefaultMessage

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.