diff options
author | Yang Gao <yangg@google.com> | 2015-03-30 10:44:05 -0700 |
---|---|---|
committer | Yang Gao <yangg@google.com> | 2015-03-30 10:44:05 -0700 |
commit | fbf8a37c5eafcb1f9b27d9bdaac73040785dd6b6 (patch) | |
tree | 10211221689f95049b3156d6c153297c23de88cb /examples/pubsub/subscriber_test.cc | |
parent | 1205f6f534412f3e2deb88b86f66ae58b07aab8a (diff) | |
parent | 675de61e4ba46f6910eab9051ea77ee73cdf8c28 (diff) |
Merge branch 'master' into cancel
Diffstat (limited to 'examples/pubsub/subscriber_test.cc')
-rw-r--r-- | examples/pubsub/subscriber_test.cc | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/examples/pubsub/subscriber_test.cc b/examples/pubsub/subscriber_test.cc index b8dd1f9486..9ab60ed6a7 100644 --- a/examples/pubsub/subscriber_test.cc +++ b/examples/pubsub/subscriber_test.cc @@ -31,8 +31,6 @@ * */ -#include <google/protobuf/stubs/common.h> - #include <grpc++/channel_arguments.h> #include <grpc++/channel_interface.h> #include <grpc++/client_context.h> @@ -95,7 +93,6 @@ class SubscriberServiceImpl : public tech::pubsub::SubscriberService::Service { proto2::Empty* response) GRPC_OVERRIDE { return Status::OK; } - }; class SubscriberTest : public ::testing::Test { @@ -105,11 +102,13 @@ class SubscriberTest : public ::testing::Test { int port = grpc_pick_unused_port_or_die(); server_address_ << "localhost:" << port; ServerBuilder builder; - builder.AddListeningPort(server_address_.str(), grpc::InsecureServerCredentials()); + builder.AddListeningPort(server_address_.str(), + grpc::InsecureServerCredentials()); builder.RegisterService(&service_); server_ = builder.BuildAndStart(); - channel_ = CreateChannel(server_address_.str(), grpc::InsecureCredentials(), ChannelArguments()); + channel_ = CreateChannel(server_address_.str(), grpc::InsecureCredentials(), + ChannelArguments()); subscriber_.reset(new grpc::examples::pubsub::Subscriber(channel_)); } @@ -129,17 +128,15 @@ class SubscriberTest : public ::testing::Test { }; TEST_F(SubscriberTest, TestSubscriber) { - EXPECT_TRUE(subscriber_->CreateSubscription(kTopic, - kSubscriptionName).IsOk()); + EXPECT_TRUE( + subscriber_->CreateSubscription(kTopic, kSubscriptionName).IsOk()); grpc::string topic; - EXPECT_TRUE(subscriber_->GetSubscription(kSubscriptionName, - &topic).IsOk()); + EXPECT_TRUE(subscriber_->GetSubscription(kSubscriptionName, &topic).IsOk()); EXPECT_EQ(topic, kTopic); grpc::string data; - EXPECT_TRUE(subscriber_->Pull(kSubscriptionName, - &data).IsOk()); + EXPECT_TRUE(subscriber_->Pull(kSubscriptionName, &data).IsOk()); EXPECT_TRUE(subscriber_->DeleteSubscription(kSubscriptionName).IsOk()); } |