Package org.apache.tuscany.core.runtime

Examples of org.apache.tuscany.core.runtime.RuntimeContext


   
    /**
     * Tests a stateless-to-request scoped wire is setup properly by the runtime
     */
    public void testStatelessToRequest() throws Exception{
        RuntimeContext runtime = MockFactory.createJavaRuntime();
        Context ctx = runtime.getSystemContext().getContext("tuscany.system.child");
        Assert.assertNotNull(ctx);
        runtime.getRootContext().registerModelObject(MockFactory.createCompositeComponent("test"));
        CompositeContext testCtx = (CompositeContext) runtime.getRootContext().getContext("test");
        Assert.assertNotNull(testCtx);
        testCtx.registerModelObject(MockFactory.createModule(Scope.INSTANCE,Scope.REQUEST));
        testCtx.publish(new ModuleStart(this));
       
        // first request
View Full Code Here


    /**
     * Tests a stateless-to-session scoped wire is setup properly by the runtime
     */
    public void testStatelessToSession() throws Exception{
        RuntimeContext runtime = MockFactory.createJavaRuntime();
        Context ctx = runtime.getSystemContext().getContext("tuscany.system.child");
        Assert.assertNotNull(ctx);
        runtime.getRootContext().registerModelObject(MockFactory.createCompositeComponent("test"));
        CompositeContext testCtx = (CompositeContext) runtime.getRootContext().getContext("test");
        Assert.assertNotNull(testCtx);
        testCtx.registerModelObject(MockFactory.createModule(Scope.INSTANCE,Scope.SESSION));
        testCtx.publish(new ModuleStart(this));
       
        // first session
View Full Code Here

   
    /**
     * Tests a stateless-to-module scoped wire is setup properly by the runtime
     */
    public void testStatelessToModule() throws Exception{
        RuntimeContext runtime = MockFactory.createJavaRuntime();
        Context ctx = runtime.getSystemContext().getContext("tuscany.system.child");
        Assert.assertNotNull(ctx);
        runtime.getRootContext().registerModelObject(MockFactory.createCompositeComponent("test"));
        CompositeContext testCtx = (CompositeContext) runtime.getRootContext().getContext("test");
        Assert.assertNotNull(testCtx);
        testCtx.registerModelObject(MockFactory.createModule(Scope.INSTANCE,Scope.MODULE));
        testCtx.publish(new ModuleStart(this));
       
        Object id = new Object();
View Full Code Here

   
    /**
     * Tests the runtime can be bootstrapped with Java builders and two module-scoped Java-based components can be wired
     */
    public void testRuntimeBoot() throws Exception{
        RuntimeContext runtime = MockFactory.createJavaRuntime();
        Context ctx = runtime.getSystemContext().getContext(MockFactory.SYSTEM_CHILD);
        Assert.assertNotNull(ctx);
        runtime.getRootContext().registerModelObject(MockFactory.createCompositeComponent("test"));
        CompositeContext testCtx = (CompositeContext) runtime.getRootContext().getContext("test");
        Assert.assertNotNull(testCtx);
        testCtx.registerModelObject(MockFactory.createModule());
        testCtx.publish(new ModuleStart(this));
        GenericComponent source = (GenericComponent)testCtx.getContext("source").getInstance(null);
        Assert.assertNotNull(source);
View Full Code Here

TOP

Related Classes of org.apache.tuscany.core.runtime.RuntimeContext

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.