Package org.apache.tuscany.core.component.scope

Examples of org.apache.tuscany.core.component.scope.StatelessScopeContainer.start()


    public void testModuleToStateless() throws Exception {
        WorkContext ctx = new WorkContextImpl();
        ScopeContainer moduleScope = new ModuleScopeContainer(ctx);
        moduleScope.start();
        ScopeContainer statelessScope = new StatelessScopeContainer(ctx);
        statelessScope.start();

        Map<String, AtomicComponent> contexts = MockFactory.createWiredComponents("source", SourceImpl.class,
            moduleScope, members, "target", Target.class, TargetImpl.class, statelessScope);
        moduleScope.onEvent(new CompositeStart(this, null));
View Full Code Here


    public void testSessionToStateless() throws Exception {
        WorkContext ctx = new WorkContextImpl();
        ScopeContainer sessionScope = new HttpSessionScopeContainer(ctx);
        sessionScope.start();
        ScopeContainer statelessScope = new StatelessScopeContainer(ctx);
        statelessScope.start();

        Map<String, AtomicComponent> contexts = MockFactory.createWiredComponents("source", SourceImpl.class,
            sessionScope, members, "target", Target.class, TargetImpl.class, statelessScope);

        Object session1 = new Object();
View Full Code Here

    public void testRequestToStateless() throws Exception {
        WorkContext ctx = new WorkContextImpl();
        ScopeContainer requestScope = new RequestScopeContainer(ctx);
        requestScope.start();
        ScopeContainer statelessScope = new StatelessScopeContainer(ctx);
        statelessScope.start();

        Map<String, AtomicComponent> contexts = MockFactory.createWiredComponents("source", SourceImpl.class,
            requestScope, members, "target", Target.class, TargetImpl.class, statelessScope);

        AtomicComponent sourceComponent = contexts.get("source");
View Full Code Here

     * Tests a stateless-to-stateless scoped wire is setup properly by the runtime
     */
    public void testStatelessToStateless() throws Exception {
        WorkContext ctx = new WorkContextImpl();
        ScopeContainer statelessScope = new StatelessScopeContainer(ctx);
        statelessScope.start();

        Map<String, AtomicComponent> contexts = MockFactory.createWiredComponents("source", SourceImpl.class,
            statelessScope, members, "target", Target.class, TargetImpl.class, statelessScope);

        AtomicComponent sourceComponent = contexts.get("source");
View Full Code Here

    public void testStatelessToRequest() throws Exception {
        WorkContext ctx = new WorkContextImpl();
        final ScopeContainer requestScope = new RequestScopeContainer(ctx);
        requestScope.start();
        ScopeContainer statelessScope = new StatelessScopeContainer(ctx);
        statelessScope.start();

        Map<String, AtomicComponent> contexts = MockFactory.createWiredComponents("source", SourceImpl.class,
            statelessScope, members, "target", Target.class, TargetImpl.class, requestScope);
        requestScope.onEvent(new RequestStart(this));
        AtomicComponent sourceComponent = contexts.get("source");
View Full Code Here

     * Tests a stateless-to-session scoped wire is setup properly by the runtime
     */
    public void testStatelessToSession() throws Exception {
        WorkContext ctx = new WorkContextImpl();
        ScopeContainer statelessScope = new StatelessScopeContainer(ctx);
        statelessScope.start();
        ScopeContainer sessionScope = new HttpSessionScopeContainer(ctx);
        sessionScope.start();

        Map<String, AtomicComponent> contexts = MockFactory.createWiredComponents("source", SourceImpl.class,
            statelessScope, members, "target", Target.class, TargetImpl.class, sessionScope);
View Full Code Here

     * Tests a stateless-to-module scoped wire is setup properly by the runtime
     */
    public void testStatelessToModule() throws Exception {
        WorkContext ctx = new WorkContextImpl();
        ScopeContainer statelessScope = new StatelessScopeContainer(ctx);
        statelessScope.start();
        ScopeContainer moduleScope = new ModuleScopeContainer(ctx);
        moduleScope.start();

        Map<String, AtomicComponent> contexts = MockFactory.createWiredComponents("source", SourceImpl.class,
            statelessScope, members, "target", Target.class, TargetImpl.class, moduleScope);
View Full Code Here

    private WorkContext workContext = new WorkContextImpl();
    private WireService wireService = new JDKWireService(new WorkContextImpl(), null);

    public void testToStatelessScope() throws Exception {
        StatelessScopeContainer scope = new StatelessScopeContainer(workContext);
        scope.start();
        final OutboundWire wire = getWire(scope);
        Target service = (Target) wireService.createProxy(wire);
        assertNotNull(service);
        service.setString("foo");
        assertEquals(null, service.getString());
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.