IGNITE-7573 Fixed full API tests to be compliant with baseline topology

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

Branch: refs/heads/ignite-7485-2
Commit: 2b7623acf09879ea62357fbf5019ee9aece70f30
Parents: e74519f
Author: Alexey Goncharuk <alexey.goncha...@gmail.com>
Authored: Wed Jan 31 16:52:24 2018 +0300
Committer: Alexey Goncharuk <alexey.goncha...@gmail.com>
Committed: Wed Jan 31 16:52:24 2018 +0300

----------------------------------------------------------------------
 .../cache/GridCacheAbstractFullApiSelfTest.java          | 11 ++++-------
 .../baseline/IgniteBaselineAbstractFullApiSelfTest.java  |  4 +++-
 2 files changed, 7 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/2b7623ac/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractFullApiSelfTest.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractFullApiSelfTest.java
 
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractFullApiSelfTest.java
index e6c9589..2e6a19c 100644
--- 
a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractFullApiSelfTest.java
+++ 
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractFullApiSelfTest.java
@@ -463,14 +463,11 @@ public abstract class GridCacheAbstractFullApiSelfTest 
extends GridCacheAbstract
         for (int i = 0; i < gridCount(); i++)
             assertEquals(globalPrimarySize, jcache(i).size(PRIMARY));
 
-        int times = 1;
+        // Check how many instances of any given key there is in the cluster.
+        int globalSize = 0;
 
-        if (cacheMode() == REPLICATED)
-            times = gridCount();
-        else if (cacheMode() == PARTITIONED)
-            times = Math.min(gridCount(), 
jcache().getConfiguration(CacheConfiguration.class).getBackups() + 1);
-
-        int globalSize = globalPrimarySize * times;
+        for (String key : map.keySet())
+            globalSize += 
affinity(jcache()).mapKeyToPrimaryAndBackups(key).size();
 
         for (int i = 0; i < gridCount(); i++)
             assertEquals(globalSize, jcache(i).size(ALL));

http://git-wip-us.apache.org/repos/asf/ignite/blob/2b7623ac/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/baseline/IgniteBaselineAbstractFullApiSelfTest.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/baseline/IgniteBaselineAbstractFullApiSelfTest.java
 
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/baseline/IgniteBaselineAbstractFullApiSelfTest.java
index 8dcfc0b..d78c289 100644
--- 
a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/baseline/IgniteBaselineAbstractFullApiSelfTest.java
+++ 
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/baseline/IgniteBaselineAbstractFullApiSelfTest.java
@@ -19,6 +19,7 @@ package 
org.apache.ignite.internal.processors.cache.persistence.baseline;
 import org.apache.ignite.configuration.DataRegionConfiguration;
 import org.apache.ignite.configuration.DataStorageConfiguration;
 import org.apache.ignite.configuration.IgniteConfiguration;
+import org.apache.ignite.configuration.WALMode;
 import 
org.apache.ignite.internal.processors.cache.GridCacheAbstractFullApiSelfTest;
 
 /**
@@ -33,7 +34,8 @@ public abstract class IgniteBaselineAbstractFullApiSelfTest 
extends GridCacheAbs
             .setDefaultDataRegionConfiguration(
                 new DataRegionConfiguration()
                     .setMaxSize(200 * 1024 * 1024)
-                    .setPersistenceEnabled(true)));
+                    .setPersistenceEnabled(true))
+            .setWalMode(WALMode.LOG_ONLY));
 
         return cfg;
     }

Reply via email to