Package org.apache.tuscany.spi.component

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


            AtomicComponent atomic = (AtomicComponent) child;
            registerAutowire(atomic);
        } else if (child instanceof CompositeComponent) {
            CompositeComponent component = (CompositeComponent) child;
            if (lifecycleState == RUNNING && component.getLifecycleState() == UNINITIALIZED) {
                component.start();
            }
            registerAutowire(component);
            addListener(component);
        }
    }
View Full Code Here


*/
public class CompositeComponentResolutionTestCase extends TestCase {

    public void testSystemComponentResolution() throws NoSuchMethodException {
        CompositeComponent parent = new CompositeComponentImpl("foo", null, null, null);
        parent.start();
        List<Class<?>> interfaces = new ArrayList<Class<?>>();
        interfaces.add(Source.class);
        Source originalSource = new SourceImpl();
        SystemAtomicComponent component = EasyMock.createMock(SystemAtomicComponent.class);
        EasyMock.expect(component.getName()).andReturn("source").atLeastOnce();
View Full Code Here

        EasyMock.verify(component);
    }

    public void testLocateSystemService() throws NoSuchMethodException {
        CompositeComponent parent = new CompositeComponentImpl("foo", null, null, null);
        parent.start();
        List<Class<?>> interfaces = new ArrayList<Class<?>>();
        interfaces.add(Source.class);
        Source originalSource = new SourceImpl();
        SystemAtomicComponent component = EasyMock.createMock(SystemAtomicComponent.class);
        EasyMock.expect(component.getName()).andReturn("source").atLeastOnce();
View Full Code Here

        EasyMock.verify(component);
    }

    public void testLocateService() throws NoSuchMethodException {
        CompositeComponent parent = new CompositeComponentImpl("foo", null, null, null);
        parent.start();
        List<Class<?>> interfaces = new ArrayList<Class<?>>();
        interfaces.add(Source.class);
        Source originalSource = new SourceImpl();
        AtomicComponent component = EasyMock.createMock(AtomicComponent.class);
        EasyMock.expect(component.getName()).andReturn("source").atLeastOnce();
View Full Code Here

        EasyMock.verify(component);
    }

    public void testComponentResolution() throws NoSuchMethodException {
        CompositeComponent parent = new CompositeComponentImpl("foo", null, null, null);
        parent.start();
        List<Class<?>> interfaces = new ArrayList<Class<?>>();
        interfaces.add(Source.class);
        Source originalSource = new SourceImpl();
        AtomicComponent component = EasyMock.createMock(AtomicComponent.class);
        EasyMock.expect(component.getName()).andReturn("source").atLeastOnce();
View Full Code Here

    }


    public void testGetService() throws NoSuchMethodException {
        CompositeComponent parent = new CompositeComponentImpl("foo", null, null, null);
        parent.start();
        Service service = EasyMock.createMock(Service.class);
        EasyMock.expect(service.getName()).andReturn("source").atLeastOnce();
        EasyMock.expect(service.isSystem()).andReturn(false).atLeastOnce();
        service.getInterface();
        EasyMock.expectLastCall().andReturn(Source.class);
View Full Code Here

        EasyMock.verify(service);
    }

    public void testSystemGetService() throws NoSuchMethodException {
        CompositeComponent parent = new CompositeComponentImpl("foo", null, null, null);
        parent.start();
        Service service = EasyMock.createMock(Service.class);
        EasyMock.expect(service.getName()).andReturn("source").atLeastOnce();
        EasyMock.expect(service.isSystem()).andReturn(true).atLeastOnce();
        service.getInterface();
        EasyMock.expectLastCall().andReturn(Source.class);
View Full Code Here

    }

    public void testGetService() {
        CompositeComponent composite = new CompositeComponentImpl("parent", null, null, null);
        composite.register(new ServiceExtension("foo", null, null, null));
        composite.start();
        assertNotNull(composite.getService("foo"));
    }

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

    }

    public void testServiceNotFound() {
        CompositeComponent composite = new CompositeComponentImpl("parent", null, null, null);
        composite.register(new ServiceExtension("foo", null, null, null));
        composite.start();
        try {
            composite.getService("bar");
            fail();
        } catch (ComponentNotFoundException e) {
            // expected
View Full Code Here

        // load the boot2 file using the bootstrap deployer
        componentDefinition.setName("newDeployer");
        CompositeComponent component = (CompositeComponent) deployer.deploy(parent, componentDefinition);
        assertNotNull(component);
        verify(parent);
        component.start();
        Deployer newDeployer = (Deployer) component.getSystemServiceInstance("deployer");
        assertNotNull(newDeployer);

/*      // FIXME
        // load the boot2 file using the newly loaded deployer
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.