Package org.apache.hivemind

Examples of org.apache.hivemind.Registry


        assertEquals("${value2}", e.getAttributeValue("value"));
    }

    public void testLocalized() throws Exception
    {
        Registry r = buildFrameworkRegistry("Localized.xml");

        List l = (List) r.getConfiguration("hivemind.test.config.Localized");
        assertEquals(1, l.size());

        Datum d = (Datum) l.get(0);

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


        assertEquals("Some Damn Thing", d.getValue());
    }

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

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

        assertEquals("<InnerProxy for hivemind.test.config.Simple(java.util.List)>", l.toString());

        assertEquals(true, l.equals(l));
        assertEquals(false, l.equals(null));

        assertEquals(2, l.size());

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

        assertNotSame(l, l2);
        assertEquals(l, l2);

        assertEquals(l2.toString(), l.toString());
View Full Code Here

    public void testTooFew() throws Exception
    {

        interceptLogging(RegistryBuilder.class.getName());

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

        r.getConfiguration("hivemind.test.config.TooFew");

        assertLoggedMessage("Configuration point hivemind.test.config.TooFew contains no contributions but expects at least one contribution.");

    }
View Full Code Here

    public void testTooMany() throws Exception
    {
        interceptLogging(RegistryBuilder.class.getName());

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

        r.getConfiguration("hivemind.test.config.TooMany");

        assertLoggedMessage("Configuration point hivemind.test.config.TooMany contains 2 contributions but expects an optional contribution.");
    }
View Full Code Here

*/
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

        verifyControls();
    }
   
    public void testJavassistProxies() throws Exception {
       
        Registry reg = createRegistry(new JavassistBeanInterfaceFactory(newLocation(), "module"));
    final BeanInterface bean = ( BeanInterface )reg.getService( "hivemind.tests.serviceByInterface.BeanInterface", BeanInterface.class );
    bean.interfaceMethod();
  }
View Full Code Here

    final BeanInterface bean = ( BeanInterface )reg.getService( "hivemind.tests.serviceByInterface.BeanInterface", BeanInterface.class );
    bean.interfaceMethod();
  }
 
  public void testCglibProxies() throws Exception {
        Registry reg = createRegistry(new CglibBeanInterfaceFactory(newLocation(), "module"));
    final BeanInterface bean = ( BeanInterface )reg.getService( "hivemind.tests.serviceByInterface.BeanInterface", BeanInterface.class );
    bean.interfaceMethod();
  }
View Full Code Here

    final BeanInterface bean = ( BeanInterface )reg.getService( "hivemind.tests.serviceByInterface.BeanInterface", BeanInterface.class );
    bean.interfaceMethod();
  }
 
  public void testJdkProxies() throws Exception {
        Registry reg = createRegistry(new JdkBeanInterfaceFactory(newLocation(), "module"));
    final BeanInterface bean = ( BeanInterface )reg.getService( "hivemind.tests.serviceByInterface.BeanInterface", BeanInterface.class );
    bean.interfaceMethod();
  }
View Full Code Here

        ServicePointDefinitionImpl sp1 = createServicePointDefinition(module, "BeanInterface", BeanInterface.class);
        ImplementationDefinition impl = new ImplementationDefinitionImpl(module, newLocation(),
                constructor, ServiceModel.SINGLETON, true);
        sp1.addImplementation(impl);
        module.addServicePoint(sp1);
        Registry reg = buildFrameworkRegistry(module);
        return reg;
    }
View Full Code Here

        f.init(filterConfig);

        verifyControls();

        Registry r = f.getRegistry();

        assertNotNull(r);

        ThreadEventNotifier t = (ThreadEventNotifier) r.getService(
                HiveMind.THREAD_EVENT_NOTIFIER_SERVICE,
                ThreadEventNotifier.class);

        ThreadListenerFixture l = new ThreadListenerFixture();
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.