   dubbo-rpc/dubbo-rpc-rmi
   dubbo-rpc/dubbo-rpc-thrift
   dubbo-rpc/dubbo-rpc-webservice/
TApplicationException exception = TApplicationException.read(protocol);
        protocol.readMessageEnd();
        Assert.assertEquals(exceptionMessage, exception.getMessage());
    }
    @Test
    public void testDecodeRequest() throws Exception {
        Request request = createRequest();
        
        RandomAccessByteArrayOutputStream bos = new RandomAccessByteArrayOutputStream(1024);
        TIOStreamTransport transport = new TIOStreamTransport(bos);
        TBinaryProtocol protocol = new TBinaryProtocol(transport);
        int messageLength, headerLength;
        protocol.writeI16(ThriftCodec.MAGIC);
        protocol.writeI32(Integer.MAX_VALUE);
        protocol.writeI16(Short.MAX_VALUE);
        protocol.writeByte(ThriftCodec.VERSION);
        protocol.writeString(
                ((RpcInvocation) request.getData())
                        .getAttachment(Constants.INTERFACE_KEY));
        protocol.writeI64(request.getId());
        protocol.getTransport().flush();
        headerLength = bos.size();
        Demo.echoString_args args = new Demo.echoString_args();
        args.setArg("Hell, World!");
        TMessage message = new TMessage("echoString", TMessageType.CALL, ThriftCodec.getSeqId());
        protocol.writeMessageBegin(message);
        args.write(protocol);
        protocol.writeMessageEnd();
        protocol.getTransport().flush();
        int oldIndex = messageLength = bos.size();