Package org.apache.tuscany.core.mock.component

Examples of org.apache.tuscany.core.mock.component.GenericSystemComponent


        CompositeContext moduleContext = createContext();
        Module module = MockFactory.createSystemModule();
        moduleContext.registerModelObject(module);
        moduleContext.start();
        moduleContext.publish(new ModuleStart(this));
        GenericSystemComponent component = (GenericSystemComponent) moduleContext.getContext("TestService1").getInstance(null);
        Assert.assertNotNull(component);
        GenericSystemComponent ep = (GenericSystemComponent) moduleContext.getContext("TestService1EP").getInstance(null);
        Assert.assertNotNull(ep);
        moduleContext.publish(new ModuleStop(this));
        moduleContext.stop();
    }
View Full Code Here


        CompositeContext moduleContext = createContext();
        moduleContext.start();
        Module module = MockFactory.createSystemModule();
        moduleContext.registerModelObject(module);
        moduleContext.publish(new ModuleStart(this));
        GenericSystemComponent component = (GenericSystemComponent) moduleContext.getContext("TestService1").getInstance(null);
        Assert.assertNotNull(component);
        GenericSystemComponent ep = (GenericSystemComponent) moduleContext.getContext("TestService1EP").getInstance(null);
        Assert.assertNotNull(ep);
        moduleContext.publish(new ModuleStop(this));
        moduleContext.stop();
    }
View Full Code Here

        moduleContext.registerModelObject(component);
        EntryPoint ep = MockFactory.createEPSystemBinding("TestService1EP", ModuleScopeSystemComponent.class, "TestService1", component);
        moduleContext.registerModelObject(ep);
        moduleContext.start();
        moduleContext.publish(new ModuleStart(this));
        GenericSystemComponent test = (GenericSystemComponent) moduleContext.getContext("TestService1").getInstance(null);
        Assert.assertNotNull(test);
        GenericSystemComponent testEP = (GenericSystemComponent) moduleContext.getContext("TestService1EP").getInstance(null);
        Assert.assertNotNull(testEP);
        moduleContext.publish(new ModuleStop(this));
        moduleContext.stop();
    }
View Full Code Here

        moduleContext.start();
        moduleContext.registerModelObject(component);
        EntryPoint ep = MockFactory.createEPSystemBinding("TestService1EP", ModuleScopeSystemComponent.class, "TestService1", component);
        moduleContext.registerModelObject(ep);
        moduleContext.publish(new ModuleStart(this));
        GenericSystemComponent test = (GenericSystemComponent) moduleContext.getContext("TestService1").getInstance(null);
        Assert.assertNotNull(test);
        GenericSystemComponent testEP = (GenericSystemComponent) moduleContext.getContext("TestService1EP").getInstance(null);
        Assert.assertNotNull(testEP);
        moduleContext.publish(new ModuleStop(this));
        moduleContext.stop();
    }
View Full Code Here

        CompositeContext moduleContext = createContext();
        Component component = factory.createSystemComponent("TestService1", ModuleScopeSystemComponent.class, ModuleScopeSystemComponentImpl.class, Scope.MODULE);
        moduleContext.start();
        moduleContext.registerModelObject(component);
        moduleContext.publish(new ModuleStart(this));
        GenericSystemComponent test = (GenericSystemComponent) moduleContext.getContext("TestService1").getInstance(null);
        Assert.assertNotNull(test);
        EntryPoint ep = MockFactory.createEPSystemBinding("TestService1EP", ModuleScopeSystemComponent.class, "TestService1", component);
        moduleContext.registerModelObject(ep);
        GenericSystemComponent testEP = (GenericSystemComponent) moduleContext.getContext("TestService1EP").getInstance(null);
        Assert.assertNotNull(testEP);
        moduleContext.publish(new ModuleStop(this));
        moduleContext.stop();
    }
View Full Code Here

        // start the modules and test inter-module system wires
        systemContext.publish(new ModuleStart(this));
        moduleContext.publish(new ModuleStart(this));

        Assert.assertNotNull(systemContext.getContext("TestService1EP").getInstance(null));
        GenericSystemComponent testService = (GenericSystemComponent) systemContext.getContext("TestService1").getInstance(null);
        Assert.assertNotNull(testService);
        GenericSystemComponent testES = (GenericSystemComponent) moduleContext.getContext("TestServiceES").getInstance(null);
        Assert.assertNotNull(testES);
        Assert.assertSame(testService, testES);
    }
View Full Code Here

TOP

Related Classes of org.apache.tuscany.core.mock.component.GenericSystemComponent

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.