Package org.apache.hivemind

Examples of org.apache.hivemind.Registry


public class TestConfigurationPoint extends FrameworkTestCase
{

    public void testEmpty() throws Exception
    {
        Registry r = buildFrameworkRegistry("Empty.xml");

        List l = r.getConfiguration("hivemind.test.config.Empty");

        assertEquals(0, l.size());
    }
View Full Code Here


    /**
     * Uses a second thread to ensure that the data in different threads is seperate.
     */
    public void testThreaded() throws Exception
    {
        Registry r = buildFrameworkRegistry("StringHolder.xml");

        StringHolder h =
            (StringHolder) r.getService("hivemind.test.services.StringHolder", StringHolder.class);

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

        assertNull(h.getValue());

View Full Code Here

        assertEquals(0, l.size());
    }

    public void testSimple() throws Exception
    {
        Registry r = buildFrameworkRegistry("Simple.xml");

        List l = r.getConfiguration("hivemind.test.config.Simple");

        assertEquals(2, l.size());

        Datum d = (Datum) l.get(0);
View Full Code Here

        _didShutdown = false;
    }

    public void testIgnoreRegistyShutdownListener() throws Exception
    {
        Registry r = buildFrameworkRegistry("ThreadedRegistryShutdown.xml");

        StringHolder h =
            (StringHolder) r.getService(
                "hivemind.test.services.ThreadedRegistryShutdown",
                StringHolder.class);

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

        assertEquals("value2", d.getValue());
    }

    public void testAttributeDefaults() throws Exception
    {
        Registry r = buildFrameworkRegistry("AttributeDefaults.xml");

        List l = r.getConfiguration("hivemind.test.config.AttributeDefaults");

        assertEquals(1, l.size());
        Datum d = (Datum) l.get(0);

        assertEquals("DEFAULT_KEY", d.getKey());
View Full Code Here

        assertEquals(false, _didShutdown);
    }

    public void testDiscardable() throws Exception
    {
        Registry r = buildFrameworkRegistry("ThreadedDiscardable.xml");

        StringHolder h =
            (StringHolder) r.getService(
                "hivemind.test.services.ThreadedDiscardable",
                StringHolder.class);

        h.setValue("bar");

        ThreadEventNotifier n =
            (ThreadEventNotifier) r.getService(
                "hivemind.ThreadEventNotifier",
                ThreadEventNotifier.class);

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

        assertNull(d.getValue());
    }

    public void testNested() throws Exception
    {
        Registry r = buildFrameworkRegistry("Nested.xml");

        List l = r.getConfiguration("hivemind.test.config.Nested");

        assertEquals(1, l.size());

        DatumHolder h = (DatumHolder) l.get(0);
View Full Code Here

        assertEquals("barney", d.getValue());
    }

    public void testStructured() throws Exception
    {
        Registry r = buildFrameworkRegistry("Structured.xml");

        List l = r.getConfiguration("hivemind.test.config.Structured");

        assertEquals(2, l.size());

        Datum d = (Datum) l.get(0);
View Full Code Here

        assertEquals("value_2", d.getValue());
    }

    public void testSetParent() throws Exception
    {
        Registry r = buildFrameworkRegistry("SetParent.xml");

        List l = r.getConfiguration("hivemind.test.config.SetParent");

        assertEquals(1, l.size());

        Parent p1 = (Parent) l.get(0);
View Full Code Here

    public void testBooleanTranslator() throws Exception
    {
        interceptLogging();

        Registry r = buildFrameworkRegistry("BooleanTranslator.xml");

        List l = r.getConfiguration("hivemind.test.config.BooleanTranslator");

        // Trigger the proxy

        l.size();
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.