Test code updates


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664823 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/test/cpp/Makefile.thrift b/test/cpp/Makefile.thrift
index 9664deb..1cbd0b7 100644
--- a/test/cpp/Makefile.thrift
+++ b/test/cpp/Makefile.thrift
@@ -31,8 +31,8 @@
 LD     = g++
 
 # Compiler flags
-DCFL  = -Wall -O3 -g -I./gen-cpp $(include_flags) -L$(thrift_home)/lib/cpp -lthrift
-CFL   = -Wall -O3 -I./gen-cpp $(include_flags) -L$(thrift_home)/lib/cpp -lthrift
+DCFL  = -Wall -O3 -g -I./gen-cpp $(include_flags) -L$(thrift_home)/lib/cpp -lthrift -levent
+CFL   = -Wall -O3 -I./gen-cpp $(include_flags) -L$(thrift_home)/lib/cpp -lthrift -levent
 
 all: server client
 
@@ -42,7 +42,7 @@
 	$(THRIFT) --cpp ../ThriftTest.thrift
 
 server-debug: stubs
-	g++ -o TestServer $(DCFL) src/TestServer.cc ./gen-cpp/ThriftTest.cc ./gen-cpp/ThriftTest_types.cc
+	g++ -o TestServer $(DCFL) src/TestServer.cc ./gen-cpp/ThriftTest.cc ./gen-cpp/ThriftTest_types.cc 
 
 client-debug: stubs
 	g++ -o TestClient $(DCFL) src/TestClient.cc ./gen-cpp/ThriftTest.cc ./gen-cpp/ThriftTest_types.cc
diff --git a/test/cpp/src/TestClient.cc b/test/cpp/src/TestClient.cc
index 6334f08..83e8f79 100644
--- a/test/cpp/src/TestClient.cc
+++ b/test/cpp/src/TestClient.cc
@@ -213,12 +213,12 @@
     /**
      * LIST TEST
      */
-    list<int32_t> listout;
+    vector<int32_t> listout;
     for (int32_t i = -2; i < 3; ++i) {
       listout.push_back(i);
     }
     printf("testList({");
-    list<int32_t>::const_iterator l_iter;
+    vector<int32_t>::const_iterator l_iter;
     first = true;
     for (l_iter = listout.begin(); l_iter != listout.end(); ++l_iter) {
       if (first) {
@@ -229,7 +229,7 @@
       printf("%d", *l_iter);
     }
     printf("})");
-    list<int32_t> listin = testClient.testList(listout);
+    vector<int32_t> listin = testClient.testList(listout);
     printf(" = {");
     first = true;
     for (l_iter = listin.begin(); l_iter != listin.end(); ++l_iter) {
@@ -319,8 +319,8 @@
         }
         printf("}, ");
 
-        list<Xtruct> xtructs = i2_iter->second.xtructs;
-        list<Xtruct>::const_iterator x;
+        vector<Xtruct> xtructs = i2_iter->second.xtructs;
+        vector<Xtruct>::const_iterator x;
         printf("{");
         for (x = xtructs.begin(); x != xtructs.end(); ++x) {
           printf("{\"%s\", %d, %d, %ld}, ",
diff --git a/test/cpp/src/TestServer.cc b/test/cpp/src/TestServer.cc
index db41b79..34c9dfb 100644
--- a/test/cpp/src/TestServer.cc
+++ b/test/cpp/src/TestServer.cc
@@ -3,6 +3,7 @@
 #include <protocol/TBinaryProtocol.h>
 #include <server/TSimpleServer.h>
 #include <server/TThreadPoolServer.h>
+#include <server/TNonblockingServer.h>
 #include <transport/TServerSocket.h>
 #include <transport/TBufferedTransportFactory.h>
 #include "ThriftTest.h"
@@ -96,9 +97,9 @@
     return thing;
   }
 
-  list<int32_t> testList(list<int32_t> thing) {
+  vector<int32_t> testList(vector<int32_t> thing) {
     printf("testList({");
-    list<int32_t>::const_iterator l_iter;
+    vector<int32_t>::const_iterator l_iter;
     bool first = true;
     for (l_iter = thing.begin(); l_iter != thing.end(); ++l_iter) {
       if (first) {
@@ -192,8 +193,8 @@
         }
         printf("}, ");
 
-        list<Xtruct> xtructs = i2_iter->second.xtructs;
-        list<Xtruct>::const_iterator x;
+        vector<Xtruct> xtructs = i2_iter->second.xtructs;
+        vector<Xtruct>::const_iterator x;
         printf("{");
         for (x = xtructs.begin(); x != xtructs.end(); ++x) {
           printf("{\"%s\", %d, %d, %ld}, ", x->string_thing.c_str(), (int)x->byte_thing, x->i32_thing, x->i64_thing);
@@ -302,6 +303,7 @@
       serverType = args["server-type"];     
       if (serverType == "simple") {
       } else if (serverType == "thread-pool") {
+      } else if (serverType == "nonblocking") {
       } else {
 	throw invalid_argument("Unknown server type "+serverType);
       }
@@ -375,6 +377,15 @@
 
     printf("Starting the server on port %d...\n", port);
     threadPoolServer.serve();
+
+  } else if (serverType == "nonblocking") {
+
+    TNonblockingServer nonblockingServer(testProcessor,
+                                         serverOptions,
+                                         port);
+    printf("Starting the nonblocking server on port %d...\n", port);
+    nonblockingServer.serve();
+
   }
 
   printf("done.\n");