aboutsummaryrefslogtreecommitdiffhomepage
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/cpp/end2end/end2end_test.cc12
-rw-r--r--test/cpp/qps/server.cc5
2 files changed, 12 insertions, 5 deletions
diff --git a/test/cpp/end2end/end2end_test.cc b/test/cpp/end2end/end2end_test.cc
index ea21099fc7..b8f9fcf228 100644
--- a/test/cpp/end2end/end2end_test.cc
+++ b/test/cpp/end2end/end2end_test.cc
@@ -40,6 +40,7 @@
#include <grpc++/create_channel.h>
#include <grpc++/server.h>
#include <grpc++/server_builder.h>
+#include <grpc++/server_context.h>
#include <grpc++/status.h>
#include <grpc++/stream.h>
#include <gtest/gtest.h>
@@ -55,14 +56,16 @@ namespace grpc {
class TestServiceImpl : public TestService::Service {
public:
- Status Echo(const EchoRequest* request, EchoResponse* response) {
+ Status Echo(ServerContext* context, const EchoRequest* request,
+ EchoResponse* response) {
response->set_message(request->message());
return Status::OK;
}
// Unimplemented is left unimplemented to test the returned error.
- Status RequestStream(ServerReader<EchoRequest>* reader,
+ Status RequestStream(ServerContext* context,
+ ServerReader<EchoRequest>* reader,
EchoResponse* response) {
EchoRequest request;
response->set_message("");
@@ -74,7 +77,7 @@ class TestServiceImpl : public TestService::Service {
// Return 3 messages.
// TODO(yangg) make it generic by adding a parameter into EchoRequest
- Status ResponseStream(const EchoRequest* request,
+ Status ResponseStream(ServerContext* context, const EchoRequest* request,
ServerWriter<EchoResponse>* writer) {
EchoResponse response;
response.set_message(request->message() + "0");
@@ -87,7 +90,8 @@ class TestServiceImpl : public TestService::Service {
return Status::OK;
}
- Status BidiStream(ServerReaderWriter<EchoResponse, EchoRequest>* stream) {
+ Status BidiStream(ServerContext* context,
+ ServerReaderWriter<EchoResponse, EchoRequest>* stream) {
EchoRequest request;
EchoResponse response;
while (stream->Read(&request)) {
diff --git a/test/cpp/qps/server.cc b/test/cpp/qps/server.cc
index 7e6c01e24e..5e426127f0 100644
--- a/test/cpp/qps/server.cc
+++ b/test/cpp/qps/server.cc
@@ -39,6 +39,7 @@
#include <grpc++/config.h>
#include <grpc++/server.h>
#include <grpc++/server_builder.h>
+#include <grpc++/server_context.h>
#include <grpc++/status.h>
#include "test/cpp/interop/test.pb.h"
@@ -50,6 +51,7 @@ DEFINE_int32(port, 0, "Server port.");
using grpc::Server;
using grpc::ServerBuilder;
+using grpc::ServerContext;
using grpc::testing::Payload;
using grpc::testing::PayloadType;
using grpc::testing::SimpleRequest;
@@ -71,7 +73,8 @@ bool SetPayload(PayloadType type, int size, Payload* payload) {
class TestServiceImpl : public TestService::Service {
public:
- Status UnaryCall(const SimpleRequest* request, SimpleResponse* response) {
+ Status UnaryCall(ServerContext* context, const SimpleRequest* request,
+ SimpleResponse* response) {
if (request->has_response_size() && request->response_size() > 0) {
if (!SetPayload(request->response_type(), request->response_size(),
response->mutable_payload())) {