Package org.apache.tuscany.core.context

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


public class DifferentInterfaceWireTestCase extends TestCase {

    public void testMultiplicity() throws Exception {
       
        CompositeContext context = createContext();
        context.start();
        context.registerModelObject(MockFactory.createModuleWithWiredComponentsOfDifferentInterface(Scope.MODULE, Scope.MODULE));
        context.publish(new ModuleStart(this));
        Source source = (Source) ((AtomicContext) context.getContext("source")).getTargetInstance();
        Assert.assertNotNull(source);
        OtherTarget target = (OtherTarget) ((AtomicContext)context.getContext("target")).getTargetInstance();
View Full Code Here


    protected CompositeContext createContextHierachy() throws Exception {
        List<ContextFactoryBuilder> mockBuilders = MockFactory.createSystemBuilders();
        CompositeContext parent = new SystemCompositeContextImpl("test.parent", null, null, new DefaultScopeStrategy(), new EventContextImpl(), new MockConfigContext(mockBuilders));
        parent.registerModelObject(MockFactory.createCompositeComponent("test.child"));
        parent.start();
        CompositeContext child = (CompositeContext) parent.getContext("test.child");
        Assert.assertNotNull(child);
        return parent;
    }
View Full Code Here

                ScopeInitializationException e = new ScopeInitializationException("Context not an composite type");
                e.addContextName(context.getName());
                throw e;
            }
            CompositeContext compositeCtx = (CompositeContext) context;
            compositeCtx.start();
            contexts.put(compositeCtx.getName(), compositeCtx);
        }
        lifecycleState = RUNNING;
    }
View Full Code Here

                ScopeInitializationException e = new ScopeInitializationException("Context not an composite type");
                e.setIdentifier(context.getName());
                throw e;
            }
            CompositeContext compositeCtx = (CompositeContext) context;
            compositeCtx.start();
            if (moduleScopeStarted) {
                compositeCtx.publish(new ModuleStart(this));
            }
            contexts.put(compositeCtx.getName(), compositeCtx);
        }
View Full Code Here

*/
public class MultiplicityTestCase extends TestCase {

    public void testMultiplicity() throws Exception {
        CompositeContext context = createContext();
        context.start();
        context.registerModelObject(MockFactory.createModuleWithWiredComponents(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

     */
    public void testCompositeScopePropagation() throws Exception {
        EventContext ctx = new EventContextImpl();
        CompositeContext moduleComponentCtx = new CompositeContextImpl();
        moduleComponentCtx.setName("testMC");
        moduleComponentCtx.start();
        CompositeScopeContext scopeContainer = new CompositeScopeContext(ctx);
        scopeContainer.registerFactory(MockFactory.createCompositeConfiguration("CompositeComponent"));
        scopeContainer.start();
        CompositeContext child = (CompositeContext) scopeContainer.getContext("CompositeComponent");
        List<Extensible> models = createAssembly();
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.