From 098b57724e94970862f31990299b4021f566d5e5 Mon Sep 17 00:00:00 2001 From: murgatroid99 Date: Mon, 26 Jan 2015 18:12:30 -0800 Subject: [PATCH] Removed all uses of highland --- src/node/package.json | 1 - src/node/test/client_server_test.js | 39 +++++++++++++++++++++-------- 2 files changed, 29 insertions(+), 11 deletions(-) diff --git a/src/node/package.json b/src/node/package.json index 8a0b51dda8e..028dc20555b 100644 --- a/src/node/package.json +++ b/src/node/package.json @@ -13,7 +13,6 @@ "underscore.string": "^3.0.0" }, "devDependencies": { - "highland": "~2.2.0", "mocha": "~1.21.0", "minimist": "^1.1.0" }, diff --git a/src/node/test/client_server_test.js b/src/node/test/client_server_test.js index d657ef41a46..9de4f7eb1de 100644 --- a/src/node/test/client_server_test.js +++ b/src/node/test/client_server_test.js @@ -38,7 +38,6 @@ var grpc = require('bindings')('grpc.node'); var Server = require('../src/server'); var client = require('../src/client'); var common = require('../src/common'); -var _ = require('highland'); var ca_path = path.join(__dirname, 'data/ca.pem'); @@ -85,6 +84,23 @@ function cancelHandler(stream) { // do nothing } +/** + * Serialize a string to a Buffer + * @param {string} value The string to serialize + * @return {Buffer} The serialized value + */ +function stringSerialize(value) { + return new Buffer(value); +} + +/** + * Deserialize a Buffer to a string + * @param {Buffer} buffer The buffer to deserialize + * @return {string} The string value of the buffer + */ +function stringDeserialize(buffer) { +} + describe('echo client', function() { var server; var channel; @@ -105,10 +121,12 @@ describe('echo client', function() { var messages = ['echo1', 'echo2', 'echo3', 'echo4']; var stream = client.makeRequest( channel, - 'echo'); - _(messages).map(function(val) { - return new Buffer(val); - }).pipe(stream); + 'echo', + stringSerialize, + stringDeserialize); + for (var i = 0; i < messages.length; i++) { + stream.write(messages[i]); + } var index = 0; stream.on('data', function(chunk) { assert.equal(messages[index], chunk.toString()); @@ -186,11 +204,12 @@ describe('secure echo client', function() { var messages = ['echo1', 'echo2', 'echo3', 'echo4']; var stream = client.makeRequest( channel, - 'echo'); - - _(messages).map(function(val) { - return new Buffer(val); - }).pipe(stream); + 'echo', + stringSerialize, + stringDeserialize); + for (var i = 0; i < messages.length; i++) { + stream.write(messages[i]); + } var index = 0; stream.on('data', function(chunk) { assert.equal(messages[index], chunk.toString());