Ignite-54-55 afterTest fix to support new semantic of removeAll()

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

Branch: refs/heads/ignite-57
Commit: 657563274b2ea3192a106580fe74441d5b4050ac
Parents: 0ba574c
Author: Anton Vinogradov <[email protected]>
Authored: Sun Jan 25 20:35:24 2015 +0300
Committer: Anton Vinogradov <[email protected]>
Committed: Sun Jan 25 20:35:24 2015 +0300

----------------------------------------------------------------------
 .../processors/cache/GridCacheAbstractSelfTest.java       | 10 ++++++++++
 1 file changed, 10 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/65756327/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractSelfTest.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractSelfTest.java
 
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractSelfTest.java
index a18bb9a..49309e7 100644
--- 
a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractSelfTest.java
+++ 
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractSelfTest.java
@@ -119,6 +119,16 @@ public abstract class GridCacheAbstractSelfTest extends 
GridCommonAbstractTest {
 
                                     cache.removeAll();
 
+                                    // 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 (cache.size() > 0) {
+                                        for (String k : cache.keySet()) {
+                                            cache.remove(k);
+                                        }
+                                    }
+
                                     if (offheapTiered(cache)) {
                                         Iterator it = cache.offHeapIterator();
 

Reply via email to