Package org.apache.hivemind.internal

Examples of org.apache.hivemind.internal.Module


    public void testResultNotAssignableToServiceInterface()
    {
        Location l = newLocation();

        MockControl modulec = newControl(Module.class);
        Module module = (Module) modulec.getMock();

        ModuleDefinition moduleDef = createModuleDefinition("foo");
        ServicePointDefinitionImpl definition = new ServicePointDefinitionImpl(moduleDef, "bar", l, Visibility.PUBLIC, "java.util.List");
        definition.addImplementation(new ImplementationDefinitionImpl(moduleDef, l, null, "fred", true));
        ServicePointImpl sp = new ServicePointImpl(module, definition);

        Object service = new ArrayList();

        MockControl factoryc = newControl(ServiceModelFactory.class);
        ServiceModelFactory factory = (ServiceModelFactory) factoryc.getMock();

        MockControl modelc = newControl(ServiceModel.class);
        ServiceModel model = (ServiceModel) modelc.getMock();

        module.getServiceModelFactory("fred");
        modulec.setReturnValue(factory);

        factory.createServiceModelForService(sp);
        factoryc.setReturnValue(model);

        model.getService();
        modelc.setReturnValue(service);

        module.getModuleId();
        modulec.setReturnValue("test");
       
        module.resolveType("java.util.List");
        modulec.setReturnValue(List.class);

        replayControls();

        try
View Full Code Here


    public static String processText(SchemaProcessor processor, Element element, String inputValue)
    {
        if (inputValue == null)
            return null;

        Module contributingModule = processor.getContributingModule();

        if (inputValue.startsWith("%"))
        {
            String key = inputValue.substring(1);

            return contributingModule.getMessages().getMessage(key);
        }

        return processor.getSymbolExpander().expandSymbols(inputValue, element.getLocation());
    }
View Full Code Here

        control.setReturnValue("${flintstone}");

        mockProcessor.getContributingModule();

        MockControl moduleControl = newControl(Module.class);
        Module mockModule = (Module) moduleControl.getMock();

        control.setReturnValue(mockModule);
       
        MockControl symbolExpanderControl = newControl(SymbolExpander.class);
        SymbolExpander symbolExpander = (SymbolExpander) symbolExpanderControl.getMock();
View Full Code Here

        control.setReturnValue(new NullTranslator());

        mockProcessor.getContributingModule();

        MockControl moduleControl = newControl(Module.class);
        Module mockModule = (Module) moduleControl.getMock();

        control.setReturnValue(mockModule);
       
        MockControl symbolExpanderControl = newControl(SymbolExpander.class);
        SymbolExpander symbolExpander = (SymbolExpander) symbolExpanderControl.getMock();
View Full Code Here

*/
public class TestServiceImplementationFactoryParametersImpl extends HiveMindTestCase
{
    public void testGetFirstParameter()
    {
        final Module m = new ModuleImpl();
        final ServicePoint sp = new ServicePointImpl(m, null);
        final ServiceImplementationFactoryParametersImpl params = new ServiceImplementationFactoryParametersImpl( sp, m, new LinkedList() );
        assertNull( params.getFirstParameter() );
    }
View Full Code Here

    {
        super(servicePoint);

        _serviceInterface = servicePoint.getServiceInterface();

        Module module = getServicePoint().getModule();

        _notifier = (ThreadEventNotifier) module.getService(
                HiveMind.THREAD_EVENT_NOTIFIER_SERVICE,
                ThreadEventNotifier.class);

        _serviceProxy = createServiceProxy();
    }
View Full Code Here

public class TestServicePointTranslator extends HiveMindTestCase
{
    public void testServicePointTranslator()
    {
        MockControl control = newControl(Module.class);
        Module m = (Module) control.getMock();

        ServicePoint sp = new ServicePointImpl(m, null);

        m.getServicePoint("Fred");
        control.setReturnValue(sp);

        replayControls();

        Translator t = new ServicePointTranslator();
View Full Code Here

public class TestCreateObjectRule extends HiveMindTestCase
{
    private Module newModule(String className, Class result)
    {
        MockControl control = newControl(Module.class);
        Module module = (Module) control.getMock();

        module.resolveType(className);
        control.setReturnValue(result);

        return module;
    }
View Full Code Here

        ImplementationDefinition implementationDefinition = _servicePoint.getImplementationDefinition();
        ImplementationConstructor constructor = implementationDefinition.getServiceConstructor();
        // Get a reference to the module that provided the implementation
        String definingModuleId = implementationDefinition.getModuleId();
       
        Module definingModule = getRegistry().getModule(definingModuleId);
        ImplementationConstructionContext context = new ImplementationConstructionContextImpl(definingModule,
                _servicePoint);
        Object result = constructor.constructCoreServiceImplementation(context);

        if (result == null)
View Full Code Here

    }

    public void testCreateWithInitializer()
    {
        final Location l = newLocation();
        Module module = newModule("Bean", Bean.class);
        Element element = newElement(l);

        MockControl control = newControl(SchemaProcessor.class);
        SchemaProcessor processor = (SchemaProcessor) control.getMock();
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.