Package org.apache.tuscany.spi.wire

Examples of org.apache.tuscany.spi.wire.InboundInvocationChain.prepare()


        expect(invoker.invoke(EasyMock.eq(msg))).andReturn(msg);
        replay(invoker);
        assertEquals(0, interceptor.getCount());
        connector.connect(inboundChain, outboundChain);
        inboundChain.setTargetInvoker(invoker);
        inboundChain.prepare();
        msg.setTargetInvoker(inboundChain.getTargetInvoker());
        assertEquals(msg, inboundChain.getHeadInterceptor().invoke(msg));
        assertEquals(1, interceptor.getCount());
        verify(invoker);
    }
View Full Code Here


        replay(invoker);
        assertEquals(0, sourceInterceptor.getCount());
        assertEquals(0, targetInterceptor.getCount());
        connector.connect(inboundChain, outboundChain);
        inboundChain.setTargetInvoker(invoker);
        inboundChain.prepare();
        msg.setTargetInvoker(inboundChain.getTargetInvoker());
        assertEquals(msg, inboundChain.getHeadInterceptor().invoke(msg));
        assertEquals(1, sourceInterceptor.getCount());
        assertEquals(1, targetInterceptor.getCount());
        verify(invoker);
View Full Code Here

        target.addInterceptor(new InvokerInterceptor());

        // connect the source to the target
        source.setTargetInterceptor(target.getHeadInterceptor());
        source.prepare();
        target.prepare();
        MockStaticInvoker invoker = new MockStaticInvoker(hello, new SimpleTargetImpl());
        source.setTargetInvoker(invoker);

        Message msg = new MessageImpl();
        msg.setBody("foo");
View Full Code Here

        String[] val = new String[]{"foo"};
        TargetInvoker invoker = createNiceMock(TargetInvoker.class);
        expect(invoker.invokeTarget(EasyMock.eq(val))).andReturn(val);
        replay(invoker);
        connector.connect(outboundChain, inboundChain, invoker, false);
        inboundChain.prepare();
        assertEquals(val, outboundChain.getTargetInvoker().invokeTarget(val));
        verify(invoker);
    }

View Full Code Here

        TargetInvoker invoker = createNiceMock(TargetInvoker.class);
        expect(invoker.invoke(EasyMock.eq(msg))).andReturn(msg);
        replay(invoker);
        assertEquals(0, interceptor.getCount());
        connector.connect(outboundChain, inboundChain, invoker, false);
        inboundChain.prepare();
        msg.setTargetInvoker(outboundChain.getTargetInvoker());
        assertEquals(msg, outboundChain.getHeadInterceptor().invoke(msg));
        assertEquals(1, interceptor.getCount());
        verify(invoker);
    }
View Full Code Here

        TargetInvoker invoker = createNiceMock(TargetInvoker.class);
        expect(invoker.invoke(EasyMock.eq(msg))).andReturn(msg);
        replay(invoker);
        assertEquals(0, interceptor.getCount());
        connector.connect(outboundChain, inboundChain, invoker, false);
        inboundChain.prepare();
        msg.setTargetInvoker(outboundChain.getTargetInvoker());
        assertEquals(msg, outboundChain.getHeadInterceptor().invoke(msg));
        assertEquals(1, interceptor.getCount());
        verify(invoker);
    }
View Full Code Here

        expect(invoker.invoke(EasyMock.eq(msg))).andReturn(msg);
        replay(invoker);
        assertEquals(0, sourceInterceptor.getCount());
        assertEquals(0, targetInterceptor.getCount());
        connector.connect(outboundChain, inboundChain, invoker, false);
        inboundChain.prepare();
        msg.setTargetInvoker(outboundChain.getTargetInvoker());
        assertEquals(msg, outboundChain.getHeadInterceptor().invoke(msg));
        assertEquals(1, sourceInterceptor.getCount());
        assertEquals(1, targetInterceptor.getCount());
        verify(invoker);
View Full Code Here

        InboundInvocationChain chain = new InboundInvocationChainImpl(operation);
        MockSyncInterceptor interceptor = new MockSyncInterceptor();
        chain.addInterceptor(interceptor);
        chain.addInterceptor(new InvokerInterceptor());
        chain.setTargetInvoker(invoker);
        chain.prepare();
        chains.put(echo, chain);
        WorkContext workContext = EasyMock.createNiceMock(WorkContext.class);
        EasyMock.replay(workContext);
        JDKInboundInvocationHandler handler = new JDKInboundInvocationHandler(chains, workContext);
        assertEquals("foo", handler.invoke(echo, new String[]{"foo"}));
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.