ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [3/5] incubator-ignite git commit: #IGNITE-SQL Fixed tests
Date Thu, 12 Feb 2015 16:40:28 GMT
#IGNITE-SQL Fixed tests


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

Branch: refs/heads/ignite-sql-tests
Commit: deabbaeff13de0b02cb7c1dc7d59559074ef449f
Parents: aa4ddbe
Author: nikolay_tikhonov <ntikhonov@gridgain.com>
Authored: Thu Feb 12 19:30:38 2015 +0300
Committer: nikolay_tikhonov <ntikhonov@gridgain.com>
Committed: Thu Feb 12 19:30:38 2015 +0300

----------------------------------------------------------------------
 .../cache/IgniteCacheQueryIndexSelfTest.java          |  4 ++--
 .../cache/IgniteCacheAbstractQuerySelfTest.java       | 14 +++++++-------
 .../near/IgniteCachePartitionedQuerySelfTest.java     | 14 ++++++--------
 3 files changed, 15 insertions(+), 17 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/deabbaef/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheQueryIndexSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheQueryIndexSelfTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheQueryIndexSelfTest.java
index f4c592c..6c7924c 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheQueryIndexSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheQueryIndexSelfTest.java
@@ -89,7 +89,7 @@ public class IgniteCacheQueryIndexSelfTest extends GridCacheAbstractSelfTest
{
         assert map.entrySet().size() == ENTRY_CNT : "Expected: " + ENTRY_CNT + ", but was:
" + cache.size();
         assert map.keySet().size() == ENTRY_CNT : "Expected: " + ENTRY_CNT + ", but was:
" + cache.size();
         assert map.values().size() == ENTRY_CNT : "Expected: " + ENTRY_CNT + ", but was:
" + cache.size();
-        assert cache.size() == ENTRY_CNT : "Expected: " + ENTRY_CNT + ", but was: " + cache.size();
+        assert cache.localSize() == ENTRY_CNT : "Expected: " + ENTRY_CNT + ", but was: "
+ cache.localSize();
     }
 
     /**
@@ -98,7 +98,7 @@ public class IgniteCacheQueryIndexSelfTest extends GridCacheAbstractSelfTest
{
      */
     private void checkQuery(IgniteCache<Integer, CacheValue> cache) throws Exception
{
         QueryCursor<Cache.Entry<Integer, CacheValue>> qry =
-            cache.query(new SqlQuery("val >= 5"));
+            cache.query(Query.sql(CacheValue.class, "val >= 5"));
 
         Collection<Cache.Entry<Integer, CacheValue>> queried = qry.getAll();
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/deabbaef/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheAbstractQuerySelfTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheAbstractQuerySelfTest.java
b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheAbstractQuerySelfTest.java
index 4cd7d45..18e7c90 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheAbstractQuerySelfTest.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheAbstractQuerySelfTest.java
@@ -1002,16 +1002,16 @@ public abstract class IgniteCacheAbstractQuerySelfTest extends GridCommonAbstrac
 
         assertEquals(5, res.size());
 
-        Iterator<Cache.Entry<Integer, Integer>> it = res.iterator();
+        Set<Integer> checkDuplicate = new HashSet<>();
 
-        for (Integer i = 0; i < 5; i++) {
-            assertTrue(it.hasNext());
-
-            Cache.Entry<Integer, Integer> e = it.next();
+        for (Cache.Entry<Integer, Integer> e : res) {
+            assert e.getKey() < 10 && e.getKey() >= 0;
+            assert e.getValue() < 10 && e.getValue() >= 0;
 
-            assertEquals(i, e.getKey());
-            assertEquals(i, e.getValue());
+            checkDuplicate.add(e.getValue());
         }
+
+        assertEquals(5, checkDuplicate.size());
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/deabbaef/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/IgniteCachePartitionedQuerySelfTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/IgniteCachePartitionedQuerySelfTest.java
b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/IgniteCachePartitionedQuerySelfTest.java
index 2170efa..5720114 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/IgniteCachePartitionedQuerySelfTest.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/IgniteCachePartitionedQuerySelfTest.java
@@ -61,12 +61,10 @@ public class IgniteCachePartitionedQuerySelfTest extends IgniteCacheAbstractQuer
         cache0.put(p3.id(), p3);
         cache0.put(p4.id(), p4);
 
-        assertEquals(4, cache0.size());
+        assertEquals(4, cache0.localSize());
 
-        QueryCursor<Cache.Entry<UUID, Person>> qry =
-            cache0.localQuery(sql(Person.class, "salary < 2000"));
-
-        Collection<Cache.Entry<UUID, Person>> entries = qry.getAll();
+        Collection<Cache.Entry<UUID, Person>> entries =
+            cache0.localQuery(sql(Person.class, "salary < 2000")).getAll();
 
         assert entries != null;
 
@@ -93,7 +91,7 @@ public class IgniteCachePartitionedQuerySelfTest extends IgniteCacheAbstractQuer
         cache0.put(p3.id(), p3);
         cache0.put(p4.id(), p4);
 
-        assertEquals(4, cache0.size());
+        assertEquals(4, cache0.localSize());
 
         // Fields query
         QueryCursor<List<?>> qry = cache0
@@ -132,7 +130,7 @@ public class IgniteCachePartitionedQuerySelfTest extends IgniteCacheAbstractQuer
         cache0.put(p3.id(), p3);
         cache0.put(p4.id(), p4);
 
-        assertEquals(4, cache0.size());
+        assertEquals(4, cache0.localSize());
 
         assert grid(0).nodes().size() == gridCount();
 
@@ -147,7 +145,7 @@ public class IgniteCachePartitionedQuerySelfTest extends IgniteCacheAbstractQuer
         info("Queried entries: " + entries);
 
         // Expect result including backup persons.
-        assertEquals(3 * gridCount(), entries.size());
+        assertEquals(gridCount(), entries.size());
 
         checkResult(entries, p1, p3, p4);
     }


Mime
View raw message