Package br.gov.frameworkdemoiselle.context

Examples of br.gov.frameworkdemoiselle.context.RequestContext.activate()


  @Test
  @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);
View Full Code Here


  @Test
  @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);
View Full Code Here

  @Test
  @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);
View Full Code Here

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

    context.activate();
    DummyMessageAppender appender = Beans.getReference(DummyMessageAppender.class);

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

  @Test
  @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"));
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

  @Before
  public void initialize() {

    RequestContext ctx = Beans.getReference(RequestContext.class);
    ctx.activate();
   
    this.crudImpl.resetEntities();

  }
View Full Code Here

  }

  @Before
  public void activeContext() {
    RequestContext ctx = Beans.getReference(RequestContext.class);
    ctx.activate();
  }

  @After
  public void deactiveContext() {
    RequestContext ctx = Beans.getReference(RequestContext.class);
View Full Code Here

    RequestContext requestContext = Beans.getReference(RequestContext.class);
    SessionContext sessionContext = Beans.getReference(SessionContext.class);
    ViewContext viewContext = Beans.getReference(ViewContext.class);
    ConversationContext conversationContext = Beans.getReference(ConversationContext.class);
   
    requestContext.activate();
    sessionContext.activate();
    viewContext.activate();
    conversationContext.activate();
  }
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.