Removed all uses of highland

pull/234/head
murgatroid99 10 years ago
parent bcc0ccdab1
commit 098b57724e
  1. 1
      src/node/package.json
  2. 39
      src/node/test/client_server_test.js

@ -13,7 +13,6 @@
"underscore.string": "^3.0.0"
},
"devDependencies": {
"highland": "~2.2.0",
"mocha": "~1.21.0",
"minimist": "^1.1.0"
},

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

Loading…
Cancel
Save