Package org.apache.tuscany.core.mock.component

Examples of org.apache.tuscany.core.mock.component.Target


        CompositeContext context = (CompositeContext) runtime.getSystemContext().getContext("test.system");
        context.publish(new ModuleStart(this));
        //context.registerModelObject(module);
        Source source = (Source) ((AtomicContext)context.getContext("source")).getTargetInstance();
        Assert.assertNotNull(source);
        Target targetRef = source.getTarget();
        Assert.assertNotNull(targetRef);
        Target target = (Target) ((AtomicContext)context.getContext("target")).getTargetInstance();
        Assert.assertSame(target, targetRef);
        Source source2 = (Source) ((AtomicContext)context.getContext("source")).getTargetInstance();
        Assert.assertSame(target, source2.getTarget());
        context.publish(new ModuleStop(this));
        context.stop();
View Full Code Here


        context.publish(new ModuleStart(this));
        context.registerModelObject(MockFactory.createSystemModuleWithWiredComponents("system.module",Scope.MODULE,Scope.MODULE));
        Source source = (Source) ((AtomicContext)context.getContext("source")).getTargetInstance();
        Assert.assertNotNull(source);
        Target targetRef = source.getTarget();
        Assert.assertNotNull(targetRef);
        Target target = (Target) ((AtomicContext)context.getContext("target")).getTargetInstance();
        Assert.assertSame(target, targetRef);
        Source source2 = (Source) ((AtomicContext)context.getContext("source")).getTargetInstance();
        Assert.assertSame(target, source2.getTarget());
        context.publish(new ModuleStop(this));
        context.stop();
View Full Code Here

public class AtomicComponentWireInvocationTestCase extends TestCase {

    public void testWireResolution() throws NoSuchMethodException {
        ModuleScopeContainer scope = new ModuleScopeContainer(null);
        scope.start();
        Target target = new TargetImpl();
        SystemInboundWire inboundWire = EasyMock.createMock(SystemInboundWire.class);
        EasyMock.expect(inboundWire.getTargetService()).andReturn(target);
        EasyMock.replay(inboundWire);

        PojoConfiguration configuration = new PojoConfiguration();
View Full Code Here

* @version $$Rev: 441935 $$ $$Date: 2006-09-10 02:57:47 -0700 (Sun, 10 Sep 2006) $$
*/
public class SystemInboundtoOutboundTestCase extends TestCase {

    public void testWire() throws NoSuchMethodException {
        Target target = new TargetImpl();
        SystemOutboundWire outboundWire = EasyMock.createMock(SystemOutboundWire.class);
        EasyMock.expect(outboundWire.getTargetService()).andReturn(target);
        EasyMock.replay(outboundWire);
        SystemInboundWire inboundWire = new SystemInboundWireImpl("service", Target.class);
        inboundWire.setTargetWire(outboundWire);
View Full Code Here

* @version $$Rev: 441935 $$ $$Date: 2006-09-10 02:57:47 -0700 (Sun, 10 Sep 2006) $$
*/
public class SystemServiceComponentWireTestCase extends TestCase {

    public void testServiceContext() throws NoSuchMethodException {
        Target target = new TargetImpl();
        SystemOutboundWire outboundWire = EasyMock.createMock(SystemOutboundWire.class);
        EasyMock.expect(outboundWire.getTargetService()).andReturn(target);
        EasyMock.replay(outboundWire);
        SystemInboundWire wire = new SystemInboundWireImpl("Target", Target.class);
        SystemService serviceContext = new SystemServiceImpl("service", null);
View Full Code Here

* @version $$Rev: 441935 $$ $$Date: 2006-09-10 02:57:47 -0700 (Sun, 10 Sep 2006) $$
*/
public class SystemOutboundToInboundTestCase extends TestCase {

    public void testWire() throws NoSuchMethodException {
        Target target = new TargetImpl();
        SystemInboundWire inboundWire = EasyMock.createMock(SystemInboundWire.class);
        EasyMock.expect(inboundWire.getTargetService()).andReturn(target);
        EasyMock.replay(inboundWire);
        QualifiedName qName = new QualifiedName("service");
        SystemOutboundWire outboundWire = new SystemOutboundWireImpl("setTarget", qName, Target.class);
View Full Code Here

        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);
        assertSame(target, source.getTarget());
        scope.onEvent(new CompositeStop(this, parent));
        parent.stop();
        scope.stop();
View Full Code Here

        grandParent.register(parent);
        grandParent.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);
        assertSame(target, source.getTarget());
        scope.onEvent(new CompositeStop(this, parent));
        grandParent.stop();
        scope.stop();
View Full Code Here

        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);
        assertSame(target, target2);
        scope.onEvent(new CompositeStop(this, parent));
        parent.stop();
        scope.stop();
View Full Code Here

TOP

Related Classes of org.apache.tuscany.core.mock.component.Target

Copyright © 2018 www.massapicom. 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.