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

Examples of org.apache.myfaces.extensions.cdi.message.impl.DefaultMessage


        Date arg2 = new Date();
        String text = "#1: {arg1} and #2: {arg2}";
        Message message1 = this.messageContext.message().text(text)
                .namedArgument("arg1", arg1).namedArgument("arg2", arg2).create();

        Message message2 = new DefaultMessage(text)
                .addArgument(NamedArguments.add("arg1", arg1).add("arg2", arg2).create());
        ((MessageContextConfigAware)message2).setMessageContextConfig(this.messageContext.config());

        assertEquals(message1, message2);
        assertEquals(message1.toString(), message2.toString());
View Full Code Here


                .namedArgument("arg1", arg1).namedArgument("arg2", arg2).create();

        Map<String, Serializable> arguments = new HashMap<String, Serializable>();
        arguments.put("arg1", arg1);
        arguments.put("arg2", arg2);
        Message message2 = new DefaultMessage(text).addArgument(NamedArguments.convert(arguments));
        ((MessageContextConfigAware)message2).setMessageContextConfig(this.messageContext.config());

        assertEquals(message1, message2);
        assertEquals(message1.toString(), message2.toString());
        assertEquals(message1.toString(this.messageContext), message2.toString(this.messageContext));
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

        checkDefaultHelloMessage(message.toString());
    }

    private Message manuallyCreateDefaultMessage()
    {
        return new DefaultMessage("{hello}").setMessageContextConfig(this.messageContext.config());
    }
View Full Code Here

        Date arg2 = new Date();
        String text = "#1: {arg1} and #2: {arg2}";
        Message message1 = this.messageContext.message().text(text)
                .namedArgument("arg1", arg1).namedArgument("arg2", arg2).create();

        Message message2 = new DefaultMessage(text, NamedArguments.add("arg1", arg1).add("arg2", arg2).create());
        ((MessageContextConfigAware)message2).setMessageContextConfig(this.messageContext.config());

        assertEquals(message1, message2);
        assertEquals(message1.toString(), message2.toString());
        assertEquals(message1.toString(this.messageContext), message2.toString(this.messageContext));
    }
View Full Code Here

                .namedArgument("arg1", arg1).namedArgument("arg2", arg2).create();

        Map<String, Serializable> arguments = new HashMap<String, Serializable>();
        arguments.put("arg1", arg1);
        arguments.put("arg2", arg2);
        Message message2 = new DefaultMessage(text, NamedArguments.convert(arguments));
        ((MessageContextConfigAware)message2).setMessageContextConfig(this.messageContext.config());

        assertEquals(message1, message2);
        assertEquals(message1.toString(), message2.toString());
        assertEquals(message1.toString(this.messageContext), message2.toString(this.messageContext));
    }
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

        checkDefaultHelloMessage(message.toString());
    }

    private Message manuallyCreateDefaultMessage()
    {
        return new DefaultMessage("{hello}").setMessageContextConfig(this.messageContext.config());
    }
View Full Code Here

TOP

Related Classes of org.apache.myfaces.extensions.cdi.message.impl.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.