ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From se...@apache.org
Subject [09/39] incubator-ignite git commit: Ignite-54-55 tests fix
Date Thu, 05 Feb 2015 21:40:20 GMT
Ignite-54-55 tests fix


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

Branch: refs/heads/ignite-sql-tests
Commit: 7870d431ae71641b2bbb708fc22e2b6a78d211a3
Parents: b27d701
Author: Anton Vinogradov <avinogradov@gridgain.com>
Authored: Sun Jan 25 23:30:20 2015 +0300
Committer: Anton Vinogradov <avinogradov@gridgain.com>
Committed: Sun Jan 25 23:30:20 2015 +0300

----------------------------------------------------------------------
 .../processors/cache/GridCacheQueryLoadSelfTest.java   | 13 ++++---------
 .../cache/GridCacheQueryMultiThreadedSelfTest.java     | 10 ++++++++++
 2 files changed, 14 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7870d431/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheQueryLoadSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheQueryLoadSelfTest.java
b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheQueryLoadSelfTest.java
index d181579..e082573 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheQueryLoadSelfTest.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheQueryLoadSelfTest.java
@@ -256,8 +256,7 @@ public class GridCacheQueryLoadSelfTest extends GridCommonAbstractTest
{
         assert res.size() == PUT_CNT - 5;
         assert size(ValueObject.class) == PUT_CNT - 5;
 
-        for (Integer key : keys)
-            cache.clearLocally(key);
+        cache.clear();
 
         assert cache.isEmpty();
         assertEquals(0, cache.size());
@@ -298,9 +297,7 @@ public class GridCacheQueryLoadSelfTest extends GridCommonAbstractTest
{
         assert res.size() == PUT_CNT - 5;
         assert size(ValueObject.class) == PUT_CNT - 5;
 
-        // Invalidate will remove entries.
-        for (Integer key : keys)
-            cache.clearLocally(key);
+        cache.clear();
 
         assert cache.isEmpty();
         assertEquals(0, cache.size());
@@ -332,8 +329,7 @@ public class GridCacheQueryLoadSelfTest extends GridCommonAbstractTest
{
         for (int i = 0; i < PUT_CNT; i++)
             keys[i] = i;
 
-        for (Integer key : keys)
-            cache.clearLocally(key);
+        cache.clear();
 
         assert cache.isEmpty();
         assertEquals(0, cache.size());
@@ -370,8 +366,7 @@ public class GridCacheQueryLoadSelfTest extends GridCommonAbstractTest
{
         for (int i = 0; i < PUT_CNT; i++)
             keys[i] = i;
 
-        for (Integer key : keys)
-            cache.clearLocally(key);
+        cache.clear();
 
         assert cache.isEmpty();
         assertEquals(0, cache.size());

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/7870d431/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheQueryMultiThreadedSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheQueryMultiThreadedSelfTest.java
b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheQueryMultiThreadedSelfTest.java
index 096bb2e..d206ce8 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheQueryMultiThreadedSelfTest.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheQueryMultiThreadedSelfTest.java
@@ -186,6 +186,16 @@ public class GridCacheQueryMultiThreadedSelfTest extends GridCommonAbstractTest
 
             c.removeAll(F.<CacheEntry<Object, Object>>alwaysTrue());
 
+            // Fix for tests where mapping was removed at primary node
+            // but was not removed at others.
+            // removeAll() removes mapping only when it presents at a primary node.
+            // To remove all mappings used force remove by key.
+            if (c.size() > 0) {
+                for (Object k : c.keySet()) {
+                    c.remove(k);
+                }
+            }
+
             Iterator<Map.Entry<Object, Object>> it = c.swapIterator();
 
             while (it.hasNext()) {


Mime
View raw message