Package org.apache.tuscany.core.context

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


        Assert.assertEquals("foo",target.getString());
        testCtx.publish(new RequestEnd(this,new Object()));

        //second request for session
        Object id2 = new Object();
        testCtx.publish(new RequestStart(this,id2));
        testCtx.publish(new HttpSessionBound(this,session));
        GenericComponent targetR2 = (GenericComponent)testCtx.getContext("target").getInstance(null);
        Assert.assertEquals("foo",targetR2.getString());
        GenericComponent sourceR2 = (GenericComponent)testCtx.getContext("source").getInstance(null);
        Assert.assertNotNull(sourceR2);
View Full Code Here


        testCtx.publish(new RequestEnd(this,new Object()));

        //second request for session
        Object id2 = new Object();
        testCtx.publish(new RequestStart(this,id2));
        testCtx.publish(new HttpSessionBound(this,session));
        GenericComponent targetR2 = (GenericComponent)testCtx.getContext("target").getInstance(null);
        Assert.assertEquals("foo",targetR2.getString());
        GenericComponent sourceR2 = (GenericComponent)testCtx.getContext("source").getInstance(null);
        Assert.assertNotNull(sourceR2);
        Assert.assertEquals("foo",sourceR2.getGenericComponent().getString());
View Full Code Here

        Assert.assertEquals("foo",targetR2.getString());
        GenericComponent sourceR2 = (GenericComponent)testCtx.getContext("source").getInstance(null);
        Assert.assertNotNull(sourceR2);
        Assert.assertEquals("foo",sourceR2.getGenericComponent().getString());
       
        testCtx.publish(new RequestEnd(this,new Object()));

        //second session
        Object session2 = new Object();
        Object id3 = new Object();
        testCtx.publish(new RequestStart(this,id3));
View Full Code Here

        testCtx.publish(new RequestEnd(this,new Object()));

        //second session
        Object session2 = new Object();
        Object id3 = new Object();
        testCtx.publish(new RequestStart(this,id3));
        testCtx.publish(new HttpSessionBound(this,session2));
        GenericComponent source2 = (GenericComponent)testCtx.getContext("source").getInstance(null);
        Assert.assertNotNull(source2);
        GenericComponent target2 = (GenericComponent)testCtx.getContext("target").getInstance(null);
View Full Code Here

        //second session
        Object session2 = new Object();
        Object id3 = new Object();
        testCtx.publish(new RequestStart(this,id3));
        testCtx.publish(new HttpSessionBound(this,session2));
        GenericComponent source2 = (GenericComponent)testCtx.getContext("source").getInstance(null);
        Assert.assertNotNull(source2);
        GenericComponent target2 = (GenericComponent)testCtx.getContext("target").getInstance(null);

        Assert.assertNotNull(target2);
View Full Code Here

        Assert.assertEquals(null,source2.getGenericComponent().getString());
        source2.getGenericComponent().setString("baz");
        Assert.assertEquals("baz",source2.getGenericComponent().getString());
        Assert.assertEquals("baz",target2.getString());
       
        testCtx.publish(new RequestEnd(this,session2));
        Object id4 = new Object();
        testCtx.publish(new RequestStart(this,id4));
        testCtx.publish(new HttpSessionBound(this,session));
        testCtx.publish(new RequestEnd(this,session));
View Full Code Here

        Assert.assertEquals("baz",source2.getGenericComponent().getString());
        Assert.assertEquals("baz",target2.getString());
       
        testCtx.publish(new RequestEnd(this,session2));
        Object id4 = new Object();
        testCtx.publish(new RequestStart(this,id4));
        testCtx.publish(new HttpSessionBound(this,session));
        testCtx.publish(new RequestEnd(this,session));

    }
View Full Code Here

        Assert.assertEquals("baz",target2.getString());
       
        testCtx.publish(new RequestEnd(this,session2));
        Object id4 = new Object();
        testCtx.publish(new RequestStart(this,id4));
        testCtx.publish(new HttpSessionBound(this,session));
        testCtx.publish(new RequestEnd(this,session));

    }

   
View Full Code Here

       
        testCtx.publish(new RequestEnd(this,session2));
        Object id4 = new Object();
        testCtx.publish(new RequestStart(this,id4));
        testCtx.publish(new HttpSessionBound(this,session));
        testCtx.publish(new RequestEnd(this,session));

    }

   
    /**
 
View Full Code Here

        MockInterceptorBuilder interceptorBuilder = new MockInterceptorBuilder(mockInterceptor, false);
        registry.registerTargetBuilder(interceptorBuilder);
        runtime.getRootContext().registerModelObject(MockFactory.createCompositeComponent("test.module"));
        CompositeContext child = (CompositeContext) runtime.getRootContext().getContext("test.module");
        child.registerModelObject(MockFactory.createModuleWithEntryPoint(Scope.MODULE));
        child.publish(new ModuleStart(this));
        Object id = new Object();
        child.publish(new RequestStart(this, id));
        EntryPointContext ctx = (EntryPointContext) child.getContext("source");
        Assert.assertNotNull(ctx);
        InvocationHandler handler = (InvocationHandler) ctx.getHandler();
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.