ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From voze...@apache.org
Subject [07/10] ignite git commit: IGNITE-6379 - Fixed CacheExchangeMessageDuplicatedStateTest
Date Thu, 14 Sep 2017 14:41:07 GMT
IGNITE-6379 - Fixed CacheExchangeMessageDuplicatedStateTest


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

Branch: refs/heads/ignite-5896
Commit: 2776cb6f33c409e582311a0c250f2afa652ae863
Parents: c0bd57c
Author: Alexey Goncharuk <alexey.goncharuk@gmail.com>
Authored: Thu Sep 14 11:33:19 2017 +0300
Committer: Alexey Goncharuk <alexey.goncharuk@gmail.com>
Committed: Thu Sep 14 11:33:19 2017 +0300

----------------------------------------------------------------------
 ...CacheExchangeMessageDuplicatedStateTest.java | 27 +++++++++++++-------
 1 file changed, 18 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/2776cb6f/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheExchangeMessageDuplicatedStateTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheExchangeMessageDuplicatedStateTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheExchangeMessageDuplicatedStateTest.java
index bff63fb..3341095 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheExchangeMessageDuplicatedStateTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheExchangeMessageDuplicatedStateTest.java
@@ -27,6 +27,8 @@ import org.apache.ignite.cluster.ClusterNode;
 import org.apache.ignite.configuration.CacheConfiguration;
 import org.apache.ignite.configuration.IgniteConfiguration;
 import org.apache.ignite.internal.TestRecordingCommunicationSpi;
+import org.apache.ignite.internal.processors.cache.distributed.dht.preloader.CachePartitionFullCountersMap;
+import org.apache.ignite.internal.processors.cache.distributed.dht.preloader.CachePartitionPartialCountersMap;
 import org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionFullMap;
 import org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionMap;
 import org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionsAbstractMessage;
@@ -193,7 +195,7 @@ public class CacheExchangeMessageDuplicatedStateTest extends GridCommonAbstractT
 
         List<Object> msgs = commSpi0.recordedMessages(false);
 
-        assertTrue(msgs.size() > 0);
+        assertTrue(!msgs.isEmpty());
 
         for (Object msg : msgs) {
             assertTrue("Unexpected messages: " + msg, msg instanceof GridDhtPartitionsFullMessage);
@@ -217,7 +219,7 @@ public class CacheExchangeMessageDuplicatedStateTest extends GridCommonAbstractT
 
             List<Object> msgs = commSpi0.recordedMessages(false);
 
-            assertTrue(msgs.size() > 0);
+            assertTrue(!msgs.isEmpty());
 
             for (Object msg : msgs) {
                 assertTrue("Unexpected messages: " + msg, msg instanceof GridDhtPartitionsSingleMessage);
@@ -244,12 +246,19 @@ public class CacheExchangeMessageDuplicatedStateTest extends GridCommonAbstractT
 
         assertFalse(dupPartsData.containsKey(CU.cacheId(AFF3_CACHE1)));
 
-        Map<Integer, Map<Integer, Long>> partCntrs =
-            getFieldValue(getFieldValue(msg, "partCntrs"), "map");
+        Map<Integer, CachePartitionFullCountersMap> partCntrs =
+            getFieldValue(getFieldValue(msg, "partCntrs2"), "map");
 
         if (partCntrs != null) {
-            for (Map<Integer, Long> cntrs : partCntrs.values())
-                assertTrue(cntrs.isEmpty());
+            for (CachePartitionFullCountersMap cntrs : partCntrs.values()) {
+                long[] initialUpdCntrs = getFieldValue(cntrs, "initialUpdCntrs");
+                long[] updCntrs = getFieldValue(cntrs, "updCntrs");
+
+                for (int i = 0; i < initialUpdCntrs.length; i++) {
+                    assertEquals(0, initialUpdCntrs[i]);
+                    assertEquals(0, updCntrs[i]);
+                }
+            }
         }
     }
 
@@ -266,11 +275,11 @@ public class CacheExchangeMessageDuplicatedStateTest extends GridCommonAbstractT
 
         assertFalse(dupPartsData.containsKey(CU.cacheId(AFF3_CACHE1)));
 
-        Map<Integer, Map<Integer, Long>> partCntrs = getFieldValue(msg, "partCntrs");
+        Map<Integer, CachePartitionPartialCountersMap> partCntrs = getFieldValue(msg,
"partCntrs");
 
         if (partCntrs != null) {
-            for (Map<Integer, Long> cntrs : partCntrs.values())
-                assertTrue(cntrs.isEmpty());
+            for (CachePartitionPartialCountersMap cntrs : partCntrs.values())
+                assertEquals(0, cntrs.size());
         }
     }
 


Mime
View raw message