   dubbo-rpc/dubbo-rpc-rmi
   dubbo-rpc/dubbo-rpc-thrift
   dubbo-rpc/dubbo-rpc-webservice/
}
        TIOStreamTransport transport = new TIOStreamTransport(bis);
        TBinaryProtocol protocol = new TBinaryProtocol(transport);
        Assert.assertEquals(ThriftCodec.MAGIC, protocol.readI16());
        Assert.assertEquals(protocol.readI32() + 4, bos.writerIndex());
        int headerLength = protocol.readI16();
        Assert.assertEquals(ThriftCodec.VERSION, protocol.readByte());
        Assert.assertEquals(Demo.Iface.class.getName(), protocol.readString());
        Assert.assertEquals(request.getId(), protocol.readI64());
        if (bis.markSupported()) {
            bis.reset();
            bis.skip(headerLength);
        }
        TMessage message = protocol.readMessageBegin();
        Assert.assertEquals("echoString", message.name);
        Assert.assertEquals(TMessageType.REPLY, message.type);
        Assert.assertEquals(ThriftCodec.getSeqId(), message.seqid);
        Demo.echoString_result result = new Demo.echoString_result();
        result.read(protocol);
        protocol.readMessageEnd();
        Assert.assertEquals(rpcResult.getValue(), result.getSuccess());
    }
    @Test
    public void testEncodeExceptionResponse() throws Exception {
        URL url = URL.valueOf(ThriftProtocol.NAME + "://127.0.0.1:40880/" + Demo.Iface.class.getName());
        Channel channel = new MockedChannel(url);
        Request request = createRequest();
        RpcResult rpcResult = new RpcResult();
        String exceptionMessage = "failed";
        rpcResult.setException(new RuntimeException(exceptionMessage));