Package org.apache.hivemind.internal

Examples of org.apache.hivemind.internal.Module


    public void testInitializer() throws Exception
    {
        InstanceTranslator t = new InstanceTranslator();

        Module m = newModule();

        m.resolveType("Bean");
        setReturnValue(m, IntHolder.class);

        replayControls();

        IntHolder ih = (IntHolder) t.translate(m, Object.class, "Bean,value=37", null);
View Full Code Here


*/
public class TestVisibility extends FrameworkTestCase
{
    public void testPublicConfigurationVisibleToOtherModule()
    {
        Module m = (Module) newMock(Module.class);

        Module om = (Module) newMock(Module.class);

        replayControls();

        ConfigurationPointDefinitionImpl cpd = new ConfigurationPointDefinitionImpl(createModuleDefinition("module"));
        cpd.setVisibility(Visibility.PUBLIC);
View Full Code Here

        verifyControls();
    }

    public void testPublicConfigurationVisibleToApplication()
    {
        Module m = (Module) newMock(Module.class);

        replayControls();

        ConfigurationPointDefinitionImpl cpd = new ConfigurationPointDefinitionImpl(createModuleDefinition("module"));
        cpd.setVisibility(Visibility.PUBLIC);
View Full Code Here

        verifyControls();
    }

    public void testPrivateConfigurationInvisibleToOtherModule()
    {
        Module m = (Module) newMock(Module.class);
        Module om = (Module) newMock(Module.class);

        replayControls();

        ConfigurationPointDefinitionImpl cpd = new ConfigurationPointDefinitionImpl(createModuleDefinition("module"));
        cpd.setVisibility(Visibility.PRIVATE);
View Full Code Here

        verifyControls();
    }

    public void testPrivateConfigurationInvisibleToApplication()
    {
        Module m = (Module) newMock(Module.class);

        replayControls();

        ConfigurationPointDefinitionImpl cpd = new ConfigurationPointDefinitionImpl(createModuleDefinition("module"));
        cpd.setVisibility(Visibility.PRIVATE);
View Full Code Here

        SchemaImpl schema = new SchemaImpl("module");
        schema.addElementModel(em);

        MockControl control1 = newControl(Module.class);
        Module m1 = (Module) control1.getMock();

        MockControl control2 = newControl(Module.class);
        Module m2 = (Module) control2.getMock();
       
        MockControl registryControl = newControl(RegistryInfrastructure.class);
        RegistryInfrastructure registry = (RegistryInfrastructure) registryControl.getMock();

        MockControl symbolExpanderControl = newControl(SymbolExpander.class);
        SymbolExpander symbolExpander = (SymbolExpander) symbolExpanderControl.getMock();

        SchemaProcessorImpl p = new SchemaProcessorImpl(null, schema);

        Location location1 = newLocation();
        ElementImpl element1 = new ElementImpl();
        element1.setElementName("cartoon");
        element1.addAttribute(new AttributeImpl("name", "flintstone"));
        element1.setLocation(location1);

        List elements1 = Collections.singletonList(element1);

        Location location2 = newLocation();
        ElementImpl element2 = new ElementImpl();
        element2.setElementName("cartoon");
        element2.addAttribute(new AttributeImpl("name", "flintstone"));
        element2.setLocation(location2);

        List elements2 = Collections.singletonList(element2);

        MockControl tControl1 = newControl(Translator.class);
        Translator t1 = (Translator) tControl1.getMock();
       
        MockControl tmControl = newControl(TranslatorManager.class);
        TranslatorManager tm = (TranslatorManager) tmControl.getMock();
       
        m1.getRegistry();
        control1.setReturnValue(registry);
       
        registry.getModule("module");
        registryControl.setReturnValue(m1);

        m2.getRegistry();
        control2.setReturnValue(registry);
       
        registry.getModule("module");
        registryControl.setReturnValue(m2);
       
        m1.resolveType("StringHolderImpl");
        control1.setReturnValue(StringHolderImpl.class);

        m1.getService(SymbolExpander.class);
        control1.setReturnValue(symbolExpander);
       
        symbolExpander.expandSymbols("flintstone", location1);
        symbolExpanderControl.setReturnValue("flintstone");
       
        m1.getService(TranslatorManager.class);
        control1.setReturnValue(tm);
       
        symbolExpander.expandSymbols("flintstone", location1);
        symbolExpanderControl.setReturnValue("flintstone");

        String flintstoneKeyModule1 = "m1.flintstone";
        t1.translate(m1, String.class, "flintstone", element1.getLocation());
        tControl1.setReturnValue(flintstoneKeyModule1);

        t1.translate(m1, Object.class, "flintstone", element1.getLocation());
        tControl1.setReturnValue(flintstoneKeyModule1);

        m2.resolveType("StringHolderImpl");
        control2.setReturnValue(StringHolderImpl.class);

        symbolExpander.expandSymbols("flintstone", location2);
        symbolExpanderControl.setReturnValue("flintstone");
       
View Full Code Here

        if (_log.isDebugEnabled())
            _log.debug("Processing module " + id);

        if (_infrastructure.getModule(id) != null)
        {
            Module existing = _infrastructure.getModule(id);

            _errorHandler.error(_log, ImplMessages.duplicateModuleId(id, existing.getLocation(), moduleDefinition
                    .getLocation()), null, null);

            // Ignore the duplicate module descriptor.
            return;
        }
View Full Code Here

        verifyControls();
    }

    public void testCreateClassServiceConstructorTwice()
    {
        Module m = newModule();

        ServicePoint sp = new ServicePointImpl(m, null);
       
        replayControls();
View Full Code Here

    /** @since 1.1 */

    public void testCreateInstanceWithInitializer()
    {
        Module m = newModule();
       
        ServicePoint sp = new ServicePointImpl(m, null);

        CreateClassServiceConstructor c = new CreateClassServiceConstructor(newLocation(),
                SimpleBean.class.getName() + ",value=HiveMind");
View Full Code Here

        assertEquals("HiveMind", b.getValue());
    }

    public void testCreateClassServiceConstructorFailure()
    {
        Module m = newModule();
       
        ServicePoint sp = new ServicePointImpl(m, null);

        CreateClassServiceConstructor c = new CreateClassServiceConstructor(newLocation(),
                PrivateBean.class.getName());
View Full Code Here

TOP

Related Classes of org.apache.hivemind.internal.Module

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.