implementation fix

pull/3104/head
yang-g 9 years ago
parent dafcce980d
commit 730055d962
  1. 2
      include/grpc++/credentials.h
  2. 2
      src/cpp/client/create_channel.cc
  3. 8
      test/cpp/end2end/async_end2end_test.cc
  4. 2
      test/cpp/end2end/client_crash_test.cc
  5. 9
      test/cpp/end2end/end2end_test.cc
  6. 4
      test/cpp/end2end/generic_end2end_test.cc
  7. 4
      test/cpp/end2end/mock_test.cc
  8. 4
      test/cpp/end2end/server_crash_test_client.cc
  9. 2
      test/cpp/end2end/shutdown_test.cc
  10. 4
      test/cpp/end2end/thread_stress_test.cc
  11. 2
      test/cpp/end2end/zookeeper_test.cc
  12. 8
      test/cpp/qps/driver.cc
  13. 4
      test/cpp/qps/report.h
  14. 3
      test/cpp/util/cli_call_test.cc
  15. 4
      test/cpp/util/create_test_channel.cc
  16. 2
      test/cpp/util/grpc_cli.cc

@ -57,7 +57,7 @@ class Credentials : public GrpcLibrary {
virtual SecureCredentials* AsSecureCredentials() = 0;
private:
friend std::shared_ptr<Channel> CreateChannel(
friend std::shared_ptr<Channel> CreateCustomChannel(
const grpc::string& target, const std::shared_ptr<Credentials>& creds,
const ChannelArguments& args);

@ -43,7 +43,7 @@
namespace grpc {
class ChannelArguments;
std::shared_ptr<Channel> CreateCustomChannel(
std::shared_ptr<Channel> CreateChannel(
const grpc::string& target, const std::shared_ptr<Credentials>& creds) {
return CreateCustomChannel(target, creds, ChannelArguments());
}

@ -200,8 +200,8 @@ class AsyncEnd2endTest : public ::testing::TestWithParam<bool> {
}
void ResetStub() {
std::shared_ptr<Channel> channel = CreateChannel(
server_address_.str(), InsecureCredentials(), ChannelArguments());
std::shared_ptr<Channel> channel =
CreateChannel(server_address_.str(), InsecureCredentials());
stub_ = std::move(grpc::cpp::test::util::TestService::NewStub(channel));
}
@ -750,8 +750,8 @@ TEST_P(AsyncEnd2endTest, ServerCheckDone) {
}
TEST_P(AsyncEnd2endTest, UnimplementedRpc) {
std::shared_ptr<Channel> channel = CreateChannel(
server_address_.str(), InsecureCredentials(), ChannelArguments());
std::shared_ptr<Channel> channel =
CreateChannel(server_address_.str(), InsecureCredentials());
std::unique_ptr<grpc::cpp::test::util::UnimplementedService::Stub> stub;
stub =
std::move(grpc::cpp::test::util::UnimplementedService::NewStub(channel));

@ -76,7 +76,7 @@ class CrashTest : public ::testing::Test {
}));
GPR_ASSERT(server_);
return grpc::cpp::test::util::TestService::NewStub(
CreateChannel(addr, InsecureCredentials(), ChannelArguments()));
CreateChannel(addr, InsecureCredentials()));
}
void KillServer() { server_.reset(); }

@ -291,8 +291,8 @@ class End2endTest : public ::testing::TestWithParam<bool> {
ChannelArguments args;
args.SetSslTargetNameOverride("foo.test.google.fr");
args.SetString(GRPC_ARG_SECONDARY_USER_AGENT_STRING, "end2end_test");
channel_ =
CreateChannel(server_address_.str(), SslCredentials(ssl_opts), args);
channel_ = CreateCustomChannel(server_address_.str(),
SslCredentials(ssl_opts), args);
}
void ResetStub(bool use_proxy) {
@ -307,8 +307,7 @@ class End2endTest : public ::testing::TestWithParam<bool> {
builder.RegisterService(proxy_service_.get());
proxy_server_ = builder.BuildAndStart();
channel_ = CreateChannel(proxyaddr.str(), InsecureCredentials(),
ChannelArguments());
channel_ = CreateChannel(proxyaddr.str(), InsecureCredentials());
}
stub_ = std::move(grpc::cpp::test::util::TestService::NewStub(channel_));
@ -566,7 +565,7 @@ TEST_F(End2endTest, BadCredentials) {
std::shared_ptr<Credentials> bad_creds = ServiceAccountCredentials("", "", 1);
EXPECT_EQ(static_cast<Credentials*>(nullptr), bad_creds.get());
std::shared_ptr<Channel> channel =
CreateChannel(server_address_.str(), bad_creds, ChannelArguments());
CreateChannel(server_address_.str(), bad_creds);
std::unique_ptr<grpc::cpp::test::util::TestService::Stub> stub(
grpc::cpp::test::util::TestService::NewStub(channel));
EchoRequest request;

@ -121,8 +121,8 @@ class GenericEnd2endTest : public ::testing::Test {
}
void ResetStub() {
std::shared_ptr<Channel> channel = CreateChannel(
server_address_.str(), InsecureCredentials(), ChannelArguments());
std::shared_ptr<Channel> channel =
CreateChannel(server_address_.str(), InsecureCredentials());
generic_stub_.reset(new GenericStub(channel));
}

@ -245,8 +245,8 @@ class MockTest : public ::testing::Test {
void TearDown() GRPC_OVERRIDE { server_->Shutdown(); }
void ResetStub() {
std::shared_ptr<Channel> channel = CreateChannel(
server_address_.str(), InsecureCredentials(), ChannelArguments());
std::shared_ptr<Channel> channel =
CreateChannel(server_address_.str(), InsecureCredentials());
stub_ = std::move(grpc::cpp::test::util::TestService::NewStub(channel));
}

@ -58,8 +58,8 @@ using namespace gflags;
int main(int argc, char** argv) {
ParseCommandLineFlags(&argc, &argv, true);
auto stub = grpc::cpp::test::util::TestService::NewStub(grpc::CreateChannel(
FLAGS_address, grpc::InsecureCredentials(), grpc::ChannelArguments()));
auto stub = grpc::cpp::test::util::TestService::NewStub(
grpc::CreateChannel(FLAGS_address, grpc::InsecureCredentials()));
EchoRequest request;
EchoResponse response;

@ -95,7 +95,7 @@ class ShutdownTest : public ::testing::Test {
void ResetStub() {
string target = "dns:localhost:" + to_string(port_);
channel_ = CreateChannel(target, InsecureCredentials(), ChannelArguments());
channel_ = CreateChannel(target, InsecureCredentials());
stub_ = std::move(grpc::cpp::test::util::TestService::NewStub(channel_));
}

@ -191,8 +191,8 @@ class End2endTest : public ::testing::Test {
void TearDown() GRPC_OVERRIDE { server_->Shutdown(); }
void ResetStub() {
std::shared_ptr<Channel> channel = CreateChannel(
server_address_.str(), InsecureCredentials(), ChannelArguments());
std::shared_ptr<Channel> channel =
CreateChannel(server_address_.str(), InsecureCredentials());
stub_ = std::move(grpc::cpp::test::util::TestService::NewStub(channel));
}

@ -159,7 +159,7 @@ class ZookeeperTest : public ::testing::Test {
void ResetStub() {
string target = "zookeeper://" + zookeeper_address_ + "/test";
channel_ = CreateChannel(target, InsecureCredentials(), ChannelArguments());
channel_ = CreateChannel(target, InsecureCredentials());
stub_ = std::move(grpc::cpp::test::util::TestService::NewStub(channel_));
}

@ -154,8 +154,8 @@ std::unique_ptr<ScenarioResult> RunScenario(
// where class contained in std::vector must have a copy constructor
auto* servers = new ServerData[num_servers];
for (size_t i = 0; i < num_servers; i++) {
servers[i].stub = std::move(Worker::NewStub(
CreateChannel(workers[i], InsecureCredentials(), ChannelArguments())));
servers[i].stub = std::move(
Worker::NewStub(CreateChannel(workers[i], InsecureCredentials())));
ServerArgs args;
result_server_config = server_config;
result_server_config.set_host(workers[i]);
@ -182,8 +182,8 @@ std::unique_ptr<ScenarioResult> RunScenario(
// where class contained in std::vector must have a copy constructor
auto* clients = new ClientData[num_clients];
for (size_t i = 0; i < num_clients; i++) {
clients[i].stub = std::move(Worker::NewStub(CreateChannel(
workers[i + num_servers], InsecureCredentials(), ChannelArguments())));
clients[i].stub = std::move(Worker::NewStub(
CreateChannel(workers[i + num_servers], InsecureCredentials())));
ClientArgs args;
result_client_config = client_config;
result_client_config.set_host(workers[i + num_servers]);

@ -116,8 +116,8 @@ class PerfDbReporter : public Reporter {
test_name_(test_name),
sys_info_(sys_info),
tag_(tag) {
perf_db_client_.init(grpc::CreateChannel(
server_address, grpc::InsecureCredentials(), ChannelArguments()));
perf_db_client_.init(
grpc::CreateChannel(server_address, grpc::InsecureCredentials()));
}
~PerfDbReporter() GRPC_OVERRIDE { SendData(); };

@ -91,8 +91,7 @@ class CliCallTest : public ::testing::Test {
void TearDown() GRPC_OVERRIDE { server_->Shutdown(); }
void ResetStub() {
channel_ = CreateChannel(server_address_.str(), InsecureCredentials(),
ChannelArguments());
channel_ = CreateChannel(server_address_.str(), InsecureCredentials());
stub_ = std::move(grpc::cpp::test::util::TestService::NewStub(channel_));
}

@ -74,9 +74,9 @@ std::shared_ptr<Channel> CreateTestChannel(
if (creds.get()) {
channel_creds = CompositeCredentials(creds, channel_creds);
}
return CreateChannel(connect_to, channel_creds, channel_args);
return CreateCustomChannel(connect_to, channel_creds, channel_args);
} else {
return CreateChannel(server, InsecureCredentials(), channel_args);
return CreateChannel(server, InsecureCredentials());
}
}

@ -159,7 +159,7 @@ int main(int argc, char** argv) {
}
}
std::shared_ptr<grpc::Channel> channel =
grpc::CreateChannel(server_address, creds, grpc::ChannelArguments());
grpc::CreateChannel(server_address, creds);
grpc::string response;
std::multimap<grpc::string, grpc::string> client_metadata;

Loading…
Cancel
Save