Examples of RegistryInfrastructure


Examples of org.apache.hivemind.internal.RegistryInfrastructure

        assertLoggedMessagePattern("Error at .*?: Element xatum is not allowed here\\.");
    }

    public void testCustomRule() throws Exception
    {
        RegistryInfrastructure r =
            (RegistryInfrastructure) buildFrameworkRegistry("CustomRule.xml");

        List l = r.getConfiguration("hivemind.test.config.CustomRule");
        Module m = r.getConfigurationPoint("hivemind.test.config.CustomRule").getModule();

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

        // Put this check second, just to get some code coverage
        // on ElementsInnerProxyList
View Full Code Here

Examples of org.apache.hivemind.internal.RegistryInfrastructure

        verifyControls();
    }

    public void testConfigurationTranslator() throws Exception
    {
        RegistryInfrastructure r =
            (RegistryInfrastructure) buildFrameworkRegistry("ConfigurationTranslator.xml");

        DatumHolder h =
            (DatumHolder) r.getService(
                "hivemind.test.rules.ExtensionPointTranslator",
                DatumHolder.class);
        List l1 = h.getDatums();
        List l2 = r.getConfiguration("hivemind.test.rules.EP");

        assertSame(l2, l1);
    }
View Full Code Here

Examples of org.apache.hivemind.internal.RegistryInfrastructure

        definition.addModule(zipZoop);

        RegistryInfrastructureConstructor ric = new RegistryInfrastructureConstructor(errorHandler,
                LogFactory.getLog(TestRegistryInfrastructureConstructor.class), null);

        RegistryInfrastructure registryInfrastructure = ric.constructRegistryInfrastructure(definition);

        ServicePoint sp = registryInfrastructure.getServicePoint("foo.bar.sp1", null);
        assertNotNull(sp);

        ConfigurationPoint cp = registryInfrastructure.getConfigurationPoint("zip.zoop.cp1", null);
        assertNotNull(cp);
    }
View Full Code Here

Examples of org.apache.hivemind.internal.RegistryInfrastructure

        AutowiringStrategyContribution contrib3 = new AutowiringStrategyContribution(strategy3,
                "strategy3", null, null);
        strategyContributions.add(contrib3);
       
        MockControl registryControl = newControl(RegistryInfrastructure.class);
        RegistryInfrastructure registry = (RegistryInfrastructure) registryControl.getMock();
       
        ServiceAutowireTarget target = new ServiceAutowireTarget();
       
        // Training
        strategy1.autowireProperty(registry, target, "stringHolder");
        strategy1Control.setReturnValue(false);

        registry.containsService(StringHolder.class, null);
        registryControl.setReturnValue(true);

        registry.getService(StringHolder.class, null);
        registryControl.setReturnValue(new StringHolderImpl());

        replayControls();
       
        Autowiring autowiring = new AutowiringImpl(registry, strategyContributions, new DefaultErrorHandler());
View Full Code Here

Examples of org.apache.hivemind.internal.RegistryInfrastructure

        strategyContributions.add(contrib2);
       
        ServiceAutowireTarget target = new ServiceAutowireTarget();
       
        MockControl registryControl = newControl(RegistryInfrastructure.class);
        RegistryInfrastructure registry = (RegistryInfrastructure) registryControl.getMock();
       
        // Training
        strategy1.autowireProperty(registry, target, "stringHolder");
        strategy1Control.setReturnValue(false);
       
View Full Code Here

Examples of org.apache.hivemind.internal.RegistryInfrastructure

        strategyContributions.add(contrib1);

        Object target = new SkippedPropertiesAutowireTarget();
       
        MockControl registryControl = newControl(RegistryInfrastructure.class);
        RegistryInfrastructure registry = (RegistryInfrastructure) registryControl.getMock();
       
        replayControls();
       
        Autowiring autowiring = new AutowiringImpl(registry, strategyContributions, new DefaultErrorHandler());
        autowiring.autowireProperties(target);
View Full Code Here

Examples of org.apache.hivemind.internal.RegistryInfrastructure

        ServiceAutowireTarget target = new ServiceAutowireTarget();
        target.setStringHolder(new StringHolderImpl());
       
        MockControl registryControl = newControl(RegistryInfrastructure.class);
        RegistryInfrastructure registry = (RegistryInfrastructure) registryControl.getMock();
       
        replayControls();
       
        Autowiring autowiring = new AutowiringImpl(registry, strategyContributions, new DefaultErrorHandler());
        autowiring.autowireProperties(target);
View Full Code Here

Examples of org.apache.hivemind.internal.RegistryInfrastructure

{

    public void testGetServiceByInterface()
    {
        MockControl rc = newControl(RegistryInfrastructure.class);
        RegistryInfrastructure r = (RegistryInfrastructure) rc.getMock();

        ModuleImpl m = new ModuleImpl();
        m.setRegistry(r);

        StringHolder h = new StringHolderImpl();

        r.getService(StringHolder.class, m);
        rc.setReturnValue(h);

        replayControls();

        Object result = m.getService(StringHolder.class);
View Full Code Here

Examples of org.apache.hivemind.internal.RegistryInfrastructure

*/
public class TestRegistryInfrastructure extends FrameworkTestCase
{
    public void testGetMissingExtensionPoint()
    {
        RegistryInfrastructure r = new RegistryInfrastructureImpl( null, null );
        try
        {
            r.getServicePoint( "foo", null );
            unreachable();
        }
        catch( ApplicationRuntimeException ex )
        {
            assertEquals( ImplMessages.noSuchServicePoint( "foo" ), ex.getMessage() );
View Full Code Here

Examples of org.apache.hivemind.internal.RegistryInfrastructure

            processor.postprocess(_registryDefinition, _errorHandler);
        }

        RegistryInfrastructureConstructor constructor = new RegistryInfrastructureConstructor(_errorHandler, LOG, locale);
        RegistryInfrastructure infrastructure = constructor
                .constructRegistryInfrastructure(_registryDefinition);

        // Notify initialization listeners
        for (Iterator i = _registryDefinition.getRegistryInitializationListeners().iterator(); i.hasNext();)
        {
            RegistryInitializationListener listener = (RegistryInitializationListener) i.next();

            listener.registryInitialized(infrastructure);
        }
       
        infrastructure.startup();

        return new RegistryImpl(infrastructure);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.