use of com.weibo.api.motan.rpc.DefaultRequest in project motan by weibocom.
the class DefaultRpcCodecTest method testHalfNullRequest1.
@Test
public void testHalfNullRequest1() throws Exception {
DefaultRequest request = getRequest("com.weibo.api.motan.protocol.example.Model[]", new Object[] { new Model[] { null, new Model("world", 12, Model.class) } });
testCodecRequest(request);
}
use of com.weibo.api.motan.rpc.DefaultRequest in project motan by weibocom.
the class DefaultRpcCodecTest method testHalfNullRequest.
@Test
public void testHalfNullRequest() throws Exception {
DefaultRequest request = getRequest("com.weibo.api.motan.protocol.example.Model,com.weibo.api.motan.protocol.example.Model", new Object[] { null, new Model("world", 12, Model.class) });
testCodecRequest(request);
}
use of com.weibo.api.motan.rpc.DefaultRequest in project motan by weibocom.
the class DefaultRpcCodecTest method testVoidTypeRequest.
@Test
public void testVoidTypeRequest() throws Exception {
DefaultRequest request = getRequest("void", null);
testCodecRequest(request);
}
use of com.weibo.api.motan.rpc.DefaultRequest in project motan by weibocom.
the class DefaultRpcCodecTest method testStringTypeRequest.
@Test
public void testStringTypeRequest() throws Exception {
DefaultRequest request = getRequest("java.lang.String", new Object[] { "hello" });
testCodecRequest(request);
}
use of com.weibo.api.motan.rpc.DefaultRequest 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