Package org.apache.tuscany.spi.wire

Examples of org.apache.tuscany.spi.wire.InboundWire


        configuration.setInstanceFactory(new PojoObjectFactory<TargetImpl>(TargetImpl.class.getConstructor()));
        configuration.addServiceInterface(Target.class);
        configuration.setWireService(new JDKWireService());
        final JavaAtomicComponent component = new JavaAtomicComponent("target", configuration, null);

        InboundWire wire = createMock(InboundWire.class);

        JavaServiceContract contract = new JavaServiceContract(Target.class);
        EasyMock.expect(wire.getServiceContract()).andReturn(contract).anyTimes();
        expect(wire.getServiceName()).andReturn("Target");
        Map<Operation<?>, InboundInvocationChain> chains = new HashMap<Operation<?>, InboundInvocationChain>();
        expect(wire.getInvocationChains()).andReturn(chains);
        expect(wire.getCallbackReferenceName()).andReturn(null);
        replay(wire);
        component.addInboundWire(wire);
        component.prepare();
        component.start();
        assertTrue(component.getServiceInstance("Target") instanceof Target);
View Full Code Here


public class ConnectorPostProcessTestCase extends TestCase {

    public void testInboundToOutboundPostProcessCalled() throws Exception {
        OutboundWire owire = createNiceMock(OutboundWire.class);
        replay(owire);
        InboundWire iwire = createNiceMock(InboundWire.class);
        Map<Operation<?>, InboundInvocationChain> chains = new HashMap<Operation<?>, InboundInvocationChain>();
        expect(iwire.getInvocationChains()).andReturn(chains);
        replay(iwire);
        WirePostProcessorRegistry registry = createMock(WirePostProcessorRegistry.class);
        registry.process(EasyMock.eq(iwire), EasyMock.eq(owire));
        replay(registry);
        WireService wireService = createMock(WireService.class);
View Full Code Here

        Map<Operation<?>, OutboundInvocationChain> chains = new HashMap<Operation<?>, OutboundInvocationChain>();
        expect(owire.getInvocationChains()).andReturn(chains);
        Map<Operation<?>, InboundInvocationChain> ichains = new HashMap<Operation<?>, InboundInvocationChain>();
        expect(owire.getTargetCallbackInvocationChains()).andReturn(ichains);
        replay(owire);
        InboundWire iwire = createNiceMock(InboundWire.class);
        expect(iwire.getSourceCallbackInvocationChains("Component")).andReturn(chains);
        replay(iwire);
        WirePostProcessorRegistry registry = createMock(WirePostProcessorRegistry.class);
        registry.process(EasyMock.eq(owire), EasyMock.eq(iwire));
        replay(registry);
        WireService wireService = createMock(WireService.class);
View Full Code Here

        context.setCurrentMessageId(null);
        context.setCurrentCorrelationId(id);
        replay(context);
        Method method = AsyncTarget.class.getMethod("invoke");
        method.setAccessible(true);
        InboundWire wire = createMock(InboundWire.class);
        AsyncJavaTargetInvoker invoker =
            new AsyncJavaTargetInvoker(method, wire, component, monitor, context);
        invoker.invoke(msg);
        verify(target);
    }
View Full Code Here

                return null;
            }
        });
        replay(scheduler);
        WorkContext context = createMock(WorkContext.class);
        InboundWire wire = createMock(InboundWire.class);
        Method method = AsyncTarget.class.getMethod("invoke");
        method.setAccessible(true);
        AsyncJavaTargetInvoker invoker =
            new AsyncJavaTargetInvoker(method, wire, component, monitor, context);
        AsyncJavaTargetInvoker clone = invoker.clone();
View Full Code Here

        JavaAtomicComponent source = new JavaAtomicComponent("source", configuration, null);
        OutboundWire outboundWire = createOutboundWire(new QualifiedName("target/Target"), Target.class);
        outboundWire.setContainer(source);
        source.addOutboundWire(outboundWire);
        JavaAtomicComponent target = new JavaAtomicComponent("target", configuration, null);
        InboundWire targetWire = MockFactory.createTargetWire("Target", Target.class);
        targetWire.setContainer(target);
        target.addInboundWire(targetWire);
        InboundWire inboundWire = target.getInboundWire("Target");
        inboundWire.setContainer(target);

        EasyMock.expect(parent.getChild("target")).andReturn(target);
        EasyMock.replay(parent);

        connector.connect(source);
View Full Code Here

TOP

Related Classes of org.apache.tuscany.spi.wire.InboundWire

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.