Fixed CacheExchangeMessageDuplicatedStateTest
@@ -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());
}
}
