ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [2/7] incubator-ignite git commit: #ignite-964: Fix test for cache query nodejs.
Date Fri, 26 Jun 2015 16:46:57 GMT
#ignite-964: Fix test for cache query nodejs.


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

Branch: refs/heads/ignite-964
Commit: 10d3229e51fa9db9316a5bf78f465efe3d435696
Parents: 967ea54
Author: ivasilinets <ivasilinets@gridgain.com>
Authored: Fri Jun 26 16:46:36 2015 +0300
Committer: ivasilinets <ivasilinets@gridgain.com>
Committed: Fri Jun 26 16:46:36 2015 +0300

----------------------------------------------------------------------
 .../rest/handlers/query/QueryCommandHandler.java         |  2 +-
 modules/nodejs/src/test/js/test-query.js                 | 11 +++++++++--
 2 files changed, 10 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/10d3229e/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/query/QueryCommandHandler.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/query/QueryCommandHandler.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/query/QueryCommandHandler.java
index c866933..6d2a2b7 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/query/QueryCommandHandler.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/query/QueryCommandHandler.java
@@ -70,7 +70,7 @@ public class QueryCommandHandler extends GridRestCommandHandlerAdapter {
 
                             List<Cache.Entry<String, String>> res = cache.query(qry).getAll();
 
-                            return new GridRestResponse("Page size " + res);
+                            return new GridRestResponse(res);
                         }
                         catch (Exception e) {
                             return new GridRestResponse(GridRestResponse.STATUS_FAILED, e.getMessage());

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/10d3229e/modules/nodejs/src/test/js/test-query.js
----------------------------------------------------------------------
diff --git a/modules/nodejs/src/test/js/test-query.js b/modules/nodejs/src/test/js/test-query.js
index cb861fc..a09c5da 100644
--- a/modules/nodejs/src/test/js/test-query.js
+++ b/modules/nodejs/src/test/js/test-query.js
@@ -35,7 +35,14 @@ testSqlQuery = function() {
             });
 
         qry.on("end", function(res) {
-                console.log("!!!!!!!!!!!Result: " + res);
+                assert(res.length, 1, "Result length is not correct" +
+                    "[expected=1, val = " + res.length + "]");
+
+                assert(res[0]["key"] === "key0", "Result value for key is not correct "+
+                    "[expected=key0, real=" + res[0]["key"] + "]");
+
+                assert(res[0]["value"] === "val0", "Result value for key is not correct "+
+                    "[expected=val0, real=" + res[0]["value"] + "]");
 
                 TestUtils.testDone();
             });
@@ -46,7 +53,7 @@ testSqlQuery = function() {
     function put(error, ignite) {
         assert(error == null, "error on put [err=" + error + "]");
 
-        ignite.cache("mycache").put("key", "val", sqlQuery.bind(null, ignite))
+        ignite.cache("mycache").put("key0", "val0", sqlQuery.bind(null, ignite))
     }
 
     TestUtils.startIgniteNode(put);


Mime
View raw message