diff options
author | Mark D. Roth <roth@google.com> | 2016-11-03 09:33:36 -0700 |
---|---|---|
committer | Mark D. Roth <roth@google.com> | 2016-11-03 09:33:36 -0700 |
commit | e5b4d4f35b9a5ee4e1553cc3cdc136af9992e334 (patch) | |
tree | 56582ba7b65bb6fe0f1d8728bfae59e474a4e3e5 /test/cpp/interop/interop_client.cc | |
parent | b2d24886196c5000cc15bb5953659ff50b09ad87 (diff) | |
parent | b37ace5d279925ecd7f8dd6dca03e20cb066ae50 (diff) |
Merge remote-tracking branch 'upstream/master' into channel_info_api
Diffstat (limited to 'test/cpp/interop/interop_client.cc')
-rw-r--r-- | test/cpp/interop/interop_client.cc | 32 |
1 files changed, 28 insertions, 4 deletions
diff --git a/test/cpp/interop/interop_client.cc b/test/cpp/interop/interop_client.cc index 1668589cc4..d1242627ef 100644 --- a/test/cpp/interop/interop_client.cc +++ b/test/cpp/interop/interop_client.cc @@ -107,6 +107,11 @@ TestService::Stub* InteropClient::ServiceStub::Get() { return stub_.get(); } +UnimplementedService::Stub* +InteropClient::ServiceStub::GetUnimplementedServiceStub() { + return UnimplementedService::NewStub(channel_).get(); +} + void InteropClient::ServiceStub::Reset(std::shared_ptr<Channel> channel) { channel_ = channel; @@ -162,8 +167,8 @@ bool InteropClient::AssertStatusCode(const Status& s, bool InteropClient::DoEmpty() { gpr_log(GPR_DEBUG, "Sending an empty rpc..."); - Empty request = Empty::default_instance(); - Empty response = Empty::default_instance(); + Empty request; + Empty response; ClientContext context; Status s = serviceStub_.Get()->EmptyCall(&context, request, &response); @@ -1002,11 +1007,30 @@ bool InteropClient::DoCustomMetadata() { return true; } +bool InteropClient::DoUnimplementedService() { + gpr_log(GPR_DEBUG, "Sending a request for an unimplemented service..."); + + Empty request; + Empty response; + ClientContext context; + + UnimplementedService::Stub* stub = serviceStub_.GetUnimplementedServiceStub(); + + Status s = stub->UnimplementedCall(&context, request, &response); + + if (!AssertStatusCode(s, StatusCode::UNIMPLEMENTED)) { + return false; + } + + gpr_log(GPR_DEBUG, "unimplemented service done."); + return true; +} + bool InteropClient::DoUnimplementedMethod() { gpr_log(GPR_DEBUG, "Sending a request for an unimplemented rpc..."); - Empty request = Empty::default_instance(); - Empty response = Empty::default_instance(); + Empty request; + Empty response; ClientContext context; Status s = |