From: Mark Slee Date: Wed, 7 Mar 2007 05:17:25 +0000 (+0000) Subject: Some thrift test code improvements X-Git-Tag: 0.2.0~1422 X-Git-Url: https://source.supwisdom.com/gerrit/gitweb?a=commitdiff_plain;h=02d1edc6f041b968a0f02d01c767f37eda3fab27;p=common%2Fthrift.git Some thrift test code improvements git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665050 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/test/rb/TestClient.rb b/test/rb/TestClient.rb index beb5af1d..a4aecb8d 100755 --- a/test/rb/TestClient.rb +++ b/test/rb/TestClient.rb @@ -1,4 +1,4 @@ -#!/usr/bin/ruby +#!/usr/bin/env ruby $:.push('gen-rb') $:.push('../../lib/rb/lib') diff --git a/test/rb/TestServer.rb b/test/rb/TestServer.rb index 62b73f76..6e083135 100755 --- a/test/rb/TestServer.rb +++ b/test/rb/TestServer.rb @@ -1,4 +1,4 @@ -#!/usr/bin/ruby +#!/usr/bin/env ruby $:.push('gen-rb') $:.push('../../lib/rb/lib') diff --git a/test/threads/ThreadsClient.cpp b/test/threads/ThreadsClient.cpp index d8f67669..7ad6f00b 100644 --- a/test/threads/ThreadsClient.cpp +++ b/test/threads/ThreadsClient.cpp @@ -10,6 +10,7 @@ #include #include +using boost::shared_ptr; using namespace facebook::thrift; using namespace facebook::thrift::protocol; using namespace facebook::thrift::transport; diff --git a/test/threads/ThreadsServer.cpp b/test/threads/ThreadsServer.cpp index f5bd665c..7d17ecab 100644 --- a/test/threads/ThreadsServer.cpp +++ b/test/threads/ThreadsServer.cpp @@ -4,12 +4,14 @@ #include "ThreadsTest.h" #include #include +#include #include #include #include #include #include +using boost::shared_ptr; using namespace facebook::thrift; using namespace facebook::thrift::protocol; using namespace facebook::thrift::transport; @@ -84,23 +86,31 @@ int main(int argc, char **argv) { shared_ptr transportFactory(new TBufferedTransportFactory()); shared_ptr protocolFactory(new TBinaryProtocolFactory()); + /* shared_ptr threadManager = ThreadManager::newSimpleThreadManager(10); shared_ptr threadFactory = shared_ptr(new PosixThreadFactory()); threadManager->threadFactory(threadFactory); threadManager->start(); - - shared_ptr threadPoolServer = + + shared_ptr server = shared_ptr(new TThreadPoolServer(processor, serverTransport, transportFactory, protocolFactory, threadManager)); + */ - handler->setServer(threadPoolServer); + shared_ptr server = + shared_ptr(new TThreadedServer(processor, + serverTransport, + transportFactory, + protocolFactory)); - threadPoolServer->serve(); + handler->setServer(server); + + server->serve(); fprintf(stderr, "done.\n");