From 1dd819cd2be36b7cf6d2ee0f729f40e676085fe4 Mon Sep 17 00:00:00 2001 From: Mark Slee Date: Thu, 26 Oct 2006 04:56:18 +0000 Subject: [PATCH] Bring Thrift test code up to date git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664852 13f79535-47bb-0310-9956-ffa450edef68 --- test/java/src/TestClient.java | 4 ++-- test/java/src/TestServer.java | 6 ++---- test/php/TestClient.php | 6 +++--- test/py/TestClient.py | 4 ++-- test/py/TestServer.py | 10 +++++----- 5 files changed, 14 insertions(+), 16 deletions(-) diff --git a/test/java/src/TestClient.java b/test/java/src/TestClient.java index 546265c0..7e2e49e5 100644 --- a/test/java/src/TestClient.java +++ b/test/java/src/TestClient.java @@ -69,9 +69,9 @@ public class TestClient { } TBinaryProtocol binaryProtocol = - new TBinaryProtocol(); + new TBinaryProtocol(transport, transport); ThriftTest.Client testClient = - new ThriftTest.Client(transport, binaryProtocol); + new ThriftTest.Client(binaryProtocol); long timeMin = 0; long timeMax = 0; diff --git a/test/java/src/TestServer.java b/test/java/src/TestServer.java index fe70594e..bf3f685c 100644 --- a/test/java/src/TestServer.java +++ b/test/java/src/TestServer.java @@ -237,12 +237,10 @@ public class TestServer { } // Processor - TBinaryProtocol binaryProtocol = - new TBinaryProtocol(); TestHandler testHandler = new TestHandler(); ThriftTest.Processor testProcessor = - new ThriftTest.Processor(testHandler, binaryProtocol); + new ThriftTest.Processor(testHandler); // Transport TServerSocket tServerSocket = @@ -254,7 +252,7 @@ public class TestServer { // serverEngine = new TSimpleServer(testProcessor, tServerSocket); // ThreadPool Server - serverEngine = new TThreadPoolServer(testProcessor, tServerSocket); + serverEngine = new TThreadPoolServer(testProcessor, tServerSocket); // Run it System.out.println("Starting the server on port " + port + "..."); diff --git a/test/php/TestClient.php b/test/php/TestClient.php index 235abbe2..0f1540c2 100644 --- a/test/php/TestClient.php +++ b/test/php/TestClient.php @@ -36,7 +36,7 @@ if ($argc > 2) { $host = $argv[1]; } -$hosts = array('localhost', '8.2.3.5'); +$hosts = array('localhost'); $socket = new TSocket($host, $port); $socket = new TSocketPool($hosts, $port); @@ -48,8 +48,8 @@ if ($MODE == 'inline') { } else { $bufferedSocket = new TBufferedTransport($socket, 1024, 1024); $transport = $bufferedSocket; - $protocol = new TBinaryProtocol(); - $testClient = new ThriftTestClient($transport, $protocol); + $protocol = new TBinaryProtocol($transport); + $testClient = new ThriftTestClient($protocol); } $transport->open(); diff --git a/test/py/TestClient.py b/test/py/TestClient.py index a2fa3c71..3e487337 100755 --- a/test/py/TestClient.py +++ b/test/py/TestClient.py @@ -48,8 +48,8 @@ if framed: else: transport = TTransport.TBufferedTransport(socket) -protocol = TBinaryProtocol.TBinaryProtocol() -client = ThriftTest.Client(transport, protocol) +protocol = TBinaryProtocol.TBinaryProtocol(transport) +client = ThriftTest.Client(protocol) # Connect! transport.open() diff --git a/test/py/TestServer.py b/test/py/TestServer.py index 96312c56..e3f76f84 100755 --- a/test/py/TestServer.py +++ b/test/py/TestServer.py @@ -51,10 +51,10 @@ class TestHandler: x.message = str raise x -transport = TSocket.TServerSocket(9090) -protocol = TBinaryProtocol.TBinaryProtocol() handler = TestHandler() -processor = ThriftTest.Processor(handler, protocol) -factory = TTransport.TBufferedTransportFactory() -server = TServer.TSimpleServer(processor, transport, factory) +processor = ThriftTest.Processor(handler) +transport = TSocket.TServerSocket(9090) +tfactory = TTransport.TBufferedTransportFactory() +pfactory = TBinaryProtocol.TBinaryProtocolFactory() +server = TServer.TThreadedServer(processor, transport, tfactory, pfactory) server.serve() -- 2.17.1