Package com.alibaba.dubbo.remoting.exchange.support.header

Examples of com.alibaba.dubbo.remoting.exchange.support.header.HeaderExchangeHandler.received()


            public void received(Channel channel, Object message) throws RemotingException {
                Assert.assertEquals(requestdata, message);
            }
        };
        HeaderExchangeHandler hexhandler = new HeaderExchangeHandler(exhandler);
        hexhandler.received(mchannel, request);
    }
   
    @Test
    public void test_received_request_twoway() throws RemotingException{
        final Person requestdata = new Person("charles");
View Full Code Here


            public void received(Channel channel, Object message) throws RemotingException {
                Assert.fail();
            }
        };
        HeaderExchangeHandler hexhandler = new HeaderExchangeHandler(exhandler);
        hexhandler.received(mchannel, request);
        Assert.assertEquals(1, count.get());
    }
   
    @Test(expected = IllegalArgumentException.class)
    public void test_received_request_twoway_error_nullhandler() throws RemotingException{
View Full Code Here

            public Object reply(ExchangeChannel channel, Object request) throws RemotingException {
                throw new BizException();
            }
        };
        HeaderExchangeHandler hexhandler = new HeaderExchangeHandler(exhandler);
        hexhandler.received(mchannel, request);
        Assert.assertEquals(1, count.get());
    }
   
    @Test
    public void test_received_request_twoway_error_reqeustBroken() throws RemotingException{
View Full Code Here

                Assert.assertTrue(res.getErrorMessage().contains(BizException.class.getName()));
                count.incrementAndGet();
            }
        };
        HeaderExchangeHandler hexhandler = new HeaderExchangeHandler(new MockedExchangeHandler());
        hexhandler.received(mchannel, request);
        Assert.assertEquals(1, count.get());
    }
   
    @Test
    public void test_received_request_event_readonly() throws RemotingException{
View Full Code Here

        request.setTwoWay(true);
        request.setEvent(Request.READONLY_EVENT);
       
        final Channel mchannel = new MockedChannel();
        HeaderExchangeHandler hexhandler = new HeaderExchangeHandler(new MockedExchangeHandler());
        hexhandler.received(mchannel, request);
        Assert.assertTrue(mchannel.hasAttribute(Constants.CHANNEL_ATTRIBUTE_READONLY_KEY));
    }
   
    @Test
    public void test_received_request_event_other_discard() throws RemotingException{
View Full Code Here

            public void received(Channel channel, Object message) throws RemotingException {
                Assert.fail();
                throw new RemotingException(channel,"");
            }
        });
        hexhandler.received(mchannel, request);
    }

    private class BizException extends RuntimeException{
        private static final long serialVersionUID = 1L;
    }
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.