Package org.apache.tuscany.core.context.scope

Examples of org.apache.tuscany.core.context.scope.SessionScopeContext.stop()


    public void testSetNullComponents() throws Exception {
        EventContext ctx = new EventContextImpl();
        SessionScopeContext scope = new SessionScopeContext(ctx);
        scope.registerFactories(new ArrayList<ContextFactory<Context>>());
        scope.start();
        scope.stop();
    }

    public void testGetContextByKey() throws Exception {
        EventContext ctx = new EventContextImpl();
        SessionScopeContext scope = new SessionScopeContext(ctx);
View Full Code Here


        // shutdown sessions
        scope.onEvent(new HttpSessionEnd(this, session));
        scope.onEvent(new HttpSessionEnd(this, session2));

        scope.stop();
    }

    public void testRegisterContextBeforeSession() throws Exception {
        EventContext ctx = new EventContextImpl();
        SessionScopeContext scope = new SessionScopeContext(ctx);
View Full Code Here

        scope.onEvent(new HttpSessionEnd(this, session));
        Assert.assertTrue(comp2.isDestroyed());

        scope.onEvent(new HttpSessionEnd(this, session2));
        Assert.assertTrue(comp3.isDestroyed());
        scope.stop();
    }

    /**
     * Tests runtime context registration
     */
 
View Full Code Here

        scope.onEvent(new HttpSessionEnd(this, session));
        Assert.assertTrue(comp2.isDestroyed());

        scope.onEvent(new HttpSessionEnd(this, session2));
        Assert.assertTrue(comp3.isDestroyed());
        scope.stop();
    }

    private List<ContextFactory<Context>> createConfigurations() throws BuilderException, ConfigurationLoadException {
        WireFactoryService wireService = new DefaultWireFactoryService(new MessageFactoryImpl(), new JDKWireFactoryFactory(), new DefaultPolicyBuilderRegistry());
        JavaContextFactoryBuilder builder = new JavaContextFactoryBuilder(wireService);
View Full Code Here

        Assert.assertNotSame(comp1, comp3); // should be different instances
        ctx.clearIdentifier(HttpSessionEvent.HTTP_IDENTIFIER);

        scope.onEvent(new HttpSessionEnd(this, session));
        scope.onEvent(new HttpSessionEnd(this, session2));
        scope.stop();
    }

    /**
     * Tests setting no components in the scope
     */
 
View Full Code Here

        // expire session
        scope.onEvent(new HttpSessionEnd(this,session));
        Assert.assertTrue(initDestroy.isDestroyed());
        Assert.assertTrue(destroyOnly.isDestroyed());

        scope.stop();
    }

    /**
     * Test instances destroyed in proper (i.e. reverse) order
     */
 
View Full Code Here

        ctx.clearIdentifier(HttpSessionEvent.HTTP_IDENTIFIER);

        // expire session
        scope.onEvent(new HttpSessionEnd(this, session));
        Assert.assertEquals(0, one.getNumberInstantiated());
        scope.stop();
    }

    JavaContextFactoryBuilder builder;

    private List<ContextFactory<Context>> createComponents() throws BuilderException, ConfigurationLoadException {
View Full Code Here

        assertNotNull(source.getPojo());
        // expire module
        assertEquals(2,source.getNumberInstantiated());
        scope.onEvent(new HttpSessionEnd(this,session));
        assertEquals(0,source.getNumberInstantiated());
        scope.stop();
    }


    public void testInitDestroyOrderRequestScope() throws Exception {
        EventContext ctx = new EventContextImpl();
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.