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
This commit is contained in:
Mark Slee 2006-10-26 04:56:18 +00:00
parent 35ae1c784c
commit 1dd819cd2b
5 changed files with 14 additions and 16 deletions

View File

@ -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;

View File

@ -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 + "...");

View File

@ -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();

View File

@ -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()

View File

@ -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()