Package org.apache.hivemind

Examples of org.apache.hivemind.Messages


    }

    /** @since 3.1 */
    public void testComponentOverridesNamespace()
    {
        Messages messages = createMessages(MOCK1, new Locale("en", "US"));

        check(
                messages,
                "component-overrides-namespace",
                "MOCKPAGE1_BASE.component-overrides-namespace");
View Full Code Here


    }

    /** @since 3.1 */
    public void testLocalizedComponentOverridesLocalizedNamespace()
    {
        Messages messages = createMessages(MOCK1, new Locale("fr"));

        check(
                messages,
                "localized-component-overrides-namespace",
                "MOCKPAGE1_FR.localized-component-overrides-namespace");
View Full Code Here

                "MOCKPAGE1_FR.localized-component-overrides-namespace");
    }

    public void testMissingKey()
    {
        Messages messages = createMessages(MOCK1, new Locale("en", "GB"));

        check(messages, "non-existant-key", "[NON-EXISTANT-KEY]");
    }
View Full Code Here

        check(messages, "non-existant-key", "[NON-EXISTANT-KEY]");
    }

    public void testOverwrittenInLanguage()
    {
        Messages messages = createMessages(MOCK1, new Locale("en", "US"));

        check(messages, "overwritten-in-language", "LANGUAGE1_en");

        messages = createMessages(MOCK1, new Locale("fr", ""));
View Full Code Here

        check(messages, "overwritten-in-language", "LANGUAGE1_fr");
    }

    public void testOverwrittenInCountry()
    {
        Messages messages = createMessages(MOCK1, new Locale("en", "US"));

        check(messages, "overwritten-in-country", "COUNTRY1_en_US");

        messages = createMessages(MOCK1, new Locale("fr", "CD"));
View Full Code Here

        check(messages, "overwritten-in-country", "COUNTRY1_fr_CD");
    }

    public void testOverwrittenInVariant()
    {
        Messages messages = createMessages(MOCK1, new Locale("en", "US", "Tapestry"));

        check(messages, "overwritten-in-variant", "VARIANT1_en_US_Tapestry");

        messages = createMessages(MOCK1, new Locale("fr", "CD", "Foo"));
View Full Code Here

     * Foo.properties) doesn't exist.
     */

    public void testMissingBase()
    {
        Messages messages = createMessages(MOCK2, new Locale("en", "US"));

        check(messages, "language-key", "LANGUAGE1");
    }
View Full Code Here

     * but no country.
     */

    public void testMissingCountry()
    {
        Messages messages = createMessages(MOCK2, new Locale("en", "", "Tapestry"));

        check(messages, "overwritten-in-variant", "VARIANT1_en__Tapestry");
    }
View Full Code Here

        check(messages, "overwritten-in-variant", "VARIANT1_en__Tapestry");
    }

    public void testDateFormatting()
    {
        Messages messages = createMessages(MOCK1, Locale.ENGLISH);

        Calendar c = new GregorianCalendar(1966, Calendar.DECEMBER, 24);

        Date d = c.getTime();

        assertEquals("A formatted date: 12/24/66", messages.format("using-date-format", d));
    }
View Full Code Here

        assertEquals("A formatted date: 12/24/66", messages.format("using-date-format", d));
    }

    public void testDateFormatLocalization()
    {
        Messages messages = createMessages(MOCK1, Locale.FRENCH);

        Calendar c = new GregorianCalendar(1966, Calendar.DECEMBER, 24);

        Date d = c.getTime();

        // French formatting puts the day before the month.

        assertEquals("A formatted date: 24/12/66", messages.format("using-date-format", d));

    }
View Full Code Here

TOP

Related Classes of org.apache.hivemind.Messages

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.