Package org.apache.myfaces.extensions.cdi.message.api

Examples of org.apache.myfaces.extensions.cdi.message.api.Message


    {
        this.messageContext.config().change().addMessageHandler(new TestInternalMessageAwareMessageHandler());

        this.messageContext.message().text("test msg 1").add();

        Message internalMessage = new DefaultInternalMessage("test msg 2").setMessageContextConfig(this.messageContext.config());
        this.messageContext.addMessage(internalMessage);

        assertEquals(1, this.messageContext.getMessages().size());
        assertEquals(this.messageContext.message().text("test msg 1").create(),
                this.messageContext.getMessages().iterator().next());
View Full Code Here


        TestPayloadAwareMessageResolver testResolver = new TestPayloadAwareMessageResolver();
        this.messageContext.config().change().messageResolver(testResolver);

        assertFalse(testResolver.isPayloadAvailable());

        Message message = this.messageContext.message().text("test msg").payload(MessageSeverity.WARN).create();
        message.toString(this.messageContext);

        assertTrue(testResolver.isPayloadAvailable());
    }
View Full Code Here

public class SimpleMessageTest extends AbstractMessageContextAwareTest
{
    @Test
    public void createInlineMessageTest()
    {
        Message message = this.messageContext.message().text("hello open message").create();

        assertEquals("hello open message", message.toString(this.messageContext));
    }
View Full Code Here

    }

    @Test
    public void createInlineMessageViaMessageBuilderTest()
    {
        Message message = SimpleMessageBuilder.message().text("hello open message").create();

        assertEquals("hello open message", message.toString(this.messageContext));
    }
View Full Code Here

    }

    @Test
    public void createInlineMessageViaCustomMessageBuilderTest()
    {
        Message message = TestMessageBuilder.message().text("hello open message").create();

        assertEquals("hello open message", message.toString(this.messageContext));
    }
View Full Code Here

    }

    @Test
    public void resolveMessageTest()
    {
        Message message = this.messageContext.message().text("{hello}").create();

        checkDefaultHelloMessage(message.toString(this.messageContext));
    }
View Full Code Here

    }

    @Test
    public void resolveMessageTextTest()
    {
        Message message = this.messageContext.message().text("{hello}").create();

        @SuppressWarnings({"deprecation"})
        String messageText = message.toString(this.messageContext);

        checkDefaultHelloMessage(messageText);
    }
View Full Code Here

    }

    @Test
    public void directMessage2TextResolvingTest()
    {
        Message message = new DefaultMessage("inline message");

        assertEquals("inline message", message.toString());
    }
View Full Code Here

    }

    @Test
    public void manuallyCreateInlineMessageTest()
    {
        Message message = new DefaultMessage("inline message");

        assertEquals("inline message", message.toString(this.messageContext));
    }
View Full Code Here

    }

    @Test
    public void manuallyCreateMessageWithConfigTest()
    {
        Message message = manuallyCreateDefaultMessage();
        checkDefaultHelloMessage(message.toString());
    }
View Full Code Here

TOP

Related Classes of org.apache.myfaces.extensions.cdi.message.api.Message

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.