Package org.apache.hivemind

Examples of org.apache.hivemind.Registry


    }

    public void testBuilderAccess() throws Exception
    {
        Registry r = buildFrameworkRegistry("BuilderAccess.xml");

        BuilderAccess s =
            (BuilderAccess) r.getService(
                "hivemind.test.services.BuilderAccess",
                BuilderAccess.class);

        assertEquals("A successful test of BuilderFactory.", s.getLocalizedMessage("success"));
View Full Code Here


        assertLoggedMessage("This is a test.");
    }

    public void testBuilderAccessFailure() throws Exception
    {
        Registry r = buildFrameworkRegistry("BuilderAccessFailure.xml");

        // interceptLogging("hivemind.test.services.BuilderAccessFailure");

        BuilderAccess s =
            (BuilderAccess) r.getService(
                "hivemind.test.services.BuilderAccessFailure",
                BuilderAccess.class);

        assertNotNull(s);
View Full Code Here

        }
    }

    public void testConstructorFactory() throws Exception
    {
        Registry r = buildFrameworkRegistry("ConstructorFactory.xml");

        interceptLogging("hivemind");

        String[] servicesToTest =
            {
                "DefaultConstructor",
                "LongConstructor",
                "MultiConstructor",
                "ConfigurationConstructor",
                "LogAndMessagesConstructor" };

        for (int i = 0; i < servicesToTest.length; i++)
        {
            ConstructorAccess s =
                (ConstructorAccess) r.getService(
                    "hivemind.test.services." + servicesToTest[i],
                    ConstructorAccess.class);
            s.verify();
        }
    }
View Full Code Here

        }
    }

    public void testArrayResult() throws Exception
    {
        Registry r = buildFrameworkRegistry("ArrayResult.xml");

        ArrayService s =
            (ArrayService) r.getService("hivemind.test.services.ArrayResult", ArrayService.class);

        interceptLogging("hivemind.test.services.ArrayResult");

        String[] result = s.returnArrayType();
View Full Code Here

        assertLoggedMessage("END returnArrayType() [(java.lang.String[]){alpha, beta}]");
    }

    public void testInterceptorParameters() throws Exception
    {
        Registry r = buildFrameworkRegistry("InterceptorParameters.xml");

        interceptLogging("hivemind.test.services.Bedrock");

        Bedrock b = (Bedrock) r.getService("hivemind.test.services.Bedrock", Bedrock.class);

        b.fred();
        b.barney();
        b.wilma();
View Full Code Here

        assertEquals(true, fixture.getDidRun());
    }

    public void testStartupContribution() throws Exception
    {
        Registry r = buildFrameworkRegistry("StartupContribution.sdl");

        StartupRunnableFixture fixture =
            (StartupRunnableFixture) r.getService(
                "hivemind.test.services.StartupRunnableFixture",
                StartupRunnableFixture.class);

        assertEquals(true, fixture.getDidRun());
    }
View Full Code Here

        verifyControls();
    }

    public void testWrongType() throws Exception
    {
        Registry r = buildFrameworkRegistry("WrongType.xml");

        interceptLogging();

        List l = r.getConfiguration("hivemind.test.rules.WrongType");

        // Convert the proxy into a real list; this will trigger the
        // expected errors.

        l.size();
View Full Code Here

*/
public class TestSetPropertyRule extends HiveMindTestCase
{
    public void testSuccess() throws Exception
    {
        Registry r = buildFrameworkRegistry("SetPropertyRule.sdl");

        List l = r.getConfiguration("hivemind.test.rules.HonorRoll");

        assertEquals(2, l.size());
        TruthTeller t = (TruthTeller) l.get(0);

        assertEquals("Fred", t.getName());
View Full Code Here

    private String _otherStartValue;
    private String _otherEndValue;

    public void testSingleThread() throws Exception
    {
        Registry r = buildFrameworkRegistry("StringHolder.xml");

        StringHolder h =
            (StringHolder) r.getService("hivemind.test.services.StringHolder", StringHolder.class);
        ThreadEventNotifier n =
            (ThreadEventNotifier) r.getService(
                HiveMind.THREAD_EVENT_NOTIFIER_SERVICE,
                ThreadEventNotifier.class);

        interceptLogging("hivemind.test.services.StringHolder");
View Full Code Here

        assertSame(l2, l1);
    }

    public void testFailure() throws Exception
    {
        Registry r = (Registry) buildFrameworkRegistry("ConfigurationTranslator.xml");

        interceptLogging();

        DatumHolder h =
            (DatumHolder) r.getService("hivemind.test.rules.Failure", DatumHolder.class);

        // Force creation of service, and thus the error.

        h.getDatums();
View Full Code Here

TOP

Related Classes of org.apache.hivemind.Registry

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.