diff options
author | yangg <yangg@google.com> | 2014-12-19 14:00:14 -0800 |
---|---|---|
committer | Jan Tattermusch <jtattermusch@google.com> | 2014-12-29 16:59:06 -0800 |
commit | 59dfc90f578baedce8bbf8bb07e3e1a24ec1fb68 (patch) | |
tree | 61197977561961ce2b7e395c0aa6bb9d7163f74c /test/cpp/interop | |
parent | c463f746c90240d5b724c546660e90853ebed77d (diff) |
Client side implementation of creating channel with credentials.
The old test_ssl_channel related code is deleted and the new create channel
call is used for interop tests.
Change on 2014/12/19 by yangg <yangg@google.com>
-------------
Created by MOE: http://code.google.com/p/moe-java
MOE_MIGRATED_REVID=82540921
Diffstat (limited to 'test/cpp/interop')
-rw-r--r-- | test/cpp/interop/client.cc | 21 |
1 files changed, 5 insertions, 16 deletions
diff --git a/test/cpp/interop/client.cc b/test/cpp/interop/client.cc index a2a0f582f9..8ea52b5d51 100644 --- a/test/cpp/interop/client.cc +++ b/test/cpp/interop/client.cc @@ -40,12 +40,13 @@ #include <grpc/grpc.h> #include <grpc/support/log.h> #include <google/gflags.h> +#include <grpc++/channel_arguments.h> #include <grpc++/channel_interface.h> #include <grpc++/client_context.h> #include <grpc++/create_channel.h> #include <grpc++/status.h> #include <grpc++/stream.h> -#include "test/cpp/util/test_ssl_channel.h" +#include "test/cpp/util/create_test_channel.h" #include "test/cpp/interop/test.pb.h" #include "test/cpp/interop/empty.pb.h" #include "test/cpp/interop/messages.pb.h" @@ -67,8 +68,7 @@ DEFINE_string(test_case, "large_unary", using grpc::ChannelInterface; using grpc::ClientContext; -using grpc::CreateChannel; -using grpc::TestSslChannel; +using grpc::CreateTestChannel; using grpc::testing::ResponseParameters; using grpc::testing::SimpleRequest; using grpc::testing::SimpleResponse; @@ -87,17 +87,6 @@ const int kResponseMessageSize = 1030; const int kReceiveDelayMilliSeconds = 20; } // namespace -std::shared_ptr<ChannelInterface> CreateTestChannel( - const grpc::string& server) { - std::shared_ptr<ChannelInterface> channel; - if (FLAGS_enable_ssl) { - channel.reset(new TestSslChannel(server)); - } else { - channel = CreateChannel(server); - } - return channel; -} - void DoEmpty(std::shared_ptr<ChannelInterface> channel) { gpr_log(GPR_INFO, "Sending an empty rpc..."); std::unique_ptr<TestService::Stub> stub(TestService::NewStub(channel)); @@ -146,9 +135,9 @@ int main(int argc, char** argv) { FLAGS_server_port); if (FLAGS_test_case == "empty_unary") { - DoEmpty(CreateTestChannel(host_port)); + DoEmpty(CreateTestChannel(host_port, FLAGS_enable_ssl)); } else if (FLAGS_test_case == "large_unary") { - DoLargeUnary(CreateTestChannel(host_port)); + DoLargeUnary(CreateTestChannel(host_port, FLAGS_enable_ssl)); } else { gpr_log( GPR_ERROR, |