aboutsummaryrefslogtreecommitdiffhomepage
path: root/test
diff options
context:
space:
mode:
authorGravatar Craig Tiller <craig.tiller@gmail.com>2015-02-23 08:50:19 -0800
committerGravatar Craig Tiller <ctiller@google.com>2015-02-23 09:58:23 -0800
commit42bc87c0979f7a9f3084366fd466d382cf86ec17 (patch)
tree3e233e2126465227bbaa09fa3a6166f43585c944 /test
parent759026cbf0419dae4edddd9e75fa338e1028a3d8 (diff)
Update C++ server with new core API
And reflects the C++ API in ServerBuilder.
Diffstat (limited to 'test')
-rw-r--r--test/core/surface/lame_client_test.c2
-rw-r--r--test/cpp/end2end/async_end2end_test.cc3
-rw-r--r--test/cpp/end2end/end2end_test.cc3
-rw-r--r--test/cpp/interop/server.cc7
-rw-r--r--test/cpp/qps/server.cc3
5 files changed, 10 insertions, 8 deletions
diff --git a/test/core/surface/lame_client_test.c b/test/core/surface/lame_client_test.c
index 0142768261..cae49271ee 100644
--- a/test/core/surface/lame_client_test.c
+++ b/test/core/surface/lame_client_test.c
@@ -31,7 +31,7 @@
*
*/
-#include "src/core/surface/lame_client.h"
+#include <grpc/grpc.h>
#include "test/core/end2end/cq_verifier.h"
#include "test/core/util/test_config.h"
diff --git a/test/cpp/end2end/async_end2end_test.cc b/test/cpp/end2end/async_end2end_test.cc
index 85b4ff8120..01134a3dc3 100644
--- a/test/cpp/end2end/async_end2end_test.cc
+++ b/test/cpp/end2end/async_end2end_test.cc
@@ -47,6 +47,7 @@
#include <grpc++/server.h>
#include <grpc++/server_builder.h>
#include <grpc++/server_context.h>
+#include <grpc++/server_credentials.h>
#include <grpc++/status.h>
#include <grpc++/stream.h>
#include "test/core/util/port.h"
@@ -84,7 +85,7 @@ class AsyncEnd2endTest : public ::testing::Test {
server_address_ << "localhost:" << port;
// Setup server
ServerBuilder builder;
- builder.AddPort(server_address_.str());
+ builder.AddPort(server_address_.str(), grpc::InsecureServerCredentials());
builder.RegisterAsyncService(&service_);
server_ = builder.BuildAndStart();
}
diff --git a/test/cpp/end2end/end2end_test.cc b/test/cpp/end2end/end2end_test.cc
index f5ecd1a20c..e9f0ce9097 100644
--- a/test/cpp/end2end/end2end_test.cc
+++ b/test/cpp/end2end/end2end_test.cc
@@ -47,6 +47,7 @@
#include <grpc++/server.h>
#include <grpc++/server_builder.h>
#include <grpc++/server_context.h>
+#include <grpc++/server_credentials.h>
#include <grpc++/status.h>
#include <grpc++/stream.h>
#include "test/core/util/port.h"
@@ -150,7 +151,7 @@ class End2endTest : public ::testing::Test {
server_address_ << "localhost:" << port;
// Setup server
ServerBuilder builder;
- builder.AddPort(server_address_.str());
+ builder.AddPort(server_address_.str(), InsecureServerCredentials());
builder.RegisterService(&service_);
builder.RegisterService(&dup_pkg_service_);
builder.SetThreadPool(&thread_pool_);
diff --git a/test/cpp/interop/server.cc b/test/cpp/interop/server.cc
index 7a7287438f..1ec51004fa 100644
--- a/test/cpp/interop/server.cc
+++ b/test/cpp/interop/server.cc
@@ -59,7 +59,6 @@ using grpc::Server;
using grpc::ServerBuilder;
using grpc::ServerContext;
using grpc::ServerCredentials;
-using grpc::ServerCredentialsFactory;
using grpc::ServerReader;
using grpc::ServerReaderWriter;
using grpc::ServerWriter;
@@ -210,14 +209,14 @@ void RunServer() {
SimpleResponse response;
ServerBuilder builder;
- builder.AddPort(server_address.str());
builder.RegisterService(&service);
+ std::shared_ptr<ServerCredentials> creds = grpc::InsecureServerCredentials();
if (FLAGS_enable_ssl) {
SslServerCredentialsOptions ssl_opts = {
"", {{test_server1_key, test_server1_cert}}};
- std::shared_ptr<ServerCredentials> creds = ServerSslCredentials(ssl_opts);
- builder.SetCredentials(creds);
+ creds = grpc::SslServerCredentials(ssl_opts);
}
+ builder.AddPort(server_address.str(), creds);
std::unique_ptr<Server> server(builder.BuildAndStart());
gpr_log(GPR_INFO, "Server listening on %s", server_address.str().c_str());
while (!got_sigint) {
diff --git a/test/cpp/qps/server.cc b/test/cpp/qps/server.cc
index 8e136349a1..b54f14d798 100644
--- a/test/cpp/qps/server.cc
+++ b/test/cpp/qps/server.cc
@@ -43,6 +43,7 @@
#include <grpc++/server.h>
#include <grpc++/server_builder.h>
#include <grpc++/server_context.h>
+#include <grpc++/server_credentials.h>
#include <grpc++/status.h>
#include "src/cpp/server/thread_pool.h"
#include "test/core/util/grpc_profiler.h"
@@ -134,7 +135,7 @@ static void RunServer() {
SimpleResponse response;
ServerBuilder builder;
- builder.AddPort(server_address);
+ builder.AddPort(server_address, grpc::InsecureServerCredentials());
builder.RegisterService(&service);
std::unique_ptr<ThreadPool> pool(new ThreadPool(FLAGS_server_threads));