try {
if (!protocol_type.empty()) {
if (protocol_type == "binary") {
+ } else if (protocol_type == "compact") {
} else if (protocol_type == "json") {
} else {
throw invalid_argument("Unknown protocol type "+protocol_type);
if (!protocol_type.empty()) {
if (protocol_type == "binary") {
+ } else if (protocol_type == "compact") {
} else if (protocol_type == "json") {
} else {
throw invalid_argument("Unknown protocol type "+protocol_type);
}
}
- if (!transport_type.empty()) {
+ if (!transport_type.empty()) {
if (transport_type == "buffered") {
} else if (transport_type == "framed") {
} else if (transport_type == "http") {
boost::shared_ptr<apache::thrift::concurrency::Thread> thread = factory.newThread(serverThreadRunner);
thread->start();
- cout<<"Press enter to stop the server."<<endl;
- cin.ignore(); //wait until a key is pressed
+ // HACK: cross language test suite is unable to handle cin properly
+ // that's why we stay in a endless loop here
+ while(1){}
+ // FIXME: find another way to stop the server (e.g. a signal)
+ // cout<<"Press enter to stop the server."<<endl;
+ // cin.ignore(); //wait until a key is pressed
server->stop();
thread->join();
testname=${client_server}_${protocol}_${transport}
server_timeout=$((${server_startup_time}+${client_delay}))
printf "%-16s %-11s %-17s" ${client_server} ${protocol} ${transport}
- mkfifo thrift_test_communication
- timeout $server_timeout $server_exec < thrift_test_communication > log/${testname}_server.log 2>&1 &
+ timeout $server_timeout $server_exec > log/${testname}_server.log 2>&1 &
sleep $server_startup_time
$client_exec > log/${testname}_client.log 2>&1
- echo "done" > thrift_test_communication
- rm -f thrift_test_communication
if [ "$?" -eq "0" ]; then
echo " success"