THRIFT-2350 Add async calls to normal JavaScript
Patch: Randy Abernethy
diff --git a/lib/nodejs/test/client.js b/lib/nodejs/test/client.js
index e7d6e61..90d7467 100644
--- a/lib/nodejs/test/client.js
+++ b/lib/nodejs/test/client.js
@@ -17,10 +17,9 @@
* under the License.
*/
-//Client test for the following I/O stack:
-// TBinaryProtocol
-// TFramedTransport
-// TSocket
+//This is the client side test for the standard Apache Thrift
+//"ThriftTest" suite. This client will test any protocol/transport
+//combination specified on the command line.
var assert = require('assert');
var thrift = require('thrift');
@@ -32,8 +31,8 @@
var program = require('commander');
program
- .option('-p, --protocol <protocol>', 'Set thift protocol (binary|json) [protocol]')
- .option('-t, --transport <transport>', 'Set thift transport (buffered|framed) [transport]')
+ .option('-p, --protocol <protocol>', 'Set thrift protocol (binary|json) [protocol]')
+ .option('-t, --transport <transport>', 'Set thrift transport (buffered|framed) [transport]')
.parse(process.argv);
var protocol = undefined;
diff --git a/lib/nodejs/test/test_handler.js b/lib/nodejs/test/test_handler.js
index e697408..33c8941 100644
--- a/lib/nodejs/test/test_handler.js
+++ b/lib/nodejs/test/test_handler.js
@@ -150,7 +150,7 @@
testMulti: function(arg0, arg1, arg2, arg3, arg4, arg5, result) {
console.log('testMulti()');
- var hello = new ttypes.Xtruct();;
+ var hello = new ttypes.Xtruct();
hello.string_thing = 'Hello2';
hello.byte_thing = arg0;
hello.i32_thing = arg1;
@@ -178,11 +178,11 @@
x.message = 'This is an Xception';
result(x);
} else if (arg0 === ('Xception2')) {
- var x = new ttypes.Xception2();
- x.errorCode = 2002;
- x.struct_thing = new ttypes.Xtruct();
- x.struct_thing.string_thing = 'This is an Xception2';
- result(x);
+ var x2 = new ttypes.Xception2();
+ x2.errorCode = 2002;
+ x2.struct_thing = new ttypes.Xtruct();
+ x2.struct_thing.string_thing = 'This is an Xception2';
+ result(x2);
}
var res = new ttypes.Xtruct();
@@ -192,4 +192,4 @@
testOneway: function(sleepFor, result) {
console.log('testOneway(' + sleepFor + ') => JavaScript (like Rust) never sleeps!');
}
-} //ThriftTestSvcHandler
+}; //ThriftTestSvcHandler