use of com.weibo.api.motan.codec.Codec in project motan by weibocom.
the class CompressRpcCodecTest method testCompatibility.
// 测试server端对旧版本的兼容性
@Test
public void testCompatibility() throws IOException {
DefaultRequest request = getRequest("int[]", new Object[] { new int[] { 1, 2 } });
Codec v1Codec = new DefaultRpcCodec();
byte[] bytes = v1Codec.encode(channel, request);
assertTrue(isV1Version(bytes));
Request result = (Request) rpcCodec.decode(channel, "", bytes);
Assert.assertTrue(equals(request, result));
}
Aggregations