You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by sb...@apache.org on 2015/06/08 21:49:27 UTC

incubator-ignite git commit: #ignite-961: fix getAll method.

Repository: incubator-ignite
Updated Branches:
  refs/heads/ignite-961 576126890 -> 23f41599b


#ignite-961: fix getAll method.


Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/23f41599
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/23f41599
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/23f41599

Branch: refs/heads/ignite-961
Commit: 23f41599b52414d200b93b5e29678f1d73dd0f15
Parents: 5761268
Author: ivasilinets <iv...@gridgain.com>
Authored: Mon Jun 8 22:49:16 2015 +0300
Committer: ivasilinets <iv...@gridgain.com>
Committed: Mon Jun 8 22:49:16 2015 +0300

----------------------------------------------------------------------
 modules/nodejs/src/main/js/cache.js          |  4 ++--
 modules/nodejs/src/test/js/test-cache-api.js | 10 ++++++----
 2 files changed, 8 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/23f41599/modules/nodejs/src/main/js/cache.js
----------------------------------------------------------------------
diff --git a/modules/nodejs/src/main/js/cache.js b/modules/nodejs/src/main/js/cache.js
index 48903fc..3c1c176 100644
--- a/modules/nodejs/src/main/js/cache.js
+++ b/modules/nodejs/src/main/js/cache.js
@@ -153,8 +153,8 @@ Cache.prototype.getAll = function(keys, callback) {
 Cache.concatParams = function(pref, keys) {
   var temp = []
 
-  for (var i = 0; i < keys.length; ++i) {
-    temp.push(Server.pair(pref + i, keys[i]));
+  for (var i = 1; i <= keys.length; ++i) {
+    temp.push(Server.pair(pref + i, keys[i-1]));
   }
 
   return temp;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/23f41599/modules/nodejs/src/test/js/test-cache-api.js
----------------------------------------------------------------------
diff --git a/modules/nodejs/src/test/js/test-cache-api.js b/modules/nodejs/src/test/js/test-cache-api.js
index ec4cab5..ea9e155 100644
--- a/modules/nodejs/src/test/js/test-cache-api.js
+++ b/modules/nodejs/src/test/js/test-cache-api.js
@@ -67,11 +67,13 @@ function onGetAll(cache, keys, expected, error, values) {
   console.log("error get all: " + error)
   assert(error == null, error);
 
-  console.log("values=" + values);
+  for (var i = 0; i < keys.length; ++i) {
+    var key = keys[i];
 
-  for (var i = 0; i < expected.length; ++i) {
-    console.log("valuei=" + values[i]);
-    //assert(value.properties[i].value == expected[i]);
+    assert(!!values[key], "Cannot find key. [key=" + key + "].");
+
+    assert(values[key] === expected[i], "Incorrect value. [key=" + key +
+      ", expected=" + expected[i] + ", val= " + values[key] + "].");
   }
 
   TestUtils.testDone();