public void testNewReflectiveService() {
ServiceWithNoOuter.Interface impl =
control.createMock(ServiceWithNoOuter.Interface.class);
RpcController controller = control.createMock(RpcController.class);
Service service = ServiceWithNoOuter.newReflectiveService(impl);
MethodDescriptor fooMethod =
ServiceWithNoOuter.getDescriptor().findMethodByName("Foo");
MessageWithNoOuter request = MessageWithNoOuter.getDefaultInstance();
RpcCallback<Message> callback = new RpcCallback<Message>() {
public void run(Message parameter) {
// No reason this should be run.
fail();
}
};
RpcCallback<TestAllTypes> specializedCallback =
RpcUtil.specializeCallback(callback);
impl.foo(EasyMock.same(controller), EasyMock.same(request),
EasyMock.same(specializedCallback));
EasyMock.expectLastCall();
control.replay();
service.callMethod(fooMethod, controller, request, callback);
control.verify();
}
ServiceTest.java 文件源码
java
阅读 25
收藏 0
点赞 0
评论 0
项目:sstore-soft
作者:
评论列表
文章目录