Search in sources :

Example 6 with HeaderExchangeHandler

use of com.alibaba.dubbo.remoting.exchange.support.header.HeaderExchangeHandler in project dubbo by alibaba.

the class HeaderExchangeHandlerTest method test_received_request_oneway.

@Test
public void test_received_request_oneway() throws RemotingException {
    final Channel mchannel = new MockedChannel();
    final Person requestdata = new Person("charles");
    Request request = new Request();
    request.setTwoWay(false);
    request.setData(requestdata);
    ExchangeHandler exhandler = new MockedExchangeHandler() {

        public void received(Channel channel, Object message) throws RemotingException {
            Assert.assertEquals(requestdata, message);
        }
    };
    HeaderExchangeHandler hexhandler = new HeaderExchangeHandler(exhandler);
    hexhandler.received(mchannel, request);
}
Also used : ExchangeChannel(com.alibaba.dubbo.remoting.exchange.ExchangeChannel) Channel(com.alibaba.dubbo.remoting.Channel) HeaderExchangeHandler(com.alibaba.dubbo.remoting.exchange.support.header.HeaderExchangeHandler) Request(com.alibaba.dubbo.remoting.exchange.Request) HeaderExchangeHandler(com.alibaba.dubbo.remoting.exchange.support.header.HeaderExchangeHandler) ExchangeHandler(com.alibaba.dubbo.remoting.exchange.ExchangeHandler) Test(org.junit.Test)

Aggregations

Channel (com.alibaba.dubbo.remoting.Channel)6 ExchangeChannel (com.alibaba.dubbo.remoting.exchange.ExchangeChannel)6 Request (com.alibaba.dubbo.remoting.exchange.Request)6 HeaderExchangeHandler (com.alibaba.dubbo.remoting.exchange.support.header.HeaderExchangeHandler)6 Test (org.junit.Test)6 ExchangeHandler (com.alibaba.dubbo.remoting.exchange.ExchangeHandler)3 Response (com.alibaba.dubbo.remoting.exchange.Response)3 AtomicInteger (java.util.concurrent.atomic.AtomicInteger)3 RemotingException (com.alibaba.dubbo.remoting.RemotingException)1