aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/node
diff options
context:
space:
mode:
authorGravatar Jan Tattermusch <jtattermusch@users.noreply.github.com>2015-07-24 13:49:24 -0700
committerGravatar Jan Tattermusch <jtattermusch@users.noreply.github.com>2015-07-24 13:49:24 -0700
commitb3ff7418c62fe4dc03cf5e1265135550b330d1b7 (patch)
tree2642953c262ce05c29abf1a3e3bbfbd34a51180e /src/node
parente8cdd54d6f43be0d1f4115a5ab240f31d6305a3d (diff)
parenta627d8939d4ea116a5b4f8ce8df0105db421edc3 (diff)
Merge pull request #2630 from murgatroid99/node_completion_key_names
Changed object keys to valid identifier names
Diffstat (limited to 'src/node')
-rw-r--r--src/node/ext/call.cc8
-rw-r--r--src/node/ext/server.cc2
-rw-r--r--src/node/src/server.js2
-rw-r--r--src/node/test/call_test.js4
-rw-r--r--src/node/test/end_to_end_test.js110
5 files changed, 63 insertions, 63 deletions
diff --git a/src/node/ext/call.cc b/src/node/ext/call.cc
index b647735ead..dc45c8d8ae 100644
--- a/src/node/ext/call.cc
+++ b/src/node/ext/call.cc
@@ -192,7 +192,7 @@ class SendMetadataOp : public Op {
}
protected:
std::string GetTypeString() const {
- return "send metadata";
+ return "send_metadata";
}
};
@@ -216,7 +216,7 @@ class SendMessageOp : public Op {
}
protected:
std::string GetTypeString() const {
- return "send message";
+ return "send_message";
}
};
@@ -232,7 +232,7 @@ class SendClientCloseOp : public Op {
}
protected:
std::string GetTypeString() const {
- return "client close";
+ return "client_close";
}
};
@@ -276,7 +276,7 @@ class SendServerStatusOp : public Op {
}
protected:
std::string GetTypeString() const {
- return "send status";
+ return "send_status";
}
};
diff --git a/src/node/ext/server.cc b/src/node/ext/server.cc
index 34cde9ffab..8554fce777 100644
--- a/src/node/ext/server.cc
+++ b/src/node/ext/server.cc
@@ -108,7 +108,7 @@ class NewCallOp : public Op {
protected:
std::string GetTypeString() const {
- return "new call";
+ return "new_call";
}
};
diff --git a/src/node/src/server.js b/src/node/src/server.js
index cb86b95f38..e876313d96 100644
--- a/src/node/src/server.js
+++ b/src/node/src/server.js
@@ -560,7 +560,7 @@ function Server(options) {
if (err) {
return;
}
- var details = event['new call'];
+ var details = event.new_call;
var call = details.call;
var method = details.method;
var metadata = details.metadata;
diff --git a/src/node/test/call_test.js b/src/node/test/call_test.js
index 0079144ae6..942c31ac68 100644
--- a/src/node/test/call_test.js
+++ b/src/node/test/call_test.js
@@ -132,7 +132,7 @@ describe('call', function() {
'key2': ['value2']};
call.startBatch(batch, function(err, resp) {
assert.ifError(err);
- assert.deepEqual(resp, {'send metadata': true});
+ assert.deepEqual(resp, {'send_metadata': true});
done();
});
});
@@ -147,7 +147,7 @@ describe('call', function() {
};
call.startBatch(batch, function(err, resp) {
assert.ifError(err);
- assert.deepEqual(resp, {'send metadata': true});
+ assert.deepEqual(resp, {'send_metadata': true});
done();
});
});
diff --git a/src/node/test/end_to_end_test.js b/src/node/test/end_to_end_test.js
index 667852f382..5d3baf823d 100644
--- a/src/node/test/end_to_end_test.js
+++ b/src/node/test/end_to_end_test.js
@@ -85,37 +85,37 @@ describe('end-to-end', function() {
call.startBatch(client_batch, function(err, response) {
assert.ifError(err);
assert.deepEqual(response, {
- 'send metadata': true,
- 'client close': true,
- 'metadata': {},
- 'status': {
- 'code': grpc.status.OK,
- 'details': status_text,
- 'metadata': {}
+ send_metadata: true,
+ client_close: true,
+ metadata: {},
+ status: {
+ code: grpc.status.OK,
+ details: status_text,
+ metadata: {}
}
});
done();
});
server.requestCall(function(err, call_details) {
- var new_call = call_details['new call'];
+ var new_call = call_details.new_call;
assert.notEqual(new_call, null);
var server_call = new_call.call;
assert.notEqual(server_call, null);
var server_batch = {};
server_batch[grpc.opType.SEND_INITIAL_METADATA] = {};
server_batch[grpc.opType.SEND_STATUS_FROM_SERVER] = {
- 'metadata': {},
- 'code': grpc.status.OK,
- 'details': status_text
+ metadata: {},
+ code: grpc.status.OK,
+ details: status_text
};
server_batch[grpc.opType.RECV_CLOSE_ON_SERVER] = true;
server_call.startBatch(server_batch, function(err, response) {
assert.ifError(err);
assert.deepEqual(response, {
- 'send metadata': true,
- 'send status': true,
- 'cancelled': false
+ send_metadata: true,
+ send_status: true,
+ cancelled: false
});
done();
});
@@ -131,7 +131,7 @@ describe('end-to-end', function() {
Infinity);
var client_batch = {};
client_batch[grpc.opType.SEND_INITIAL_METADATA] = {
- 'client_key': ['client_value']
+ client_key: ['client_value']
};
client_batch[grpc.opType.SEND_CLOSE_FROM_CLIENT] = true;
client_batch[grpc.opType.RECV_INITIAL_METADATA] = true;
@@ -139,18 +139,18 @@ describe('end-to-end', function() {
call.startBatch(client_batch, function(err, response) {
assert.ifError(err);
assert.deepEqual(response,{
- 'send metadata': true,
- 'client close': true,
+ send_metadata: true,
+ client_close: true,
metadata: {server_key: ['server_value']},
- status: {'code': grpc.status.OK,
- 'details': status_text,
- 'metadata': {}}
+ status: {code: grpc.status.OK,
+ details: status_text,
+ metadata: {}}
});
done();
});
server.requestCall(function(err, call_details) {
- var new_call = call_details['new call'];
+ var new_call = call_details.new_call;
assert.notEqual(new_call, null);
assert.strictEqual(new_call.metadata.client_key[0],
'client_value');
@@ -158,20 +158,20 @@ describe('end-to-end', function() {
assert.notEqual(server_call, null);
var server_batch = {};
server_batch[grpc.opType.SEND_INITIAL_METADATA] = {
- 'server_key': ['server_value']
+ server_key: ['server_value']
};
server_batch[grpc.opType.SEND_STATUS_FROM_SERVER] = {
- 'metadata': {},
- 'code': grpc.status.OK,
- 'details': status_text
+ metadata: {},
+ code: grpc.status.OK,
+ details: status_text
};
server_batch[grpc.opType.RECV_CLOSE_ON_SERVER] = true;
server_call.startBatch(server_batch, function(err, response) {
assert.ifError(err);
assert.deepEqual(response, {
- 'send metadata': true,
- 'send status': true,
- 'cancelled': false
+ send_metadata: true,
+ send_status: true,
+ cancelled: false
});
done();
});
@@ -196,19 +196,19 @@ describe('end-to-end', function() {
client_batch[grpc.opType.RECV_STATUS_ON_CLIENT] = true;
call.startBatch(client_batch, function(err, response) {
assert.ifError(err);
- assert(response['send metadata']);
- assert(response['client close']);
+ assert(response.send_metadata);
+ assert(response.client_close);
assert.deepEqual(response.metadata, {});
- assert(response['send message']);
+ assert(response.send_message);
assert.strictEqual(response.read.toString(), reply_text);
- assert.deepEqual(response.status, {'code': grpc.status.OK,
- 'details': status_text,
- 'metadata': {}});
+ assert.deepEqual(response.status, {code: grpc.status.OK,
+ details: status_text,
+ metadata: {}});
done();
});
server.requestCall(function(err, call_details) {
- var new_call = call_details['new call'];
+ var new_call = call_details.new_call;
assert.notEqual(new_call, null);
var server_call = new_call.call;
assert.notEqual(server_call, null);
@@ -217,18 +217,18 @@ describe('end-to-end', function() {
server_batch[grpc.opType.RECV_MESSAGE] = true;
server_call.startBatch(server_batch, function(err, response) {
assert.ifError(err);
- assert(response['send metadata']);
+ assert(response.send_metadata);
assert.strictEqual(response.read.toString(), req_text);
var response_batch = {};
response_batch[grpc.opType.SEND_MESSAGE] = new Buffer(reply_text);
response_batch[grpc.opType.SEND_STATUS_FROM_SERVER] = {
- 'metadata': {},
- 'code': grpc.status.OK,
- 'details': status_text
+ metadata: {},
+ code: grpc.status.OK,
+ details: status_text
};
response_batch[grpc.opType.RECV_CLOSE_ON_SERVER] = true;
server_call.startBatch(response_batch, function(err, response) {
- assert(response['send status']);
+ assert(response.send_status);
assert(!response.cancelled);
done();
});
@@ -251,9 +251,9 @@ describe('end-to-end', function() {
call.startBatch(client_batch, function(err, response) {
assert.ifError(err);
assert.deepEqual(response, {
- 'send metadata': true,
- 'send message': true,
- 'metadata': {}
+ send_metadata: true,
+ send_message: true,
+ metadata: {}
});
var req2_batch = {};
req2_batch[grpc.opType.SEND_MESSAGE] = new Buffer(requests[1]);
@@ -262,12 +262,12 @@ describe('end-to-end', function() {
call.startBatch(req2_batch, function(err, resp) {
assert.ifError(err);
assert.deepEqual(resp, {
- 'send message': true,
- 'client close': true,
- 'status': {
- 'code': grpc.status.OK,
- 'details': status_text,
- 'metadata': {}
+ send_message: true,
+ client_close: true,
+ status: {
+ code: grpc.status.OK,
+ details: status_text,
+ metadata: {}
}
});
done();
@@ -275,7 +275,7 @@ describe('end-to-end', function() {
});
server.requestCall(function(err, call_details) {
- var new_call = call_details['new call'];
+ var new_call = call_details.new_call;
assert.notEqual(new_call, null);
var server_call = new_call.call;
assert.notEqual(server_call, null);
@@ -284,7 +284,7 @@ describe('end-to-end', function() {
server_batch[grpc.opType.RECV_MESSAGE] = true;
server_call.startBatch(server_batch, function(err, response) {
assert.ifError(err);
- assert(response['send metadata']);
+ assert(response.send_metadata);
assert.strictEqual(response.read.toString(), requests[0]);
var snd_batch = {};
snd_batch[grpc.opType.RECV_MESSAGE] = true;
@@ -294,13 +294,13 @@ describe('end-to-end', function() {
var end_batch = {};
end_batch[grpc.opType.RECV_CLOSE_ON_SERVER] = true;
end_batch[grpc.opType.SEND_STATUS_FROM_SERVER] = {
- 'metadata': {},
- 'code': grpc.status.OK,
- 'details': status_text
+ metadata: {},
+ code: grpc.status.OK,
+ details: status_text
};
server_call.startBatch(end_batch, function(err, response) {
assert.ifError(err);
- assert(response['send status']);
+ assert(response.send_status);
assert(!response.cancelled);
done();
});