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
diff --git a/test/java/src/TestClient.java b/test/java/src/TestClient.java
index 546265c..7e2e49e 100644
--- a/test/java/src/TestClient.java
+++ b/test/java/src/TestClient.java
@@ -69,9 +69,9 @@
}
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 fe70594..bf3f685 100644
--- a/test/java/src/TestServer.java
+++ b/test/java/src/TestServer.java
@@ -237,12 +237,10 @@
}
// 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 @@
// 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 235abbe..0f1540c 100644
--- a/test/php/TestClient.php
+++ b/test/php/TestClient.php
@@ -36,7 +36,7 @@
$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 @@
} 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 a2fa3c7..3e48733 100755
--- a/test/py/TestClient.py
+++ b/test/py/TestClient.py
@@ -48,8 +48,8 @@
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 96312c5..e3f76f8 100755
--- a/test/py/TestServer.py
+++ b/test/py/TestServer.py
@@ -51,10 +51,10 @@
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()