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

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


        Assert.assertNotNull(comp1);
        // second request
        StatelessComponentImpl comp2 = (StatelessComponentImpl) scope.getContext("TestService1").getInstance(null);
        Assert.assertNotNull(comp2);
        Assert.assertNotSame(comp1, comp2);
        scope.stop();
    }

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


        scope.start();
        StatelessComponent comp1 = (StatelessComponent) scope.getContext("TestService1").getInstance(null);
        Assert.assertNotNull(comp1);
        StatelessComponent comp2 = (StatelessComponent) scope.getContext("NewTestService").getInstance(null);
        Assert.assertNotNull(comp2);
        scope.stop();
    }

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

        StatelessComponent comp1 = (StatelessComponent) scope.getContext("TestService1").getInstance(null);
        Assert.assertNotNull(comp1);
        scope.registerFactory(createConfiguration("NewTestService"));
        StatelessComponent comp2 = (StatelessComponent) scope.getContext("NewTestService").getInstance(null);
        Assert.assertNotNull(comp2);
        scope.stop();
    }

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

    public void testSetNullComponents() throws Exception {
        EventContext ctx = new EventContextImpl();
        StatelessScopeContext scope = new StatelessScopeContext(ctx);
        scope.registerFactories(createConfigurations());
        scope.start();
        scope.stop();
    }

    private List<ContextFactory<Context>> createConfigurations()
            throws NoSuchMethodException, BuilderException, ConfigurationLoadException {
        AtomicComponent component = MockFactory.createComponent("TestService1", StatelessComponentImpl.class,
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.