|
|
|
@ -196,10 +196,10 @@ class TestAuthMetadataProcessor : public AuthMetadataProcessor { |
|
|
|
|
const char TestAuthMetadataProcessor::kGoodGuy[] = "Dr Jekyll"; |
|
|
|
|
const char TestAuthMetadataProcessor::kIdentityPropName[] = "novel identity"; |
|
|
|
|
|
|
|
|
|
class Proxy : public ::grpc::testing::TestService::Service { |
|
|
|
|
class Proxy : public ::grpc::testing::EchoTestService::Service { |
|
|
|
|
public: |
|
|
|
|
Proxy(std::shared_ptr<Channel> channel) |
|
|
|
|
: stub_(grpc::testing::TestService::NewStub(channel)) {} |
|
|
|
|
: stub_(grpc::testing::EchoTestService::NewStub(channel)) {} |
|
|
|
|
|
|
|
|
|
Status Echo(ServerContext* server_context, const EchoRequest* request, |
|
|
|
|
EchoResponse* response) GRPC_OVERRIDE { |
|
|
|
@ -209,10 +209,10 @@ class Proxy : public ::grpc::testing::TestService::Service { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private: |
|
|
|
|
std::unique_ptr< ::grpc::testing::TestService::Stub> stub_; |
|
|
|
|
std::unique_ptr< ::grpc::testing::EchoTestService::Stub> stub_; |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
class TestServiceImpl : public ::grpc::testing::TestService::Service { |
|
|
|
|
class TestServiceImpl : public ::grpc::testing::EchoTestService::Service { |
|
|
|
|
public: |
|
|
|
|
TestServiceImpl() : signal_client_(false), host_() {} |
|
|
|
|
explicit TestServiceImpl(const grpc::string& host) |
|
|
|
@ -344,7 +344,7 @@ class TestServiceImpl : public ::grpc::testing::TestService::Service { |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
class TestServiceImplDupPkg |
|
|
|
|
: public ::grpc::testing::duplicate::TestService::Service { |
|
|
|
|
: public ::grpc::testing::duplicate::EchoTestService::Service { |
|
|
|
|
public: |
|
|
|
|
Status Echo(ServerContext* context, const EchoRequest* request, |
|
|
|
|
EchoResponse* response) GRPC_OVERRIDE { |
|
|
|
@ -435,12 +435,12 @@ class End2endTest : public ::testing::TestWithParam<TestScenario> { |
|
|
|
|
channel_ = CreateChannel(proxyaddr.str(), InsecureChannelCredentials()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
stub_ = grpc::testing::TestService::NewStub(channel_); |
|
|
|
|
stub_ = grpc::testing::EchoTestService::NewStub(channel_); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
bool is_server_started_; |
|
|
|
|
std::shared_ptr<Channel> channel_; |
|
|
|
|
std::unique_ptr<grpc::testing::TestService::Stub> stub_; |
|
|
|
|
std::unique_ptr<grpc::testing::EchoTestService::Stub> stub_; |
|
|
|
|
std::unique_ptr<Server> server_; |
|
|
|
|
std::unique_ptr<Server> proxy_server_; |
|
|
|
|
std::unique_ptr<Proxy> proxy_service_; |
|
|
|
@ -451,7 +451,7 @@ class End2endTest : public ::testing::TestWithParam<TestScenario> { |
|
|
|
|
TestServiceImplDupPkg dup_pkg_service_; |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
static void SendRpc(grpc::testing::TestService::Stub* stub, int num_rpcs) { |
|
|
|
|
static void SendRpc(grpc::testing::EchoTestService::Stub* stub, int num_rpcs) { |
|
|
|
|
EchoRequest request; |
|
|
|
|
EchoResponse response; |
|
|
|
|
request.set_message("Hello hello hello hello"); |
|
|
|
@ -561,8 +561,8 @@ TEST_P(End2endTest, DiffPackageServices) { |
|
|
|
|
EXPECT_EQ(response.message(), request.message()); |
|
|
|
|
EXPECT_TRUE(s.ok()); |
|
|
|
|
|
|
|
|
|
std::unique_ptr<grpc::testing::duplicate::TestService::Stub> dup_pkg_stub( |
|
|
|
|
grpc::testing::duplicate::TestService::NewStub(channel_)); |
|
|
|
|
std::unique_ptr<grpc::testing::duplicate::EchoTestService::Stub> dup_pkg_stub( |
|
|
|
|
grpc::testing::duplicate::EchoTestService::NewStub(channel_)); |
|
|
|
|
ClientContext context2; |
|
|
|
|
s = dup_pkg_stub->Echo(&context2, request, &response); |
|
|
|
|
EXPECT_EQ("no package", response.message()); |
|
|
|
|