ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ivasilin...@apache.org
Subject [4/5] incubator-ignite git commit: #ignite-961: fix comments after review.
Date Mon, 20 Jul 2015 17:26:05 GMT
#ignite-961: fix comments after review.


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

Branch: refs/heads/ignite-961-master
Commit: 09d598e46a083c1ce98274a37d34639f91fc7ba7
Parents: 65c72c5
Author: ivasilinets <ivasilinets@gridgain.com>
Authored: Mon Jul 20 14:55:07 2015 +0300
Committer: ivasilinets <ivasilinets@gridgain.com>
Committed: Mon Jul 20 14:55:07 2015 +0300

----------------------------------------------------------------------
 .../JettyRestProcessorAbstractSelfTest.java     | 39 ++++++++++++++------
 1 file changed, 28 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/09d598e4/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/JettyRestProcessorAbstractSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/JettyRestProcessorAbstractSelfTest.java
b/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/JettyRestProcessorAbstractSelfTest.java
index f1cfe96..7354214 100644
--- a/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/JettyRestProcessorAbstractSelfTest.java
+++ b/modules/clients/src/test/java/org/apache/ignite/internal/processors/rest/JettyRestProcessorAbstractSelfTest.java
@@ -61,7 +61,7 @@ abstract class JettyRestProcessorAbstractSelfTest extends AbstractRestProcessorS
 
     /** {@inheritDoc} */
     @Override protected void beforeTest() throws Exception {
-        grid(0).cache(null).clear();
+        grid(0).cache(null).removeAll();
     }
 
     /** {@inheritDoc} */
@@ -1009,16 +1009,7 @@ abstract class JettyRestProcessorAbstractSelfTest extends AbstractRestProcessorS
 
         assertEquals(2, items.size());
 
-        for (int i = 0; i < GRID_CNT; ++i) {
-            Map<GridRestCommand, GridRestCommandHandler> handlers =
-                GridTestUtils.getFieldValue(grid(i).context().rest(), "handlers");
-
-            GridRestCommandHandler qryHnd = handlers.get(GridRestCommand.CLOSE_SQL_QUERY);
-
-            ConcurrentHashMap<Long, Iterator> its = GridTestUtils.getFieldValue(qryHnd,
"curs");
-
-            assertEquals(0, its.size());
-        }
+        assertFalse(queryCursorFound());
     }
 
     /**
@@ -1074,6 +1065,32 @@ abstract class JettyRestProcessorAbstractSelfTest extends AbstractRestProcessorS
     /**
      * @throws Exception If failed.
      */
+    public void testSqlFieldsQuery() throws Exception {
+        String qry = "select concat(firstName, ' ', lastName) from Person";
+
+        Map<String, String> params = new HashMap<>();
+        params.put("cmd", "qryfieldsexecute");
+        params.put("psz", "10");
+        params.put("cacheName", "person");
+        params.put("qry", URLEncoder.encode(qry));
+
+        String ret = content(params);
+
+        assertNotNull(ret);
+        assertTrue(!ret.isEmpty());
+
+        JSONObject json = JSONObject.fromObject(ret);
+
+        List items = (List)((Map)json.get("response")).get("items");
+
+        assertEquals(4, items.size());
+
+        assertFalse(queryCursorFound());
+    }
+
+    /**
+     * @throws Exception If failed.
+     */
     public void testQueryClose() throws Exception {
         String qry = "salary > ? and salary <= ?";
 


Mime
View raw message