Fix broken C++ Thrift test
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665057 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/test/cpp/src/TestServer.cpp b/test/cpp/src/TestServer.cpp
index bd6a2cf..c8ecf15 100644
--- a/test/cpp/src/TestServer.cpp
+++ b/test/cpp/src/TestServer.cpp
@@ -2,6 +2,7 @@
#include <concurrency/PosixThreadFactory.h>
#include <protocol/TBinaryProtocol.h>
#include <server/TSimpleServer.h>
+#include <server/TThreadedServer.h>
#include <server/TThreadPoolServer.h>
#include <server/TNonblockingServer.h>
#include <transport/TServerSocket.h>
@@ -13,8 +14,10 @@
#include <sstream>
using namespace std;
+using namespace boost;
using namespace facebook::thrift;
+using namespace facebook::thrift::concurrency;
using namespace facebook::thrift::protocol;
using namespace facebook::thrift::transport;
using namespace facebook::thrift::server;
@@ -264,7 +267,7 @@
usage <<
argv[0] << " [--port=<port number>] [--server-type=<server-type>] [--protocol-type=<protocol-type>] [--workers=<worker-count>]" << endl <<
- "\t\tserver-type\t\ttype of server, \"simple\", \"thread-pool\", or \"nonblocking\". Default is " << serverType << endl <<
+ "\t\tserver-type\t\ttype of server, \"simple\", \"thread-pool\", \"threaded\", or \"nonblocking\". Default is " << serverType << endl <<
"\t\tprotocol-type\t\ttype of protocol, \"binary\", \"ascii\", or \"xml\". Default is " << protocolType << endl <<
@@ -300,6 +303,7 @@
serverType = args["server-type"];
if (serverType == "simple") {
} else if (serverType == "thread-pool") {
+ } else if (serverType == "threaded") {
} else if (serverType == "nonblocking") {
} else {
throw invalid_argument("Unknown server type "+serverType);
@@ -371,6 +375,16 @@
printf("Starting the server on port %d...\n", port);
threadPoolServer.serve();
+ } else if (serverType == "threaded") {
+
+ TThreadedServer threadedServer(testProcessor,
+ serverSocket,
+ transportFactory,
+ protocolFactory);
+
+ printf("Starting the server on port %d...\n", port);
+ threadedServer.serve();
+
} else if (serverType == "nonblocking") {
TNonblockingServer nonblockingServer(testProcessor, port);