Package org.apache.tuscany.spi.component

Examples of org.apache.tuscany.spi.component.SystemAtomicComponent.stop()


        Object instance = context.getServiceInstance();
        assertSame(instance, context.getServiceInstance());

        scope.onEvent(new RequestEnd(this));
        scope.stop();
        context.stop();

        scope.start();
        context.start();
        assertNotSame(instance, context.getServiceInstance());
        scope.onEvent(new RequestEnd(this));
View Full Code Here


        scope.start();
        context.start();
        assertNotSame(instance, context.getServiceInstance());
        scope.onEvent(new RequestEnd(this));
        scope.stop();
        context.stop();
    }

    public static class InitDestroyOnce {

        private boolean initialized;
View Full Code Here

        Object instance = context.getServiceInstance();
        assertSame(instance, context.getServiceInstance());

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

        scope.start();
        scope.onEvent(new HttpSessionStart(this, session));
        context.start();
        assertNotSame(instance, context.getServiceInstance());
View Full Code Here

        scope.onEvent(new HttpSessionStart(this, session));
        context.start();
        assertNotSame(instance, context.getServiceInstance());
        scope.onEvent(new HttpSessionEnd(this, session));
        scope.stop();
        context.stop();
    }

    public static class InitDestroyOnce {

        private boolean initialized;
View Full Code Here

        List<Class<?>> interfaces = new ArrayList<Class<?>>();
        interfaces.add(Source.class);
        Source originalSource = new SourceImpl();
        SystemAtomicComponent component = EasyMock.createMock(SystemAtomicComponent.class);
        component.start();
        component.stop();
        EasyMock.expectLastCall().times(2);
        EasyMock.expect(component.getName()).andReturn("source").atLeastOnce();
        EasyMock.expect(component.isSystem()).andReturn(true).atLeastOnce();
        EasyMock.expect(component.getServiceInstance()).andReturn(originalSource).atLeastOnce();
        EasyMock.expect(component.getServiceInterfaces()).andReturn(interfaces);
View Full Code Here

        Object instance = context.getServiceInstance();
        assertSame(instance, context.getServiceInstance());

        scope.onEvent(new CompositeStop(this, null));
        scope.stop();
        context.stop();

        scope.start();
        scope.onEvent(new CompositeStart(this, null));
        context.start();
        assertNotSame(instance, context.getServiceInstance());
View Full Code Here

        scope.onEvent(new CompositeStart(this, null));
        context.start();
        assertNotSame(instance, context.getServiceInstance());
        scope.onEvent(new CompositeStop(this, null));
        scope.stop();
        context.stop();
    }

    public static class InitDestroyOnce {

        private boolean initialized;
View Full Code Here

        SystemAtomicComponent component = EasyMock.createMock(SystemAtomicComponent.class);
        component.start();
        EasyMock.expect(component.getName()).andReturn("bar").atLeastOnce();
        EasyMock.expect(component.getServiceInterfaces()).andReturn(services);
        EasyMock.expect(component.isSystem()).andReturn(true).atLeastOnce();
        component.stop();
        EasyMock.replay(component);
        parent.register(component);
        parent.start();
        parent.stop();
        EasyMock.verify(component);
View Full Code Here

        EasyMock.expect(component.getName()).andReturn("bar").atLeastOnce();
        EasyMock.expect(component.getServiceInterfaces()).andReturn(services);
        EasyMock.expect(component.getServiceInstance()).andReturn(new Foo() {
        });
        EasyMock.expect(component.isSystem()).andReturn(true).atLeastOnce();
        component.stop();
        EasyMock.replay(component);
        parent.register(component);
        parent.start();
        assertNull(parent.resolveSystemExternalInstance(Foo.class));
        assertNotNull(parent.resolveSystemInstance(Foo.class));
View Full Code Here

        EasyMock.expect(component.getName()).andReturn("bar").atLeastOnce();
        EasyMock.expect(component.getServiceInterfaces()).andReturn(services);
        EasyMock.expect(component.getServiceInstance()).andReturn(new Foo() {
        });
        EasyMock.expect(component.isSystem()).andReturn(false).atLeastOnce();
        component.stop();
        EasyMock.replay(component);
        parent.register(component);
        parent.start();
        assertNull(parent.resolveExternalInstance(Foo.class));
        assertNotNull(parent.resolveInstance(Foo.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.