Package org.apache.tuscany.spi.component

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


    public void testLifecycle() throws Exception {
        CompositeComponent composite = new CompositeComponentImpl("foo", null, null, null);
        composite.start();
        assertNull(composite.getChild("nothtere"));
        composite.stop();
        composite.start();
        assertNull(composite.getChild("nothtere"));
        composite.stop();
    }
View Full Code Here


        composite.start();
        assertNull(composite.getChild("nothtere"));
        composite.stop();
        composite.start();
        assertNull(composite.getChild("nothtere"));
        composite.stop();
    }

    public void testSystemRestart() throws NoSuchMethodException {
        List<Class<?>> interfaces = new ArrayList<Class<?>>();
        interfaces.add(Source.class);
View Full Code Here

        composite.register(component);

        AtomicComponent atomicComponent = (AtomicComponent) composite.getSystemChild("source");
        Source source = (Source) atomicComponent.getServiceInstance();
        assertNotNull(source);
        composite.stop();
        composite.start();
        atomicComponent = (AtomicComponent) composite.getSystemChild("source");
        Source source2 = (Source) atomicComponent.getServiceInstance();
        assertNotNull(source2);
        composite.stop();
View Full Code Here

        composite.stop();
        composite.start();
        atomicComponent = (AtomicComponent) composite.getSystemChild("source");
        Source source2 = (Source) atomicComponent.getServiceInstance();
        assertNotNull(source2);
        composite.stop();
        EasyMock.verify(component);
    }

    public void testRestart() throws NoSuchMethodException {
        List<Class<?>> interfaces = new ArrayList<Class<?>>();
View Full Code Here

        composite.register(component);

        AtomicComponent atomicComponent = (AtomicComponent) composite.getChild("source");
        Source source = (Source) atomicComponent.getServiceInstance();
        assertNotNull(source);
        composite.stop();
        composite.start();
        atomicComponent = (AtomicComponent) composite.getChild("source");
        Source source2 = (Source) atomicComponent.getServiceInstance();
        assertNotNull(source2);
        composite.stop();
View Full Code Here

        composite.stop();
        composite.start();
        atomicComponent = (AtomicComponent) composite.getChild("source");
        Source source2 = (Source) atomicComponent.getServiceInstance();
        assertNotNull(source2);
        composite.stop();
        EasyMock.verify(component);
    }

    public void testChildStoppedBeforeParent() {
        CompositeComponent parent = new CompositeComponentImpl("parent", null, null, null);
View Full Code Here

    public void testChildStoppedBeforeParent() {
        CompositeComponent parent = new CompositeComponentImpl("parent", null, null, null);
        CompositeComponent child = new CompositeComponentImpl("child", null, null, null);
        parent.register(child);
        parent.start();
        child.stop();
        parent.stop();
    }

    protected void setUp() throws Exception {
        super.setUp();
View Full Code Here

        EasyMock.expect(component.isSystem()).andReturn(true).atLeastOnce();
        component.stop();
        EasyMock.replay(component);
        parent.register(component);
        parent.start();
        parent.stop();
        EasyMock.verify(component);
    }

    public void testComponentLifecycle() throws Exception {
        List<Class<?>> services = new ArrayList<Class<?>>();
View Full Code Here

        EasyMock.expect(component.isSystem()).andReturn(false).atLeastOnce();
        component.stop();
        EasyMock.replay(component);
        parent.register(component);
        parent.start();
        parent.stop();
        EasyMock.verify(component);
    }

    public void testSystemServiceAutowire() throws Exception {
        List<Class<?>> services = new ArrayList<Class<?>>();
View Full Code Here

        EasyMock.replay(component);
        parent.register(component);
        parent.start();
        assertNull(parent.resolveSystemExternalInstance(Foo.class));
        assertNotNull(parent.resolveSystemInstance(Foo.class));
        parent.stop();
        EasyMock.verify(component);
    }


    public void testAutowire() throws Exception {
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.