Package org.apache.hivemind

Examples of org.apache.hivemind.Messages


        assertEquals("[fred]", m.format("one-arg", "fred"));
    }

    public void testTwoArg() throws Exception
    {
        Messages m = read("config/Localized.xml", Locale.ENGLISH);

        assertEquals("[abbot, costello]", m.format("two-arg", "abbot", "costello"));
    }
View Full Code Here


        assertEquals("[abbot, costello]", m.format("two-arg", "abbot", "costello"));
    }

    public void testThreeArg() throws Exception
    {
        Messages m = read("config/Localized.xml", Locale.ENGLISH);

        assertEquals("[moe, larry, curly]", m.format("three-arg", "moe", "larry", "curly"));
    }
View Full Code Here

        assertEquals("[moe, larry, curly]", m.format("three-arg", "moe", "larry", "curly"));
    }

    public void testFourArg() throws Exception
    {
        Messages m = read("config/Localized.xml", Locale.ENGLISH);

        assertEquals(
            "[alpha, bravo, delta, gamma]",
            m.format("four-arg", new String[] { "alpha", "bravo", "delta", "gamma" }));

    }
View Full Code Here

        ErrorHandler eh = new DefaultErrorHandler();
        ClassResolver cr = new DefaultClassResolver();

        MockControl messagesControl = newControl(Messages.class);
        Messages messages = (Messages) messagesControl.getMock();

        module.getErrorHandler();
        c.setReturnValue(eh);

        module.getClassResolver();
View Full Code Here

        verifyControls();
    }

    public void testMessagesProperty()
    {
        Messages messages = (Messages) newMock(Messages.class);

        replayControls();

        Creator c = new Creator();
View Full Code Here

    }

    public void testGetObject()
    {
        MockControl mc = newControl(Messages.class);
        Messages m = (Messages) mc.getMock();

        MockControl control = newControl(IComponent.class);
        IComponent component = (IComponent) control.getMock();

        ValueConverter vc = newValueConverter();

        component.getMessages();
        control.setReturnValue(m);

        m.getMessage("key");
        mc.setReturnValue("value");

        replayControls();
        MessageBinding b = new MessageBinding("param", vc, fabricateLocation(12), component, "key");
View Full Code Here

        return source.getMessages(page);
    }

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

        check(messages, "only-in-base", "BASE1");
    }
View Full Code Here

    }

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

        check(messages, "only-in-namespace", "LIBRARY_BASE.only-in-namespace");
    }
View Full Code Here

    }

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

        check(messages, "localized-in-namespace", "LIBRARY_FR.localized-in-namespace");
    }
View Full Code Here

    }

    /** @since 4.0 */
    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

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.