Package org.apache.tuscany.core.context

Examples of org.apache.tuscany.core.context.SystemCompositeContext.start()


*/
public class IntraCompositeWireTestCase extends TestCase {

    public void testModuleToModuleScope() throws Exception {
        SystemCompositeContext context = createContext();
        context.start();
        context.registerModelObject(MockFactory.createSystemModuleWithWiredComponents("system.module",Scope.MODULE, Scope.MODULE));
        context.publish(new ModuleStart(this));
        Source source = (Source) ((AtomicContext) context.getContext("source")).getTargetInstance();
        Assert.assertNotNull(source);
        Target targetRef = source.getTarget();
View Full Code Here


        context.stop();
    }

    public void testStatelessToModuleScope() throws Exception {
        SystemCompositeContext context = createContext();
        context.start();
        context.registerModelObject(MockFactory.createSystemModuleWithWiredComponents("system.module",Scope.INSTANCE, Scope.MODULE));
        context.publish(new ModuleStart(this));
        Source source = (Source) ((AtomicContext) context.getContext("source")).getTargetInstance();
        Assert.assertNotNull(source);
        Target targetRef = source.getTarget();
View Full Code Here

        context.stop();
    }

    public void testModuleToStatelessScope() throws Exception {
        SystemCompositeContext context = createContext();
        context.start();
        context.registerModelObject(MockFactory.createSystemModuleWithWiredComponents("system.module",Scope.MODULE, Scope.INSTANCE));
        context.publish(new ModuleStart(this));
        Source source = (Source) ((AtomicContext) context.getContext("source")).getTargetInstance();
        Assert.assertNotNull(source);
        Target targetRef = source.getTarget();
View Full Code Here

        context.stop();
    }

    public void testMultiplicity() throws Exception {
        SystemCompositeContext context = createContext();
        context.start();
        context.registerModelObject(MockFactory.createSystemModuleWithWiredComponents("system.module",Scope.MODULE, Scope.MODULE));
        context.publish(new ModuleStart(this));
        Source source = (Source) ((AtomicContext) context.getContext("source")).getTargetInstance();
        Assert.assertNotNull(source);
        Target target = (Target) ((AtomicContext) context.getContext("target")).getTargetInstance();
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.