THRIFT-847 Test Framework harmonization across all languages
Added
--port arg (=9090) Port number to listen
to nodejs server at lib/nodejs/test/server.js and added
--host arg (=localhost) Host to connect
--port arg (=9090) Port number to connect
to nodejs client at lib/nodejs/test/client.js
Patch: Chamila Dilshan Wijayarathna
diff --git a/lib/nodejs/test/server.js b/lib/nodejs/test/server.js
index 6afff07..78f5075 100644
--- a/lib/nodejs/test/server.js
+++ b/lib/nodejs/test/server.js
@@ -29,6 +29,7 @@
program
.option('-p, --protocol <protocol>', 'Set thift protocol (binary|json) [protocol]')
.option('-t, --transport <transport>', 'Set thift transport (buffered|framed) [transport]')
+ .option('--port <port>', 'Set thift server port')
.option('--ssl', 'use ssl transport')
.option('--promise', 'test with promise style functions')
.parse(process.argv);
@@ -45,6 +46,12 @@
protocol = thrift.TCompactProtocol;
}
+var port = 9090;
+if (String(program.port) === "undefined"){
+} else {
+ port = program.port;
+}
+
var handler = ThriftTestHandler;
if (program.promise) {
handler = ThriftTestHandlerPromise;
@@ -60,5 +67,5 @@
cert: fs.readFileSync(path.resolve(__dirname, 'server.crt'))
};
}
-thrift.createServer(ThriftTest, handler, options).listen(9090);
+thrift.createServer(ThriftTest, handler, options).listen(port);