# ignite-654 fixed test

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

Branch: refs/heads/ignite-424
Commit: 05c8d2039f41c53a64136d3268c5809aba2ef7d4
Parents: 41963b7
Author: sboikov <sboi...@gridgain.com>
Authored: Tue Mar 31 16:37:27 2015 +0300
Committer: sboikov <sboi...@gridgain.com>
Committed: Tue Mar 31 16:37:27 2015 +0300

----------------------------------------------------------------------
 .../cache/GridCachePutAllFailoverSelfTest.java  | 26 ++++++++++++++------
 1 file changed, 19 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/05c8d203/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCachePutAllFailoverSelfTest.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCachePutAllFailoverSelfTest.java
 
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCachePutAllFailoverSelfTest.java
index 1b3dd2e..4b5c250 100644
--- 
a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCachePutAllFailoverSelfTest.java
+++ 
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCachePutAllFailoverSelfTest.java
@@ -40,6 +40,7 @@ import java.util.*;
 import java.util.concurrent.*;
 import java.util.concurrent.atomic.*;
 
+import static org.apache.ignite.cache.CachePeekMode.*;
 import static org.apache.ignite.cache.CacheWriteSynchronizationMode.*;
 
 /**
@@ -50,7 +51,7 @@ public class GridCachePutAllFailoverSelfTest extends 
GridCommonAbstractTest {
     private static TcpDiscoveryIpFinder ipFinder = new 
TcpDiscoveryVmIpFinder(true);
 
     /** Size of the test map. */
-    private static final int TEST_MAP_SIZE = 30000;
+    private static final int TEST_MAP_SIZE = 30_000;
 
     /** Cache name. */
     private static final String CACHE_NAME = "partitioned";
@@ -339,12 +340,18 @@ public class GridCachePutAllFailoverSelfTest extends 
GridCommonAbstractTest {
             int primaryCacheSize = 0;
 
             for (Ignite g : runningWorkers) {
-                info(">>>>> " + g.cache(CACHE_NAME).localSize());
+                info("Cache size [node=" + g.name() +
+                    ", localSize=" + g.cache(CACHE_NAME).localSize() +
+                    ", localPrimarySize=" + 
g.cache(CACHE_NAME).localSize(PRIMARY) +
+                    ']');
 
                 primaryCacheSize += 
((IgniteKernal)g).internalCache(CACHE_NAME).primarySize();
             }
 
             assertEquals(TEST_MAP_SIZE, primaryCacheSize);
+
+            for (Ignite g : runningWorkers)
+                assertEquals(TEST_MAP_SIZE, g.cache(CACHE_NAME).size(PRIMARY));
         }
         finally {
             stopAllGrids();
@@ -388,9 +395,6 @@ public class GridCachePutAllFailoverSelfTest extends 
GridCommonAbstractTest {
         }
 
         try {
-            // Dummy call to fetch affinity function from remote node
-            master.cluster().mapKeyToNode(CACHE_NAME, "Dummy");
-
             Map<UUID, Collection<Integer>> dataChunks = new HashMap<>();
 
             int chunkCntr = 0;
@@ -539,12 +543,18 @@ public class GridCachePutAllFailoverSelfTest extends 
GridCommonAbstractTest {
             int primaryCacheSize = 0;
 
             for (Ignite g : runningWorkers) {
-                info(">>>>> " + g.cache(CACHE_NAME).localSize());
+                info("Cache size [node=" + g.name() +
+                    ", localSize=" + g.cache(CACHE_NAME).localSize() +
+                    ", localPrimarySize=" + 
g.cache(CACHE_NAME).localSize(PRIMARY) +
+                    ']');
 
-                primaryCacheSize += 
((IgniteKernal)g).internalCache(CACHE_NAME).primarySize();
+                primaryCacheSize += g.cache(CACHE_NAME).localSize(PRIMARY);
             }
 
             assertEquals(TEST_MAP_SIZE, primaryCacheSize);
+
+            for (Ignite g : runningWorkers)
+                assertEquals(TEST_MAP_SIZE, g.cache(CACHE_NAME).size(PRIMARY));
         }
         finally {
             stopAllGrids();
@@ -602,6 +612,8 @@ public class GridCachePutAllFailoverSelfTest extends 
GridCommonAbstractTest {
         cfg.setDiscoverySpi(discoverySpi);
 
         if (gridName.startsWith("master")) {
+            cfg.setClientMode(true);
+
             cfg.setUserAttributes(ImmutableMap.of("segment", "master"));
 
             // For sure.

Reply via email to