Package org.apache.tuscany.spi.component

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


        EasyMock.expect(component.getServiceInstance()).andReturn(originalSource).atLeastOnce();
        EasyMock.expect(component.getServiceInterfaces()).andReturn(interfaces);
        EasyMock.expect(component.isSystem()).andReturn(false).atLeastOnce();

        EasyMock.replay(component);
        parent.register(component);

        Source source = parent.resolveInstance(Source.class);
        assertNotNull(source);
        Source2 source2 = parent.resolveInstance(Source2.class);
        assertSame(source, source2);
View Full Code Here


        component.getInterface();
        EasyMock.expectLastCall().andReturn(Source.class).atLeastOnce();
        EasyMock.expect(component.isSystem()).andReturn(true).atLeastOnce();
        EasyMock.expect(component.getServiceInstance()).andReturn(serviceSource);
        EasyMock.replay(component);
        parent.register(component);


        SystemAtomicComponent component2 = EasyMock.createMock(SystemAtomicComponent.class);
        EasyMock.expect(component2.getName()).andReturn("source").atLeastOnce();
        EasyMock.expect(component2.getServiceInterfaces()).andReturn(interfaces).atLeastOnce();
View Full Code Here

        SystemAtomicComponent component2 = EasyMock.createMock(SystemAtomicComponent.class);
        EasyMock.expect(component2.getName()).andReturn("source").atLeastOnce();
        EasyMock.expect(component2.getServiceInterfaces()).andReturn(interfaces).atLeastOnce();
        EasyMock.expect(component2.isSystem()).andReturn(true).atLeastOnce();
        EasyMock.replay(component2);
        parent.register(component2);

        Source source = parent.resolveSystemExternalInstance(Source.class);
        assertSame(serviceSource, source);
        Source2 source2 = parent.resolveSystemExternalInstance(Source2.class);
        assertNull(source2);
View Full Code Here

        component.getInterface();
        EasyMock.expectLastCall().andReturn(Source.class).atLeastOnce();
        EasyMock.expect(component.isSystem()).andReturn(false).atLeastOnce();
        EasyMock.expect(component.getServiceInstance()).andReturn(serviceSource);
        EasyMock.replay(component);
        parent.register(component);


        AtomicComponent component2 = EasyMock.createMock(AtomicComponent.class);
        EasyMock.expect(component2.getName()).andReturn("source").atLeastOnce();
        EasyMock.expect(component2.getServiceInterfaces()).andReturn(interfaces).atLeastOnce();
View Full Code Here

        AtomicComponent component2 = EasyMock.createMock(AtomicComponent.class);
        EasyMock.expect(component2.getName()).andReturn("source").atLeastOnce();
        EasyMock.expect(component2.getServiceInterfaces()).andReturn(interfaces).atLeastOnce();
        EasyMock.expect(component2.isSystem()).andReturn(false).atLeastOnce();
        EasyMock.replay(component2);
        parent.register(component2);

        Source source = parent.resolveExternalInstance(Source.class);
        assertSame(serviceSource, source);
        Source2 source2 = parent.resolveExternalInstance(Source2.class);
        assertNull(source2);
View Full Code Here

        EasyMock.expect(reference.getServiceInstance()).andReturn(refSource);
        EasyMock.expect(reference.isSystem()).andReturn(true).atLeastOnce();
        reference.getInterface();
        EasyMock.expectLastCall().andReturn(Source.class);
        EasyMock.replay(reference);
        parent.register(reference);

        Source source = parent.resolveSystemInstance(Source.class);
        assertNotNull(source);
        assertNull(parent.resolveSystemExternalInstance(Source.class));
        EasyMock.verify(reference);
View Full Code Here

        EasyMock.expect(reference.getServiceInstance()).andReturn(refSource);
        EasyMock.expect(reference.isSystem()).andReturn(false).atLeastOnce();
        reference.getInterface();
        EasyMock.expectLastCall().andReturn(Source.class);
        EasyMock.replay(reference);
        parent.register(reference);

        Source source = parent.resolveInstance(Source.class);
        assertNotNull(source);
        assertNull(parent.resolveExternalInstance(Source.class));
        EasyMock.verify(reference);
View Full Code Here

            MockComponentFactory.createSourceWithTargetReference();

        AtomicComponent sourceComponent = builder.build(parent, sourceComponentDefinition, deploymentContext);
        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();
View Full Code Here

        AtomicComponent sourceComponent = builder.build(parent, sourceComponentDefinition, deploymentContext);
        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);
View Full Code Here

            MockComponentFactory.createSourceWithTargetReference();

        AtomicComponent sourceComponent = builder.build(parent, sourceComponentDefinition, deploymentContext);
        Reference reference = bindingBuilder.build(parent, targetReferenceDefinition, deploymentContext);

        parent.register(sourceComponent);
        parent.register(reference);
        connector.connect(reference.getInboundWire(), reference.getOutboundWire(), true);
        connector.connect(sourceComponent);
        grandParent.register(parent);
        grandParent.start();
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.