Package org.apache.tuscany.spi.component

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


        });
        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));
        parent.stop();
        EasyMock.verify(component);
    }
View Full Code Here


        });
        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));
        parent.stop();
        EasyMock.verify(component);
    }
View Full Code Here

    /**
     * Tests autowiring to an system atomic component
     */
    public void testSystemAtomicAutowire() throws Exception {
        CompositeComponent parent = new CompositeComponentImpl("parent", null, null, null);
        parent.start();

        List<Class<?>> interfaces = new ArrayList<Class<?>>();
        interfaces.add(Source.class);
        interfaces.add(Source2.class);
        Source originalSource = new SourceImpl();
View Full Code Here

    /**
     * Tests autowiring to an system atomic component
     */
    public void testAtomicAutowire() throws Exception {
        CompositeComponent parent = new CompositeComponentImpl("parent", null, null, null);
        parent.start();

        List<Class<?>> interfaces = new ArrayList<Class<?>>();
        interfaces.add(Source.class);
        interfaces.add(Source2.class);
        Source originalSource = new SourceImpl();
View Full Code Here

    /**
     * Tests autowiring to a system service which is wired to an atomic component.
     */
    public void testSystemServiceAutowire() throws Exception {
        CompositeComponent parent = new CompositeComponentImpl("parent", null, null, null);
        parent.start();

        List<Class<?>> interfaces = new ArrayList<Class<?>>();
        interfaces.add(Source.class);
        interfaces.add(Source2.class);

View Full Code Here

    /**
     * Tests autowiring to a system service which is wired to an atomic component.
     */
    public void testServiceAutowire() throws Exception {
        CompositeComponent parent = new CompositeComponentImpl("parent", null, null, null);
        parent.start();

        List<Class<?>> interfaces = new ArrayList<Class<?>>();
        interfaces.add(Source.class);
        interfaces.add(Source2.class);

View Full Code Here

    /**
     * Tests autowiring to a system reference
     */
    public void testSystemReferenceAutowire() throws Exception {
        CompositeComponent parent = new CompositeComponentImpl("parent", null, null, null);
        parent.start();

        Source refSource = new SourceImpl();
        SystemReference reference = EasyMock.createMock(SystemReference.class);
        EasyMock.expect(reference.getName()).andReturn("service").atLeastOnce();
        EasyMock.expect(reference.getServiceInstance()).andReturn(refSource);
View Full Code Here

    /**
     * Tests autowiring to a reference
     */
    public void testReferenceAutowire() throws Exception {
        CompositeComponent parent = new CompositeComponentImpl("parent", null, null, null);
        parent.start();
        Source refSource = new SourceImpl();
        Reference reference = EasyMock.createMock(Reference.class);
        EasyMock.expect(reference.getName()).andReturn("service").atLeastOnce();
        EasyMock.expect(reference.getServiceInstance()).andReturn(refSource);
        EasyMock.expect(reference.isSystem()).andReturn(false).atLeastOnce();
View Full Code Here

        AtomicComponent targetComponent = builder.build(parent, targetComponentDefinition, deploymentContext);

        parent.register(sourceComponent);
        parent.register(targetComponent);
        parent.prepare();
        parent.start();
        scope.onEvent(new CompositeStart(this, parent));
        Source source = (Source) parent.getSystemChild("source").getServiceInstance();
        assertNotNull(source);
        Target target = (Target) parent.getSystemChild("target").getServiceInstance();
        assertNotNull(target);
View Full Code Here

        parent.register(service);

        connector.connect(sourceComponent);
        connector.connect(service);

        parent.start();
        scope.onEvent(new CompositeStart(this, parent));
        Target target = (Target) parent.getSystemChild("serviceDefinition").getServiceInstance();
        assertNotNull(target);
        Target target2 = (Target) parent.getSystemChild("target").getServiceInstance();
        assertNotNull(target);
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.