Package org.apache.tuscany.spi.component

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


*/
public class DuplicateRegistrationTestCase extends TestCase {

    public void testDuplicateRegistration() throws Exception {
        CompositeComponent parent = new CompositeComponentImpl(null, null, null, null);
        parent.start();

        List<Class<?>> interfaces = new ArrayList<Class<?>>();
        interfaces.add(Source.class);
        SystemAtomicComponent component1 = EasyMock.createMock(SystemAtomicComponent.class);
        EasyMock.expect(component1.getName()).andReturn("source").atLeastOnce();
View Full Code Here


    }

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

    }

    public void testTargetNotFound() {
        CompositeComponent composite = new CompositeComponentImpl("parent", null, null, null);
        composite.register(getReference("foo"));
        composite.start();
        try {
            composite.locateService(Foo.class, "foo1");
            fail();
        } catch (TargetNotFoundException e) {
            // expected
View Full Code Here

        listener.onEvent(isA(CompositeStart.class));
        listener.onEvent(eq(event));
        expectLastCall();
        replay(listener);
        composite.addListener(listener);
        composite.start();
        composite.onEvent(event);
    }

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

        ConnectorImpl connector = new ConnectorImpl();
        connector.connect(component);

        deploymentContext.getModuleScope().start();
        component.start();
        CompositeComponent sourceComponent = (CompositeComponent) component.getChild("SourceComponent");
        Source source = (Source) sourceComponent.getServiceInstance("InnerSourceService");
        assertNotNull(source);
        AtomicComponent innerSourceComponent = (AtomicComponent) sourceComponent.getChild("InnerSourceComponent");
        Source innerSourceInstance = (Source) deploymentContext.getModuleScope().getInstance(innerSourceComponent);
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.