ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akuznet...@apache.org
Subject [16/48] incubator-ignite git commit: #ignite-738: GridCacheAbstractFieldsQuerySelfTest partly use new query API.
Date Thu, 16 Apr 2015 08:38:16 GMT
#ignite-738: GridCacheAbstractFieldsQuerySelfTest partly use new query API.


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

Branch: refs/heads/ignite-737
Commit: 67adbcb18ccd3358ff471829ea0ca28287a13d13
Parents: 8420ea2
Author: ivasilinets <ivasilinets@gridgain.com>
Authored: Mon Apr 13 19:40:14 2015 +0300
Committer: ivasilinets <ivasilinets@gridgain.com>
Committed: Mon Apr 13 19:40:14 2015 +0300

----------------------------------------------------------------------
 .../cache/GridCacheAbstractFieldsQuerySelfTest.java  | 15 +++++++--------
 1 file changed, 7 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/67adbcb1/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractFieldsQuerySelfTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractFieldsQuerySelfTest.java
b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractFieldsQuerySelfTest.java
index 7f6619a..a2046ab 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractFieldsQuerySelfTest.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractFieldsQuerySelfTest.java
@@ -20,6 +20,7 @@ package org.apache.ignite.internal.processors.cache;
 import org.apache.ignite.*;
 import org.apache.ignite.cache.*;
 import org.apache.ignite.cache.affinity.*;
+import org.apache.ignite.cache.query.*;
 import org.apache.ignite.cache.query.annotations.*;
 import org.apache.ignite.configuration.*;
 import org.apache.ignite.internal.*;
@@ -764,15 +765,13 @@ public abstract class GridCacheAbstractFieldsQuerySelfTest extends GridCommonAbs
 
     /** @throws Exception If failed. */
     public void testNamedCache() throws Exception {
-        GridCacheAdapter<Integer, Integer> cache = ((IgniteKernal)grid(0)).internalCache(CACHE);
+        IgniteCache<Integer, Integer> cache = grid(0).cache(CACHE);
 
         for (int i = 0; i < 200; i++)
             cache.getAndPut(i, i);
 
-        CacheQuery<List<?>> qry =
-            cache.queries().createSqlFieldsQuery("select * from Integer").projection(grid(0).cluster());
-
-        Collection<List<?>> res = qry.execute().get();
+        Collection<List<?>> res =
+            cache.query(new SqlFieldsQuery("select * from Integer").setLocal(true)).getAll();
 
         assert res != null;
         assert res.size() == (cacheMode() == REPLICATED ? 200 * gridCount() : 200);
@@ -1028,10 +1027,10 @@ public abstract class GridCacheAbstractFieldsQuerySelfTest extends
GridCommonAbs
 
     /** @throws Exception If failed. */
     public void testEmptyGrid() throws Exception {
-        CacheQuery<List<?>> qry = ((IgniteKernal)grid(0)).getCache(null).queries().createSqlFieldsQuery("select
name, " +
-            "age from Person where age = 25");
+        Collection<List<?>> qry = grid(0).cache(null).query(new SqlFieldsQuery("select
name, " +
+            "age from Person where age = 25")).getAll();
 
-        List<?> res = F.first(qry.execute().get());
+        List<?> res = F.first(qry);
 
         assert res != null;
         assert res.size() == 2;


Mime
View raw message