Package org.apache.tuscany.spi.wire

Examples of org.apache.tuscany.spi.wire.Interceptor.invoke()


        });
        replay(scheduler);
        WorkContext context = createMock(WorkContext.class);
        Message msg = new MessageImpl();
        Interceptor next = EasyMock.createMock(Interceptor.class);
        EasyMock.expect(next.invoke(EasyMock.eq(msg))).andReturn(msg);
        EasyMock.replay(next);
        Interceptor interceptor = new NonBlockingBridgingInterceptor(scheduler, context, next);
        interceptor.invoke(msg);
        verify(next);
    }
View Full Code Here


        Message msg = new MessageImpl();
        Interceptor next = EasyMock.createMock(Interceptor.class);
        EasyMock.expect(next.invoke(EasyMock.eq(msg))).andReturn(msg);
        EasyMock.replay(next);
        Interceptor interceptor = new NonBlockingBridgingInterceptor(scheduler, context, next);
        interceptor.invoke(msg);
        verify(next);
    }

}
View Full Code Here

            // dispatch the wire down the chain and get the response
            // TODO http://issues.apache.org/jira/browse/TUSCANY-777
            ClassLoader oldtccl = Thread.currentThread().getContextClassLoader();
            try {
                Thread.currentThread().setContextClassLoader(this.getClass().getClassLoader());
                resp = headInterceptor.invoke(msg);
            } finally {
                Thread.currentThread().setContextClassLoader(oldtccl);
            }
            Object body = resp.getBody();
            if (resp.isFault()) {
View Full Code Here

public class SynchronousBridgingInterceptorTestCase extends TestCase {

    public void testInvoke() throws Exception {
        Message msg = new MessageImpl();
        Interceptor next = EasyMock.createMock(Interceptor.class);
        EasyMock.expect(next.invoke(EasyMock.eq(msg))).andReturn(msg);
        EasyMock.replay(next);
        Interceptor interceptor = new SynchronousBridgingInterceptor(next);
        interceptor.invoke(msg);
        verify(next);
    }
View Full Code Here

        Message msg = new MessageImpl();
        Interceptor next = EasyMock.createMock(Interceptor.class);
        EasyMock.expect(next.invoke(EasyMock.eq(msg))).andReturn(msg);
        EasyMock.replay(next);
        Interceptor interceptor = new SynchronousBridgingInterceptor(next);
        interceptor.invoke(msg);
        verify(next);
    }

}
View Full Code Here

        expectLastCall().anyTimes();
        expect(msg.getBody()).andReturn(source).once().andReturn(target[0]).once().andReturn(source[0]);
        expect(msg.isFault()).andReturn(false).once();
        replay(msg);
        Interceptor next = createMock(Interceptor.class);
        expect(next.invoke(msg)).andReturn(msg);
        replay(next);
        interceptor.setNext(next);
        interceptor.invoke(msg);
        String result = (String)msg.getBody();
        Assert.assertEquals(source[0], result);
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.