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

Examples of org.apache.myfaces.extensions.cdi.message.api.MessageContext.config()


    public void newContextTest()
    {
        MessageContext newMessageContext = this.messageContext.cloneContext();

        this.messageContext.config().change().localeResolver(new TestGermanLocaleResolver());
        newMessageContext.config().change().localeResolver(new TestEnglishLocaleResolver());

        if (newMessageContext.equals(this.messageContext))
        {
            fail("different context expected - old context: " + this.messageContext.toString() + " new context: " + newMessageContext.toString());
        }
View Full Code Here


        {
            fail("different context expected - old context: " + this.messageContext.toString() + " new context: " + newMessageContext.toString());
        }

        assertEquals(Locale.GERMAN, this.messageContext.config().getLocaleResolver().getLocale());
        assertEquals(Locale.ENGLISH, newMessageContext.config().getLocaleResolver().getLocale());
    }

    @Test
    public void usedMessageResolverTest()
    {
View Full Code Here

        MessageContext messageContext = this.messageContext.cloneContext();
        messageContext.message().text("{hello}").create();

        this.messageContext.config().change().addMessageHandler(new TestInMemoryMessageHandler());

        assertFalse(messageContext.config().getMessageHandler().equals(this.messageContext.config().getMessageHandler()));
    }

    @Test
    public void customMessageContextTest()
    {
View Full Code Here

                    .addMessageHandler(new JsfAwareMessageHandler())
                .create();

        if (messageFactory != null)
        {
            return DefaultMessageContext.create(result.config(), messageFactory);
        }

        return result;
    }
View Full Code Here

    public void newContextTest()
    {
        MessageContext newMessageContext = this.messageContext.cloneContext();

        this.messageContext.config().change().localeResolver(new TestGermanLocaleResolver());
        newMessageContext.config().change().localeResolver(new TestEnglishLocaleResolver());

        if (newMessageContext.equals(this.messageContext))
        {
            fail("different context expected - old context: " + this.messageContext.toString() + " new context: " + newMessageContext.toString());
        }
View Full Code Here

        {
            fail("different context expected - old context: " + this.messageContext.toString() + " new context: " + newMessageContext.toString());
        }

        assertEquals(Locale.GERMAN, this.messageContext.config().getLocaleResolver().getLocale());
        assertEquals(Locale.ENGLISH, newMessageContext.config().getLocaleResolver().getLocale());
    }

    @Test
    public void usedMessageResolverTest()
    {
View Full Code Here

        MessageContext messageContext = this.messageContext.cloneContext();
        messageContext.message().text("{hello}").create();

        this.messageContext.config().change().addMessageHandler(new TestInMemoryMessageHandler());

        assertFalse(messageContext.config().getMessageHandler().equals(this.messageContext.config().getMessageHandler()));
    }

    @Test
    public void customMessageContextTest()
    {
View Full Code Here

                    .addMessageHandler(new JsfAwareMessageHandler())
                .create();

        if (messageFactory != null)
        {
            return DefaultMessageContext.create(result.config(), messageFactory);
        }

        return result;
    }
}
View Full Code Here

                    .addMessageHandler(new JsfAwareMessageHandler())
                .create();

        if (messageFactory != null)
        {
            return DefaultMessageContext.create(result.config(), messageFactory);
        }

        return result;
    }
}
View Full Code Here

                .addMessageHandler(new JsfAwareMessageHandler())
                .create();

        if (messageFactory != null)
        {
            return DefaultMessageContext.create(result.config(), messageFactory);
        }

        return result;
    }
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.