Package org.apache.hivemind

Examples of org.apache.hivemind.Registry


        verifyControls();
    }

    public void testPlaceholderFactory() throws Exception
    {
        Registry r = buildFrameworkRegistry("DefaultImplementationBuilder.xml");

        Runnable o = (Runnable) r.getService("hivemind.test.lib.Runnable", Runnable.class);

        o.run();
    }
View Full Code Here


    /**
     * Try it integrated now!
     */
    public void testFactoryWithServices() throws Exception
    {
        Registry r = buildFrameworkRegistry("Pipeline.xml");

        StandardService s =
            (StandardService) r.getService("hivemind.lib.test.Pipeline", StandardService.class);

        assertEquals(24, s.run(12));
        assertEquals(18, s.run(9));
    }
View Full Code Here

        assertEquals(18, s.run(9));
    }

    public void testFactoryWithObjects() throws Exception
    {
        Registry r = buildFrameworkRegistry("Pipeline.xml");

        StandardService s =
            (StandardService) r.getService(
                "hivemind.lib.test.ObjectPipeline",
                StandardService.class);

        assertEquals(24, s.run(12));
        assertEquals(18, s.run(9));
View Full Code Here

*/
public class TestRegistryShutdownListenerServices extends FrameworkTestCase
{
    private void executeShutdownListenerTest(String serviceModel, boolean manual) throws Exception
    {
        Registry registry = createRegistryWithSimpleService(serviceModel, manual);
        Simple simple = (Simple) registry.getService("hivemind.lib.test.Simple", Simple.class);
        final Counter counter = new Counter();
        simple.setCounter(counter);
        registry.shutdown();
        assertEquals(1, counter.getValue());
    }
View Full Code Here

        executeShutdownListenerTest(ServiceModel.PRIMITIVE, false);
    }
   
    public void testSingletonBeanRegistryShutdownListener() throws Exception
    {
        Registry registry = createRegistryWithPojo(ServiceModel.SINGLETON);
        RegistryShutdownBean bean = ( RegistryShutdownBean )registry.getService( "hivemind.lib.test.RegistryShutdownBean", RegistryShutdownBean.class );
        bean.someMethod();
    }
View Full Code Here

        bean.someMethod();
    }

    public void testThreadedBeanRegistryShutdownListener() throws Exception
    {
        Registry registry = createRegistryWithPojo(ServiceModel.THREADED);
        RegistryShutdownBean bean = ( RegistryShutdownBean )registry.getService( "hivemind.lib.test.RegistryShutdownBean", RegistryShutdownBean.class );
        bean.someMethod();
    }
View Full Code Here

        bean.someMethod();
    }

    public void testPooledBeanRegistryShutdownListener() throws Exception
    {
        Registry registry = createRegistryWithPojo(ServiceModel.POOLED);
        RegistryShutdownBean bean = ( RegistryShutdownBean )registry.getService( "hivemind.lib.test.RegistryShutdownBean", RegistryShutdownBean.class );
        bean.someMethod();
    }
View Full Code Here

        bean.someMethod();
    }

    public void testPrimitiveBeanRegistryShutdownListener() throws Exception
    {
        Registry registry = createRegistryWithPojo(ServiceModel.PRIMITIVE);
        RegistryShutdownBean bean = ( RegistryShutdownBean )registry.getService( "hivemind.lib.test.RegistryShutdownBean", RegistryShutdownBean.class );
        bean.someMethod();
    }
View Full Code Here

public class TestConfigurationPoint extends XmlTestCase
{

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

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

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

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

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

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

        assertEquals(2, l.size());

        Datum d = (Datum) l.get(0);
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.