Package org.apache.hivemind

Examples of org.apache.hivemind.Messages


public class TestRegistryImpl extends HiveMindTestCase
{
    public void testGetModuleMessages() throws Exception
    {
        final Registry reg = buildFrameworkRegistry(new SimpleModule());
        final Messages msgs = reg.getModuleMessages( "hivemind.test.services" );
        assertEquals( "Test Message", msgs.getMessage( "test.message" ) );
    }
View Full Code Here


    {
        ServiceImplementationFactoryParameters fp = newParameters();
        Module module = newModule();
        ErrorHandler eh = newErrorHandler();
        Log log = newLog();
        Messages messages = newMessages();
        ErrorLog errorLog = newErrorLog();

        // Normally I try and get all the invocations into chronological
        // order ... but with this refactoring, that's painful; these
        // are in an order that appeases junit.
View Full Code Here

        MockControl logc = newControl(Log.class);
        Log log = (Log) logc.getMock();

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

        ErrorLog errorLog = (ErrorLog) newMock(ErrorLog.class);

        // Normally I try and get all the invocations into chronological
        // order ... but with this refactoring, that's painful; these
View Full Code Here

        MockControl logc = newControl(Log.class);
        Log log = (Log) logc.getMock();

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

        ErrorLog errorLog = (ErrorLog) newMock(ErrorLog.class);

        // Normally I try and get all the invocations into chronological
        // order ... but with this refactoring, that's painful; these
View Full Code Here

public class TestRegistryImpl extends HiveMindTestCase
{
    public void testGetModuleMessages() throws Exception
    {
        final Registry reg = buildFrameworkRegistry( "Privates.xml" );
        final Messages msgs = reg.getModuleMessages( "hivemind.test.privates" );
        assertEquals( "Test Message", msgs.getMessage( "test.message" ) );
    }
View Full Code Here

        return new MessagesImpl(l, locale);
    }

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

        assertEquals("Some Damn Thing", m.getMessage("inner-message"));
        assertEquals("[MISSING-MESSAGE]", m.getMessage("missing-message"));
        assertEquals(
            "Default for missing.",
            m.getMessage("missing-message", "Default for missing."));
    }
View Full Code Here

            m.getMessage("missing-message", "Default for missing."));
    }

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

        assertEquals("[MISSING-MESSAGE]", m.getMessage("missing-message"));

    }
View Full Code Here

    }

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

        assertEquals(
            "Default for missing.",
            m.getMessage("missing-message", "Default for missing."));
    }
View Full Code Here

            m.getMessage("missing-message", "Default for missing."));
    }

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

        assertEquals("Une Certaine Fichue Chose", m.getMessage("inner-message"));
    }
View Full Code Here

        assertEquals("Une Certaine Fichue Chose", m.getMessage("inner-message"));
    }

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

        assertEquals("[fred]", m.format("one-arg", "fred"));
    }
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.