ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From agoncha...@apache.org
Subject [3/3] ignite git commit: IGNITE-5267 - Activate nodes after start
Date Tue, 13 Jun 2017 05:24:31 GMT
IGNITE-5267 - Activate nodes after start


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

Branch: refs/heads/ignite-5267-merge-ea
Commit: 195147d573d7cb3fc637f74937ee561b03a3c574
Parents: 4dc81ca
Author: Dmitriy Govorukhin <dmitriy.govorukhin@gmail.com>
Authored: Tue Jun 13 08:23:38 2017 +0300
Committer: Alexey Goncharuk <alexey.goncharuk@gmail.com>
Committed: Tue Jun 13 08:23:38 2017 +0300

----------------------------------------------------------------------
 .../apache/ignite/internal/IgniteKernal.java    |   2 +
 .../service/GridServiceProcessor.java           |   2 -
 .../IgnitePdsCacheRebalancingAbstractTest.java  |   8 +
 .../IgnitePdsContinuousRestartTest.java         |   2 +
 .../persistence/IgnitePdsDynamicCacheTest.java  |   5 +-
 .../IgnitePdsMultiNodePutGetRestartTest.java    |   2 +
 .../persistence/IgnitePdsPageSizesTest.java     |   2 +
 ...gnitePdsRecoveryAfterFileCorruptionTest.java |   2 +
 .../IgnitePdsRemoveDuringRebalancingTest.java   |   2 +
 .../IgnitePersistenceMetricsSelfTest.java       |   7 +-
 .../IgnitePersistentStoreCacheGroupsTest.java   |  20 +-
 ...IgnitePersistentStoreDataStructuresTest.java |   2 -
 .../db/IgnitePdsMultiNodePutGetRestartTest.java |   2 +
 ...PdsPageEvictionDuringPartitionClearTest.java |   2 +
 .../db/IgnitePdsPageEvictionTest.java           |   2 +
 ...tePdsRebalancingOnNotStableTopologyTest.java |   2 +
 .../db/IgnitePdsTransactionsHangTest.java       |   2 +
 .../db/file/IgnitePdsCacheIntegrationTest.java  |   4 +
 .../db/file/IgnitePdsEvictionTest.java          |   2 +
 .../file/IgnitePdsNoActualWalHistoryTest.java   |   2 +
 .../file/ignitePdsCheckpointSimulationTest.java |  10 +
 .../persistence/db/wal/IgnitePdsWalTlbTest.java |   2 +
 .../IgniteWalDirectoriesConfigurationTest.java  |   2 +
 .../wal/IgniteWalHistoryReservationsTest.java   |   8 +
 .../IgniteWalRecoverySeveralRestartsTest.java   |  12 +
 .../db/wal/WalRecoveryTxLogicalRecordsTest.java |   2 +
 .../AbstractNodeJoinTemplate.java               | 743 -------------------
 .../IgniteChangeGlobalStateAbstractTest.java    |  11 +-
 .../IgniteStandByClusterTest.java               | 213 ------
 .../join/JoinActiveNodeToActiveCluster.java     | 431 -----------
 .../join/JoinActiveNodeToInActiveCluster.java   | 227 ------
 .../join/JoinInActiveNodeToActiveCluster.java   | 356 ---------
 .../join/JoinInActiveNodeToInActiveCluster.java | 226 ------
 ...ctiveNodeToActiveClusterWithPersistence.java |  98 ---
 ...iveNodeToInActiveClusterWithPersistence.java |  31 -
 ...ctiveNodeToActiveClusterWithPersistence.java |  86 ---
 ...iveNodeToInActiveClusterWithPersistence.java |  31 -
 ...gniteAbstractStandByClientReconnectTest.java | 336 ---------
 .../IgniteStandByClientReconnectTest.java       | 283 -------
 ...eStandByClientReconnectToNewClusterTest.java | 289 --------
 .../database/IgniteDbAbstractTest.java          |   4 +
 .../database/IgniteDbDynamicCacheSelfTest.java  |   4 +
 42 files changed, 105 insertions(+), 3374 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/195147d5/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java b/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java
index a6ad89e..ff2b7bd 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java
@@ -2755,6 +2755,8 @@ public class IgniteKernal implements IgniteEx, IgniteMXBean, Externalizable {
         guard();
 
         try {
+            checkClusterState();
+
             ctx.cache().dynamicStartCaches(cacheCfgs,
                 true,
                 true).get();

http://git-wip-us.apache.org/repos/asf/ignite/blob/195147d5/modules/core/src/main/java/org/apache/ignite/internal/processors/service/GridServiceProcessor.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/service/GridServiceProcessor.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/service/GridServiceProcessor.java
index 5c1872c..e2cf53b 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/service/GridServiceProcessor.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/service/GridServiceProcessor.java
@@ -364,8 +364,6 @@ public class GridServiceProcessor extends GridProcessorAdapter implements Ignite
         cancelFutures(undepFuts, new IgniteCheckedException("Failed to undeploy service, cluster in active."));
 
         onKernalStop(true);
-
-        busyLock.unblock();
     }
 
     /** {@inheritDoc} */

http://git-wip-us.apache.org/repos/asf/ignite/blob/195147d5/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePdsCacheRebalancingAbstractTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePdsCacheRebalancingAbstractTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePdsCacheRebalancingAbstractTest.java
index a9428f8..f085e48 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePdsCacheRebalancingAbstractTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePdsCacheRebalancingAbstractTest.java
@@ -157,6 +157,8 @@ public abstract class IgnitePdsCacheRebalancingAbstractTest extends GridCommonAb
     public void testRebalancingOnRestart() throws Exception {
         Ignite ignite0 = startGrid(0);
 
+        ignite0.active(true);
+
         startGrid(1);
 
         IgniteEx ignite2 = startGrid(2);
@@ -211,6 +213,8 @@ public abstract class IgnitePdsCacheRebalancingAbstractTest extends GridCommonAb
         IgniteEx ignite2 = startGrid(2);
         IgniteEx ignite3 = startGrid(3);
 
+        ignite0.active(true);
+
         ignite0.cache(cacheName).rebalance().get();
         ignite1.cache(cacheName).rebalance().get();
         ignite2.cache(cacheName).rebalance().get();
@@ -279,6 +283,8 @@ public abstract class IgnitePdsCacheRebalancingAbstractTest extends GridCommonAb
 
         awaitPartitionMapExchange();
 
+        ignite1.active(true);
+
         IgniteCache<Integer, Integer> cache1 = ignite1.cache(cacheName);
 
         for (int i = 0; i < 100; i++)
@@ -375,6 +381,8 @@ public abstract class IgnitePdsCacheRebalancingAbstractTest extends GridCommonAb
 
         Ignite ignite = startGrid(0);
 
+        ignite.active(true);
+
         IgniteCache<Integer, TestValue> cache = ignite.cache(cacheName);
 
         for (int i = 0; i < entriesCnt; i++) {

http://git-wip-us.apache.org/repos/asf/ignite/blob/195147d5/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePdsContinuousRestartTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePdsContinuousRestartTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePdsContinuousRestartTest.java
index 3721031..238e1d1 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePdsContinuousRestartTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePdsContinuousRestartTest.java
@@ -208,6 +208,8 @@ public class IgnitePdsContinuousRestartTest extends GridCommonAbstractTest {
 
         final Ignite load = ignite(0);
 
+        load.active(true);
+
         try (IgniteDataStreamer<Object, Object> s = load.dataStreamer(CACHE_NAME)) {
             s.allowOverwrite(true);
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/195147d5/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePdsDynamicCacheTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePdsDynamicCacheTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePdsDynamicCacheTest.java
index ba55c09..f30e785 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePdsDynamicCacheTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePdsDynamicCacheTest.java
@@ -29,7 +29,6 @@ import org.apache.ignite.configuration.MemoryConfiguration;
 import org.apache.ignite.configuration.MemoryPolicyConfiguration;
 import org.apache.ignite.configuration.PersistentStoreConfiguration;
 import org.apache.ignite.configuration.WALMode;
-import org.apache.ignite.internal.processors.cache.persistence.GridCacheDatabaseSharedManager;
 import org.apache.ignite.internal.processors.database.IgniteDbDynamicCacheSelfTest;
 import org.apache.ignite.internal.util.typedef.internal.U;
 
@@ -97,6 +96,8 @@ public class IgnitePdsDynamicCacheTest extends IgniteDbDynamicCacheSelfTest {
 
         Ignite ignite = ignite(0);
 
+        ignite.active(true);
+
         CacheConfiguration ccfg1 = new CacheConfiguration();
 
         ccfg1.setName("cache1");
@@ -129,6 +130,8 @@ public class IgnitePdsDynamicCacheTest extends IgniteDbDynamicCacheSelfTest {
 
             ignite = ignite(0);
 
+            ignite.active(true);
+
             ignite.getOrCreateCache(ccfg1);
 
             ignite.getOrCreateCache(ccfg2);

http://git-wip-us.apache.org/repos/asf/ignite/blob/195147d5/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePdsMultiNodePutGetRestartTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePdsMultiNodePutGetRestartTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePdsMultiNodePutGetRestartTest.java
index 21ea626..849d9b2 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePdsMultiNodePutGetRestartTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePdsMultiNodePutGetRestartTest.java
@@ -139,6 +139,8 @@ public class IgnitePdsMultiNodePutGetRestartTest extends GridCommonAbstractTest
         try {
             IgniteEx ig = grid(0);
 
+            ig.active(true);
+
             checkPutGetSql(ig, true);
         }
         finally {

http://git-wip-us.apache.org/repos/asf/ignite/blob/195147d5/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePdsPageSizesTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePdsPageSizesTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePdsPageSizesTest.java
index 5014399..aa480ed 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePdsPageSizesTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePdsPageSizesTest.java
@@ -128,6 +128,8 @@ public class IgnitePdsPageSizesTest extends GridCommonAbstractTest {
 
         IgniteEx ignite = startGrid(0);
 
+        ignite.active(true);
+
         try {
             final IgniteCache<Object, Object> cache = ignite.cache(cacheName);
             final long endTime = System.currentTimeMillis() + 60_000;

http://git-wip-us.apache.org/repos/asf/ignite/blob/195147d5/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePdsRecoveryAfterFileCorruptionTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePdsRecoveryAfterFileCorruptionTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePdsRecoveryAfterFileCorruptionTest.java
index 4981095..098ea31 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePdsRecoveryAfterFileCorruptionTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePdsRecoveryAfterFileCorruptionTest.java
@@ -128,6 +128,8 @@ public class IgnitePdsRecoveryAfterFileCorruptionTest extends GridCommonAbstract
     public void testPageRecoveryAfterFileCorruption() throws Exception {
         IgniteEx ig = startGrid(0);
 
+        ig.active(true);
+
         IgniteCache<Integer, Integer> cache = ig.cache(cacheName);
 
         // Put for create data store and init meta page.

http://git-wip-us.apache.org/repos/asf/ignite/blob/195147d5/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePdsRemoveDuringRebalancingTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePdsRemoveDuringRebalancingTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePdsRemoveDuringRebalancingTest.java
index e855859..544ef82 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePdsRemoveDuringRebalancingTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePdsRemoveDuringRebalancingTest.java
@@ -113,6 +113,8 @@ public class IgnitePdsRemoveDuringRebalancingTest extends GridCommonAbstractTest
     public void testRemovesDuringRebalancing() throws Exception {
         IgniteEx ig = startGrid(0);
 
+        ig.active(true);
+
         try (IgniteDataStreamer<Object, Object> streamer = ig.dataStreamer(null)) {
             streamer.allowOverwrite(true);
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/195147d5/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePersistenceMetricsSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePersistenceMetricsSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePersistenceMetricsSelfTest.java
index 72e0b61..cfa1706 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePersistenceMetricsSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePersistenceMetricsSelfTest.java
@@ -56,9 +56,6 @@ public class IgnitePersistenceMetricsSelfTest extends GridCommonAbstractTest {
     /** */
     private static final String GROUP1 = "grp1";
 
-    /** */
-    private boolean activeOnStart = true;
-
     /** {@inheritDoc} */
     @Override protected void afterTestsStopped() throws Exception {
         GridTestUtils.deleteDbFiles();
@@ -77,8 +74,6 @@ public class IgnitePersistenceMetricsSelfTest extends GridCommonAbstractTest {
 
         cfg.setConsistentId(gridName);
 
-        cfg.setActiveOnStart(activeOnStart);
-
         MemoryConfiguration memCfg = new MemoryConfiguration();
         memCfg.setPageSize(1024);
 
@@ -147,6 +142,8 @@ public class IgnitePersistenceMetricsSelfTest extends GridCommonAbstractTest {
     public void testPersistenceMetrics() throws Exception {
         final IgniteEx ig = startGrid(0);
 
+        ig.active(true);
+
         try {
             IgniteCache<Object, Object> cache = ig.cache("cache");
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/195147d5/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePersistentStoreCacheGroupsTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePersistentStoreCacheGroupsTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePersistentStoreCacheGroupsTest.java
index 57cc8d0..f85ddfd 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePersistentStoreCacheGroupsTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePersistentStoreCacheGroupsTest.java
@@ -67,9 +67,6 @@ public class IgnitePersistentStoreCacheGroupsTest extends GridCommonAbstractTest
     /** */
     private CacheConfiguration[] ccfgs;
 
-    /** */
-    private boolean activeOnStart = true;
-
     /** {@inheritDoc} */
     @Override protected void afterTestsStopped() throws Exception {
         GridTestUtils.deleteDbFiles();
@@ -88,8 +85,6 @@ public class IgnitePersistentStoreCacheGroupsTest extends GridCommonAbstractTest
 
         cfg.setConsistentId(gridName);
 
-        cfg.setActiveOnStart(activeOnStart);
-
         MemoryConfiguration memCfg = new MemoryConfiguration();
         memCfg.setPageSize(1024);
         memCfg.setDefaultMemoryPolicySize(10 * 1024 * 1024);
@@ -173,6 +168,8 @@ public class IgnitePersistentStoreCacheGroupsTest extends GridCommonAbstractTest
 
         Ignite node = ignite(0);
 
+        node.active(true);
+
         node.createCaches(Arrays.asList(ccfgs1));
 
         putPersons(caches, node);
@@ -214,8 +211,6 @@ public class IgnitePersistentStoreCacheGroupsTest extends GridCommonAbstractTest
     public void _testExpiryPolicy() throws Exception {
         long ttl = 10000;
 
-        activeOnStart = false;
-
         CacheConfiguration[] ccfgs1 = new CacheConfiguration[5];
 
         ccfgs1[0] = cacheConfiguration(GROUP1, "c1", PARTITIONED, ATOMIC, 1);
@@ -281,6 +276,8 @@ public class IgnitePersistentStoreCacheGroupsTest extends GridCommonAbstractTest
 
         Ignite ignite = startGrid();
 
+        ignite.active(true);
+
         ignite.cache("c1").destroy();
 
         stopGrid();
@@ -296,8 +293,9 @@ public class IgnitePersistentStoreCacheGroupsTest extends GridCommonAbstractTest
 
         Ignite ignite = startGrid();
 
-        ignite.createCaches(Arrays.asList(ccfg1, ccfg2));
+        ignite.active(true);
 
+        ignite.createCaches(Arrays.asList(ccfg1, ccfg2));
 
         ignite.cache("c1").destroy();
 
@@ -321,6 +319,8 @@ public class IgnitePersistentStoreCacheGroupsTest extends GridCommonAbstractTest
 
         Ignite ignite = startGrid();
 
+        ignite.active(true);
+
         ignite.createCaches(Arrays.asList(ccfg1, ccfg2));
 
         ignite.cache("c1").destroy();
@@ -403,6 +403,8 @@ public class IgnitePersistentStoreCacheGroupsTest extends GridCommonAbstractTest
 
         Ignite node = ignite(0);
 
+        node.active(true);
+
         if (!staticCaches)
             node.createCaches(Arrays.asList(ccfgs));
 
@@ -422,6 +424,8 @@ public class IgnitePersistentStoreCacheGroupsTest extends GridCommonAbstractTest
 
         node = startGrids(nodes);
 
+        node.active(true);
+
         awaitPartitionMapExchange();
 
         for (String cacheName : caches) {

http://git-wip-us.apache.org/repos/asf/ignite/blob/195147d5/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePersistentStoreDataStructuresTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePersistentStoreDataStructuresTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePersistentStoreDataStructuresTest.java
index 6494903..87e789d 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePersistentStoreDataStructuresTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePersistentStoreDataStructuresTest.java
@@ -62,8 +62,6 @@ public class IgnitePersistentStoreDataStructuresTest extends GridCommonAbstractT
 
         cfg.setPersistentStoreConfiguration(new PersistentStoreConfiguration().setWalMode(WALMode.LOG_ONLY));
 
-        cfg.setActiveOnStart(false);
-
         return cfg;
     }
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/195147d5/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/IgnitePdsMultiNodePutGetRestartTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/IgnitePdsMultiNodePutGetRestartTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/IgnitePdsMultiNodePutGetRestartTest.java
index e244333..d4c51fc 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/IgnitePdsMultiNodePutGetRestartTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/IgnitePdsMultiNodePutGetRestartTest.java
@@ -129,6 +129,8 @@ public class IgnitePdsMultiNodePutGetRestartTest extends GridCommonAbstractTest
         try {
             IgniteEx ig = grid(0);
 
+            ig.active(true);
+
             checkPutGetSql(ig, true);
         }
         finally {

http://git-wip-us.apache.org/repos/asf/ignite/blob/195147d5/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/IgnitePdsPageEvictionDuringPartitionClearTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/IgnitePdsPageEvictionDuringPartitionClearTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/IgnitePdsPageEvictionDuringPartitionClearTest.java
index fb7113f..38b1d55 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/IgnitePdsPageEvictionDuringPartitionClearTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/IgnitePdsPageEvictionDuringPartitionClearTest.java
@@ -109,6 +109,8 @@ public class IgnitePdsPageEvictionDuringPartitionClearTest extends GridCommonAbs
             try {
                 Ignite ig = ignite(0);
 
+                ig.active(true);
+
                 IgniteDataStreamer<Object, Object> streamer = ig.dataStreamer(CACHE_NAME);
 
                 for (int i = 0; i < 300_000; i++) {

http://git-wip-us.apache.org/repos/asf/ignite/blob/195147d5/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/IgnitePdsPageEvictionTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/IgnitePdsPageEvictionTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/IgnitePdsPageEvictionTest.java
index e8bc701..d266125 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/IgnitePdsPageEvictionTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/IgnitePdsPageEvictionTest.java
@@ -116,6 +116,8 @@ public class IgnitePdsPageEvictionTest extends GridCommonAbstractTest {
     public void testPageEvictionSql() throws Exception {
         IgniteEx ig = grid(0);
 
+        ig.active(true);
+
         try (IgniteDataStreamer<DbKey, DbValue> streamer = ig.dataStreamer(CACHE_NAME)) {
             for (int i = 0; i < ENTRY_CNT; i++) {
                 streamer.addData(new DbKey(i), new DbValue(i, "value-" + i, Long.MAX_VALUE - i));

http://git-wip-us.apache.org/repos/asf/ignite/blob/195147d5/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/IgnitePdsRebalancingOnNotStableTopologyTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/IgnitePdsRebalancingOnNotStableTopologyTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/IgnitePdsRebalancingOnNotStableTopologyTest.java
index 0724eb9..967c8f0 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/IgnitePdsRebalancingOnNotStableTopologyTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/IgnitePdsRebalancingOnNotStableTopologyTest.java
@@ -58,6 +58,8 @@ public class IgnitePdsRebalancingOnNotStableTopologyTest extends GridCommonAbstr
     public void test() throws Exception {
         Ignite ex = startGrid(0);
 
+        ex.active(true);
+
         startGrid(1);
 
         final CountDownLatch startLatch = new CountDownLatch(1);

http://git-wip-us.apache.org/repos/asf/ignite/blob/195147d5/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/IgnitePdsTransactionsHangTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/IgnitePdsTransactionsHangTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/IgnitePdsTransactionsHangTest.java
index d4dfdec..a927454 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/IgnitePdsTransactionsHangTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/IgnitePdsTransactionsHangTest.java
@@ -174,6 +174,8 @@ public class IgnitePdsTransactionsHangTest extends GridCommonAbstractTest {
         try {
             final Ignite g = startGrids(2);
 
+            g.active(true);
+
             g.getOrCreateCache(getCacheConfiguration());
 
             ExecutorService threadPool = Executors.newFixedThreadPool(THREADS_CNT);

http://git-wip-us.apache.org/repos/asf/ignite/blob/195147d5/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/file/IgnitePdsCacheIntegrationTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/file/IgnitePdsCacheIntegrationTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/file/IgnitePdsCacheIntegrationTest.java
index c68f7e7..6e89b46 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/file/IgnitePdsCacheIntegrationTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/file/IgnitePdsCacheIntegrationTest.java
@@ -131,6 +131,8 @@ public class IgnitePdsCacheIntegrationTest extends GridCommonAbstractTest {
         try {
             IgniteEx ig = grid(0);
 
+            ig.active(true);
+
             checkPutGetSql(ig, true);
         }
         finally {
@@ -162,6 +164,8 @@ public class IgnitePdsCacheIntegrationTest extends GridCommonAbstractTest {
         try {
             final IgniteEx grid = grid(0);
 
+            grid.active(true);
+
             GridTestUtils.runMultiThreaded(new Callable<Object>() {
                 @Override public Object call() throws Exception {
                     for (int i = 0; i < 1000; i++)

http://git-wip-us.apache.org/repos/asf/ignite/blob/195147d5/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/file/IgnitePdsEvictionTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/file/IgnitePdsEvictionTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/file/IgnitePdsEvictionTest.java
index 1026d4e..ea4a0e9 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/file/IgnitePdsEvictionTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/file/IgnitePdsEvictionTest.java
@@ -117,6 +117,8 @@ public class IgnitePdsEvictionTest extends GridCommonAbstractTest {
     public void testPageEviction() throws Exception {
         final IgniteEx ig = startGrid(0);
 
+        ig.active(true);
+
         final PageMemory memory = getMemory(ig);
 
         writeData(ig, memory, CU.cacheId(cacheName));

http://git-wip-us.apache.org/repos/asf/ignite/blob/195147d5/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/file/IgnitePdsNoActualWalHistoryTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/file/IgnitePdsNoActualWalHistoryTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/file/IgnitePdsNoActualWalHistoryTest.java
index 9631686..c948d58 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/file/IgnitePdsNoActualWalHistoryTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/file/IgnitePdsNoActualWalHistoryTest.java
@@ -103,6 +103,8 @@ public class IgnitePdsNoActualWalHistoryTest extends GridCommonAbstractTest {
         try {
             IgniteEx ignite = startGrid(1);
 
+            ignite.active(true);
+
             IgniteCache<Object, Object> cache = ignite.cache(CACHE_NAME);
 
             Random rnd = new Random();

http://git-wip-us.apache.org/repos/asf/ignite/blob/195147d5/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/file/ignitePdsCheckpointSimulationTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/file/ignitePdsCheckpointSimulationTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/file/ignitePdsCheckpointSimulationTest.java
index 840042e..b9daaba 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/file/ignitePdsCheckpointSimulationTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/file/ignitePdsCheckpointSimulationTest.java
@@ -143,6 +143,8 @@ public class ignitePdsCheckpointSimulationTest extends GridCommonAbstractTest {
     public void testCheckpointSimulationMultiThreaded() throws Exception {
         IgniteEx ig = startGrid(0);
 
+        ig.active(true);
+
         GridCacheSharedContext<Object, Object> shared = ig.context().cache().context();
 
         GridCacheDatabaseSharedManager dbMgr = (GridCacheDatabaseSharedManager)shared.database();
@@ -196,6 +198,8 @@ public class ignitePdsCheckpointSimulationTest extends GridCommonAbstractTest {
     public void testGetForInitialWrite() throws Exception {
         IgniteEx ig = startGrid(0);
 
+        ig.active(true);
+
         GridCacheSharedContext<Object, Object> shared = ig.context().cache().context();
 
         int cacheId = shared.cache().cache(cacheName).context().cacheId();
@@ -289,6 +293,8 @@ public class ignitePdsCheckpointSimulationTest extends GridCommonAbstractTest {
     public void testDataWalEntries() throws Exception {
         IgniteEx ig = startGrid(0);
 
+        ig.active(true);
+
         GridCacheSharedContext<Object, Object> sharedCtx = ig.context().cache().context();
         GridCacheContext<Object, Object> cctx = sharedCtx.cache().cache(cacheName).context();
 
@@ -408,6 +414,8 @@ public class ignitePdsCheckpointSimulationTest extends GridCommonAbstractTest {
     public void testPageWalEntries() throws Exception {
         IgniteEx ig = startGrid(0);
 
+        ig.active(true);
+
         GridCacheSharedContext<Object, Object> sharedCtx = ig.context().cache().context();
         int cacheId = sharedCtx.cache().cache(cacheName).context().cacheId();
 
@@ -520,6 +528,8 @@ public class ignitePdsCheckpointSimulationTest extends GridCommonAbstractTest {
     public void testDirtyFlag() throws Exception {
         IgniteEx ig = startGrid(0);
 
+        ig.active(true);
+
         GridCacheSharedContext<Object, Object> shared = ig.context().cache().context();
 
         int cacheId = shared.cache().cache(cacheName).context().cacheId();

http://git-wip-us.apache.org/repos/asf/ignite/blob/195147d5/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/wal/IgnitePdsWalTlbTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/wal/IgnitePdsWalTlbTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/wal/IgnitePdsWalTlbTest.java
index 6ca0a1d..a1a7286 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/wal/IgnitePdsWalTlbTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/wal/IgnitePdsWalTlbTest.java
@@ -109,6 +109,8 @@ public class IgnitePdsWalTlbTest extends GridCommonAbstractTest {
     public void testWalDirectOutOfMemory() throws Exception {
         IgniteEx ig = grid(1);
 
+        ig.active(true);
+
         boolean locked = true;
 
         try {

http://git-wip-us.apache.org/repos/asf/ignite/blob/195147d5/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/wal/IgniteWalDirectoriesConfigurationTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/wal/IgniteWalDirectoriesConfigurationTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/wal/IgniteWalDirectoriesConfigurationTest.java
index 97e70c2..e61d2fd 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/wal/IgniteWalDirectoriesConfigurationTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/wal/IgniteWalDirectoriesConfigurationTest.java
@@ -44,6 +44,8 @@ public class IgniteWalDirectoriesConfigurationTest extends GridCommonAbstractTes
     public void testPartialWalConfigurationNotAllowed() {
         try {
             startGrid();
+
+            grid(0).active(true);
         }
         catch (Exception ignore) {
             return;

http://git-wip-us.apache.org/repos/asf/ignite/blob/195147d5/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/wal/IgniteWalHistoryReservationsTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/wal/IgniteWalHistoryReservationsTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/wal/IgniteWalHistoryReservationsTest.java
index 5f92100..793806e 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/wal/IgniteWalHistoryReservationsTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/wal/IgniteWalHistoryReservationsTest.java
@@ -107,6 +107,8 @@ public class IgniteWalHistoryReservationsTest extends GridCommonAbstractTest {
 
         final IgniteEx ig0 = (IgniteEx)startGrids(initGridCnt);
 
+        ig0.active(true);
+
         IgniteCache<Object, Object> cache = ig0.cache("cache1");
 
         for (int k = 0; k < entryCnt; k++)
@@ -201,6 +203,8 @@ public class IgniteWalHistoryReservationsTest extends GridCommonAbstractTest {
 
         Ignite ig0 = startGrids(2);
 
+        ig0.active(true);
+
         IgniteCache<Integer, Integer> cache = ig0.cache("cache1");
 
         for (int k = 0; k < entryCnt; k++)
@@ -242,6 +246,8 @@ public class IgniteWalHistoryReservationsTest extends GridCommonAbstractTest {
 
         Ignite ig0 = startGrids(2);
 
+        ig0.active(true);
+
         IgniteCache<Integer, Integer> cache = ig0.cache("cache1");
 
         for (int k = 0; k < entryCnt; k++)
@@ -293,6 +299,8 @@ public class IgniteWalHistoryReservationsTest extends GridCommonAbstractTest {
 
         final IgniteEx ig0 = (IgniteEx)startGrids(initGridCnt);
 
+        ig0.active(true);
+
         IgniteCache<Object, Object> cache = ig0.cache("cache1");
 
         for (int k = 0; k < entryCnt; k++)

http://git-wip-us.apache.org/repos/asf/ignite/blob/195147d5/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/wal/IgniteWalRecoverySeveralRestartsTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/wal/IgniteWalRecoverySeveralRestartsTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/wal/IgniteWalRecoverySeveralRestartsTest.java
index 99b7383..a6e65d6 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/wal/IgniteWalRecoverySeveralRestartsTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/wal/IgniteWalRecoverySeveralRestartsTest.java
@@ -130,6 +130,8 @@ public class IgniteWalRecoverySeveralRestartsTest extends GridCommonAbstractTest
         try {
             IgniteEx ignite = startGrid(1);
 
+            ignite.active(true);
+
             Random locRandom = ThreadLocalRandom.current();
 
             try (IgniteDataStreamer<Integer, IndexedObject> dataLdr = ignite.dataStreamer(cacheName)) {
@@ -151,6 +153,8 @@ public class IgniteWalRecoverySeveralRestartsTest extends GridCommonAbstractTest
 
                 ignite = startGrid(1);
 
+                ignite.active(true);
+
                 IgniteCache<Integer, IndexedObject> cache = ignite.cache(cacheName);
 
                 assertEquals(size, cache.size());
@@ -181,6 +185,8 @@ public class IgniteWalRecoverySeveralRestartsTest extends GridCommonAbstractTest
         try {
             IgniteEx ignite = startGrid(1);
 
+            ignite.active(true);
+
             CacheConfiguration<Integer, IndexedObject> dynCacheCfg = new CacheConfiguration<>();
 
             dynCacheCfg.setName("dyncache");
@@ -210,6 +216,8 @@ public class IgniteWalRecoverySeveralRestartsTest extends GridCommonAbstractTest
 
                 ignite = startGrid(1);
 
+                ignite.active(true);
+
                 ThreadLocalRandom locRandom = ThreadLocalRandom.current();
 
                 IgniteCache<Integer, IndexedObject> cache = ignite.getOrCreateCache(dynCacheCfg);
@@ -230,6 +238,8 @@ public class IgniteWalRecoverySeveralRestartsTest extends GridCommonAbstractTest
         try {
             IgniteEx ignite = startGrid(1);
 
+            ignite.active(true);
+
             CacheConfiguration<Integer, IndexedObject> dynCacheCfg = new CacheConfiguration<>();
 
             dynCacheCfg.setName("dyncache");
@@ -263,6 +273,8 @@ public class IgniteWalRecoverySeveralRestartsTest extends GridCommonAbstractTest
 
                 ignite = startGrid(1);
 
+                ignite.active(true);
+
                 ThreadLocalRandom locRandom = ThreadLocalRandom.current();
 
                 IgniteCache<Integer, IndexedObject> cache = ignite.getOrCreateCache(dynCacheCfg);

http://git-wip-us.apache.org/repos/asf/ignite/blob/195147d5/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/wal/WalRecoveryTxLogicalRecordsTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/wal/WalRecoveryTxLogicalRecordsTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/wal/WalRecoveryTxLogicalRecordsTest.java
index 205e0fc..b21fc2a 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/wal/WalRecoveryTxLogicalRecordsTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/wal/WalRecoveryTxLogicalRecordsTest.java
@@ -147,6 +147,8 @@ public class WalRecoveryTxLogicalRecordsTest extends GridCommonAbstractTest {
     public void testWalTxSimple() throws Exception {
         Ignite ignite = startGrid();
 
+        ignite.active(true);
+
         try {
             GridCacheDatabaseSharedManager dbMgr = (GridCacheDatabaseSharedManager)((IgniteEx)ignite).context()
                 .cache().context().database();

http://git-wip-us.apache.org/repos/asf/ignite/blob/195147d5/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/standbycluster/AbstractNodeJoinTemplate.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/standbycluster/AbstractNodeJoinTemplate.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/standbycluster/AbstractNodeJoinTemplate.java
deleted file mode 100644
index 76a5260..0000000
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/standbycluster/AbstractNodeJoinTemplate.java
+++ /dev/null
@@ -1,743 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ignite.internal.processors.cache.persistence.standbycluster;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-import java.util.Map;
-import org.apache.ignite.cache.CacheAtomicityMode;
-import org.apache.ignite.configuration.CacheConfiguration;
-import org.apache.ignite.configuration.IgniteConfiguration;
-import org.apache.ignite.configuration.PersistentStoreConfiguration;
-import org.apache.ignite.internal.IgniteEx;
-import org.apache.ignite.internal.processors.affinity.AffinityTopologyVersion;
-import org.apache.ignite.internal.processors.cache.DynamicCacheDescriptor;
-import org.apache.ignite.internal.processors.cache.GridCacheAdapter;
-import org.apache.ignite.internal.util.typedef.CI1;
-import org.apache.ignite.internal.util.typedef.internal.U;
-import org.apache.ignite.lang.IgniteCallable;
-import org.apache.ignite.lang.IgniteClosure;
-import org.apache.ignite.lang.IgniteInClosure;
-import org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi;
-import org.apache.ignite.spi.discovery.tcp.ipfinder.TcpDiscoveryIpFinder;
-import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder;
-import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
-import org.junit.Assert;
-
-import static org.apache.ignite.internal.util.IgniteUtils.field;
-
-/**
- *
- */
-public abstract class AbstractNodeJoinTemplate extends GridCommonAbstractTest {
-    /** Cache 1. */
-    protected static final String cache1 = "cache1";
-
-    /** Cache 2. */
-    protected static final String cache2 = "cache2";
-
-    //Todo Cache with node filter.
-    protected static final String cache3 = "cache3";
-
-    protected static final String cache4 = "cache4";
-
-    protected static final String cache5 = "cache5";
-
-    /** Caches info. */
-    public static final String CACHES_INFO = "cachesInfo";
-
-    /** Registered caches. */
-    public static final String REGISTERED_CACHES = "registeredCaches";
-
-    /** Caches. */
-    public static final String CACHES = "caches";
-
-    /**
-     * @param ig Ig.
-     */
-    protected static Map<String, DynamicCacheDescriptor> cacheDescriptors(IgniteEx ig) {
-        return field(field(ig.context().cache(), CACHES_INFO), REGISTERED_CACHES);
-    }
-
-    /**
-     * @param ig Ig.
-     */
-    protected static Map<String, GridCacheAdapter> caches(IgniteEx ig){
-        return field(ig.context().cache(), CACHES);
-    }
-
-    /**
-     *
-     */
-    public abstract JoinNodeTestPlanBuilder withOutConfigurationTemplate() throws Exception;
-
-    /**
-     *
-     */
-    public abstract JoinNodeTestPlanBuilder staticCacheConfigurationOnJoinTemplate() throws Exception;
-
-    /**
-     *
-     */
-    public abstract JoinNodeTestPlanBuilder staticCacheConfigurationInClusterTemplate() throws Exception;
-
-    /**
-     *
-     */
-    public abstract JoinNodeTestPlanBuilder staticCacheConfigurationSameOnBothTemplate() throws Exception;
-
-    /**
-     *
-     */
-    public abstract JoinNodeTestPlanBuilder staticCacheConfigurationDifferentOnBothTemplate() throws Exception;
-
-    // Client node join.
-
-    public abstract JoinNodeTestPlanBuilder joinClientWithOutConfigurationTemplate() throws Exception;
-
-    public abstract JoinNodeTestPlanBuilder joinClientStaticCacheConfigurationOnJoinTemplate() throws Exception;
-
-    public abstract JoinNodeTestPlanBuilder joinClientStaticCacheConfigurationInClusterTemplate() throws Exception;
-
-    public abstract JoinNodeTestPlanBuilder joinClientStaticCacheConfigurationSameOnBothTemplate() throws Exception;
-
-    public abstract JoinNodeTestPlanBuilder joinClientStaticCacheConfigurationDifferentOnBothTemplate() throws Exception;
-
-    /**
-     *
-     */
-    public abstract void testJoinWithOutConfiguration() throws Exception;
-
-    /**
-     *
-     */
-    public abstract void testStaticCacheConfigurationOnJoin() throws Exception;
-
-    /**
-     *
-     */
-    public abstract void testStaticCacheConfigurationInCluster() throws Exception;
-
-    /**
-     *
-     */
-    public abstract void testStaticCacheConfigurationSameOnBoth() throws Exception;
-
-    /**
-     *
-     */
-    public abstract void testStaticCacheConfigurationDifferentOnBoth() throws Exception;
-
-    /**
-     *
-     */
-    public abstract void testJoinClientWithOutConfiguration() throws Exception;
-
-    /**
-     *
-     */
-    public abstract void testJoinClientStaticCacheConfigurationOnJoin() throws Exception;
-
-    /**
-     *
-     */
-    public abstract void testJoinClientStaticCacheConfigurationInCluster() throws Exception;
-
-    /**
-     *
-     */
-    public abstract void testJoinClientStaticCacheConfigurationSameOnBoth() throws Exception;
-
-    /**
-     *
-     */
-    public abstract void testJoinClientStaticCacheConfigurationDifferentOnBoth() throws Exception;
-
-    @Override protected void beforeTest() throws Exception {
-        super.beforeTest();
-
-        stopAllGrids();
-
-        deleteRecursively(U.resolveWorkDirectory(U.defaultWorkDirectory(), "db", false));
-    }
-
-    @Override protected void afterTest() throws Exception {
-        super.afterTest();
-
-        stopAllGrids();
-
-        deleteRecursively(U.resolveWorkDirectory(U.defaultWorkDirectory(), "db", false));
-    }
-
-    /**
-     * @param idx Index.
-     */
-    protected String name(int idx) {
-        return getTestIgniteInstanceName(idx);
-    }
-
-    /**
-     * @param name Name.
-     */
-    protected IgniteConfiguration cfg(String name) throws Exception {
-        try {
-            return getConfiguration(name);
-        }
-        catch (Exception e) {
-            throw new RuntimeException(e);
-        }
-    }
-
-    /**
-     *
-     */
-    protected JoinNodeTestPlanBuilder builder() {
-        return JoinNodeTestPlanBuilder.builder();
-    }
-
-    /**
-     * @param cfgs Cfgs.
-     */
-    protected static <T> T[] buildConfiguration(T... cfgs) {
-        return cfgs;
-    }
-
-    /**
-     *
-     */
-    protected CacheConfiguration atomicCfg() {
-        return new CacheConfiguration(cache1)
-            .setAtomicityMode(CacheAtomicityMode.ATOMIC);
-    }
-
-    /**
-     *
-     */
-    protected CacheConfiguration transactionCfg() {
-        return new CacheConfiguration(cache2)
-            .setAtomicityMode(CacheAtomicityMode.TRANSACTIONAL);
-    }
-
-    /**
-     *
-     */
-    protected CacheConfiguration[] allCacheConfigurations() {
-        return buildConfiguration(atomicCfg(), transactionCfg());
-    }
-
-    /** Set client. */
-    protected final IgniteClosure<IgniteConfiguration, IgniteConfiguration> setClient =
-        new IgniteClosure<IgniteConfiguration, IgniteConfiguration>() {
-            @Override public IgniteConfiguration apply(IgniteConfiguration cfg) {
-                return cfg.setClientMode(true);
-            }
-        };
-
-    /** Ip finder. */
-    private static final TcpDiscoveryIpFinder ipFinder = new TcpDiscoveryVmIpFinder(true);
-
-    /** {@inheritDoc} */
-    @Override protected IgniteConfiguration getConfiguration(String name) throws Exception {
-        return super.getConfiguration(name)
-            .setDiscoverySpi(
-                new TcpDiscoverySpi()
-                    .setIpFinder(ipFinder)
-            );
-    }
-
-    /** {@inheritDoc} */
-    protected IgniteConfiguration persistentCfg(IgniteConfiguration cfg) throws Exception {
-        cfg.setPersistentStoreConfiguration(new PersistentStoreConfiguration());
-
-        return cfg;
-    }
-
-    /**
-     *
-     */
-    public static class JoinNodeTestPlanBuilder extends GridCommonAbstractTest {
-        /** String plan builder. */
-        private final StringBuilder strPlanBuilder = new StringBuilder().append("**** Execution plan ****\n");
-
-        /** Nodes. */
-        protected List<String> nodes = new ArrayList<>(4);
-
-        /** Cluster config. */
-        private IgniteConfiguration[] clusterCfg;
-
-        /** Node config. */
-        private IgniteConfiguration nodeCfg;
-
-        /** State default. */
-        private static final Boolean stateDefault = new Boolean(true);
-
-        /** State. */
-        private Boolean state = stateDefault;
-
-        /** Noop. */
-        private static final Runnable Noop = new Runnable() {
-            @Override public void run() {
-            }
-        };
-
-        /** After cluster started. */
-        private Runnable afterClusterStarted = Noop;
-
-        /** After node join. */
-        private Runnable afterNodeJoin = Noop;
-
-        /** After activate. */
-        private Runnable afterActivate = Noop;
-
-        /** After de activate. */
-        private Runnable afterDeActivate = Noop;
-
-        private IgniteCallable<List<CacheConfiguration>> dynamicCacheStart =
-            new IgniteCallable<List<CacheConfiguration>>() {
-                @Override public List<CacheConfiguration> call() throws Exception {
-                    return Arrays.asList(new CacheConfiguration(cache4), new CacheConfiguration(cache5));
-                }
-            };
-
-        private IgniteCallable<List<String>> dynamicCacheStop =
-            new IgniteCallable<List<String>>() {
-                @Override public List<String> call() throws Exception {
-                    return Arrays.asList(cache4, cache5);
-                }
-            };
-
-        private Runnable afterDynamicCacheStarted = Noop;
-
-        private Runnable afterDynamicCacheStopped = Noop;
-
-        /** End. */
-        private Runnable end = Noop;
-
-        /**
-         *
-         */
-        public JoinNodeTestPlanBuilder clusterConfiguration(IgniteConfiguration... cfgs) throws Exception {
-            clusterCfg = cfgs;
-
-            strPlanBuilder.append("Start cluster:\n");
-
-            for (IgniteConfiguration cfg : cfgs) {
-                strPlanBuilder.append("node: ")
-                    .append(cfg.getIgniteInstanceName())
-                    .append(" activeOnStart - ")
-                    .append(cfg.isActiveOnStart())
-                    .append("\n");
-
-                CacheConfiguration[] ccfgs = cfg.getCacheConfiguration();
-
-                if (ccfgs != null) {
-                    for (CacheConfiguration ccfg : ccfgs)
-                        strPlanBuilder.append("  cache - ")
-                            .append(ccfg.getName())
-                            .append("\n");
-                }
-            }
-
-            return this;
-        }
-
-        /**
-         *
-         */
-        public JoinNodeTestPlanBuilder nodeConfiguration(IgniteConfiguration cfg) {
-            nodeCfg = cfg;
-
-            strPlanBuilder.append("Join node:\n")
-                .append(cfg.getIgniteInstanceName())
-                .append(cfg.isClientMode() != null && cfg.isClientMode() ? " (client)" : "")
-                .append(" activeOnStart - ")
-                .append(cfg.isActiveOnStart())
-                .append("\n");
-
-            CacheConfiguration[] ccfgs = cfg.getCacheConfiguration();
-
-            if (ccfgs != null)
-                for (CacheConfiguration ccfg : ccfgs)
-                    strPlanBuilder.append("  cache - ").append(ccfg.getName()).append("\n");
-
-            return this;
-        }
-
-        /**
-         * @param func Func.
-         */
-        public JoinNodeTestPlanBuilder nodeConfiguration(
-            IgniteClosure<IgniteConfiguration, IgniteConfiguration> func
-        ) {
-
-            nodeCfg = func.apply(nodeCfg);
-
-            return this;
-        }
-
-        /**
-         *
-         */
-        public JoinNodeTestPlanBuilder afterClusterStarted(Runnable r) {
-            strPlanBuilder.append("Check after cluster start\n");
-
-            afterClusterStarted = r;
-
-            return this;
-        }
-
-        /**
-         *
-         */
-        public JoinNodeTestPlanBuilder afterNodeJoin(Runnable r) {
-            strPlanBuilder.append("Check after node join")
-                .append("\n");
-
-            afterNodeJoin = r;
-
-            return this;
-        }
-
-        /**
-         *
-         */
-        public JoinNodeTestPlanBuilder stateAfterJoin(boolean state) {
-            strPlanBuilder.append("Check state on all nodes after join, must be ")
-                .append(state ? "<<active>>" : "<<inactive>>")
-                .append(" \n");
-
-            this.state = state;
-
-            return this;
-        }
-
-        /**
-         *
-         */
-        public JoinNodeTestPlanBuilder afterActivate(Runnable r) {
-            strPlanBuilder.append("Check after activate")
-                .append("\n");
-
-            afterActivate = r;
-
-            return this;
-        }
-
-        /**
-         *
-         */
-        public JoinNodeTestPlanBuilder afterDeActivate(Runnable r) {
-            strPlanBuilder.append("Check after deActivate")
-                .append("\n");
-
-            afterDeActivate = r;
-
-            return this;
-        }
-
-        public JoinNodeTestPlanBuilder dynamicCacheStart(IgniteCallable<List<CacheConfiguration>> caches){
-            strPlanBuilder.append("Dynamic caches start")
-                .append("\n");
-
-            dynamicCacheStart = caches;
-
-            return this;
-        }
-
-        public JoinNodeTestPlanBuilder afterDynamicCacheStarted(Runnable r){
-            strPlanBuilder.append("Check after dynamic caches start")
-                .append("\n");
-
-            afterDynamicCacheStarted = r;
-
-            return this;
-        }
-
-        public JoinNodeTestPlanBuilder dynamicCacheStop(IgniteCallable<List<String>> caches){
-            strPlanBuilder.append("Dynamic caches stop")
-                .append("\n");
-
-            dynamicCacheStop = caches;
-
-            return this;
-        }
-
-        public JoinNodeTestPlanBuilder afterDynamicCacheStopped(Runnable r){
-            strPlanBuilder.append("Check after dynamic caches stop")
-                .append("\n");
-
-            afterDynamicCacheStopped = r;
-
-            return this;
-        }
-
-        /**
-         * @param end End.
-         */
-        public JoinNodeTestPlanBuilder setEnd(Runnable end) {
-            strPlanBuilder.append("Check before stop")
-                .append("\n");
-
-            this.end = end;
-
-            return this;
-        }
-
-        /**
-         *
-         */
-        public void execute() throws Exception {
-            try {
-                if (state == stateDefault)
-                    fail("State after join must be specific. See JoinNodeTestPlanBuilder.stateAfterJoin(boolean).");
-
-                System.out.println(strPlanBuilder.append("********************").toString());
-
-                IgniteConfiguration[] cfgs = clusterCfg;
-
-                System.out.println(">>> Start cluster");
-
-                for (IgniteConfiguration cfg : cfgs) {
-                    startGrid(cfg);
-
-                    nodes.add(cfg.getIgniteInstanceName());
-                }
-
-                System.out.println(">>> Check after cluster started");
-
-                afterClusterStarted.run();
-
-                System.out.println(">>> Start new node");
-
-                startGrid(nodeCfg);
-
-                nodes.add(nodeCfg.getIgniteInstanceName());
-
-                System.out.println(">>> Check after new node join in cluster");
-
-                afterNodeJoin.run();
-
-                System.out.println(">>> Check cluster state on all nodes");
-
-                IgniteEx crd = grid(nodes.get(0));
-
-                for (IgniteEx ig : grids())
-                    assertEquals((boolean)state, ig.active());
-
-                if (!state) {
-                    System.out.println(">>> Activate cluster");
-
-                    crd.active(true);
-
-                    System.out.println(">>> Check after cluster activated");
-
-                    afterActivate.run();
-                }
-                else {
-                    System.out.println(">>> DeActivate cluster");
-
-                    crd.active(false);
-
-                    System.out.println(">>> Check after cluster deActivated");
-
-                    afterDeActivate.run();
-
-                    System.out.println(">>> Activate cluster");
-
-                    crd.active(true);
-                }
-
-                AffinityTopologyVersion next0Ver = nextMinorVersion(crd);
-
-                crd.createCaches(dynamicCacheStart.call());
-
-                awaitTopologyVersion(next0Ver);
-
-                afterDynamicCacheStarted.run();
-
-                onAllNode(new CI1<IgniteEx>() {
-                    @Override public void apply(IgniteEx ig) {
-                        if (ig.context().discovery().localNode().isClient())
-                            return;
-
-                        Assert.assertNotNull(ig.context().cache().cache(cache4));
-                        Assert.assertNotNull(ig.context().cache().cache(cache5));
-
-                    }
-                });
-
-                AffinityTopologyVersion next1Ver = nextMinorVersion(crd);
-
-                crd.destroyCaches(dynamicCacheStop.call());
-
-                afterDynamicCacheStopped.run();
-
-                awaitTopologyVersion(next1Ver);
-
-                onAllNode(new CI1<IgniteEx>() {
-                    @Override public void apply(IgniteEx ig) {
-                        if (ig.context().discovery().localNode().isClient())
-                            return;
-
-                        Assert.assertNull(ig.context().cache().cache(cache4));
-                        Assert.assertNull(ig.context().cache().cache(cache5));
-
-                    }
-                });
-
-                System.out.println(">>> Finish check");
-
-                end.run();
-            }
-            finally {
-                stopAllGrids();
-            }
-        }
-
-        private AffinityTopologyVersion nextMinorVersion(IgniteEx ig){
-            AffinityTopologyVersion cur = ig.context().discovery().topologyVersionEx();
-
-           return new AffinityTopologyVersion(cur.topologyVersion(), cur.minorTopologyVersion() + 1);
-        }
-
-        private void awaitTopologyVersion(final AffinityTopologyVersion ver){
-            onAllNode(new CI1<IgniteEx>() {
-                @Override public void apply(IgniteEx ig) {
-                    while (true) {
-                        AffinityTopologyVersion locTopVer = ig.context().cache().context()
-                            .exchange().readyAffinityVersion();
-
-                        if (locTopVer.compareTo(ver) < 0){
-                            System.out.println("Top ready " + locTopVer + " on " + ig.localNode().id());
-
-                            try {
-                                Thread.sleep(100);
-                            }
-                            catch (InterruptedException e) {
-                                break;
-                            }
-                        }
-                        else
-                            break;
-                    }
-                }
-            }).run();
-
-        }
-
-        /**
-         *
-         */
-        protected List<IgniteEx> grids() {
-            List<IgniteEx> res = new ArrayList<>();
-
-            for (String name : nodes)
-                res.add(grid(name));
-
-            return res;
-        }
-
-        /**
-         *
-         */
-        public static JoinNodeTestPlanBuilder builder() {
-            return new JoinNodeTestPlanBuilder();
-        }
-
-        /**
-         *
-         */
-        public Runnable checkCacheOnlySystem() {
-            return onAllNode(new IgniteInClosure<IgniteEx>() {
-                @Override public void apply(IgniteEx ig) {
-                    Map<String, DynamicCacheDescriptor> desc = cacheDescriptors(ig);
-
-                    Assert.assertEquals(2, desc.size());
-
-                    Assert.assertNull(ig.context().cache().cache(cache1));
-                    Assert.assertNull(ig.context().cache().cache(cache2));
-
-                    Map<String, GridCacheAdapter> caches = caches(ig);
-
-                    Assert.assertEquals(2, caches.size());
-                }
-            });
-        }
-
-        /**
-         *
-         */
-        public Runnable checkCacheEmpty() {
-            return onAllNode(new IgniteInClosure<IgniteEx>() {
-                @Override public void apply(IgniteEx ig) {
-                    Map<String, DynamicCacheDescriptor> desc = cacheDescriptors(ig);
-
-                    Assert.assertTrue(desc.isEmpty());
-
-                    Assert.assertNull(ig.context().cache().cache(cache1));
-                    Assert.assertNull(ig.context().cache().cache(cache2));
-
-                    Map<String, GridCacheAdapter> caches = caches(ig);
-
-                    Assert.assertEquals(0, caches.size());
-                }
-            });
-        }
-
-        /**
-         *
-         */
-        public Runnable checkCacheNotEmpty() {
-            return onAllNode(new IgniteInClosure<IgniteEx>() {
-                @Override public void apply(IgniteEx ig) {
-                    Map<String, DynamicCacheDescriptor> desc = cacheDescriptors(ig);
-
-                    Assert.assertEquals(4, desc.size());
-
-                    Assert.assertNotNull(ig.context().cache().cache(cache1));
-                    Assert.assertNotNull(ig.context().cache().cache(cache2));
-
-                    Map<String, GridCacheAdapter> caches = caches(ig);
-
-                    Assert.assertEquals(4, caches.size());
-                }
-            });
-        }
-
-        /**
-         * @param cls Closure.
-         */
-        private Runnable onAllNode(final IgniteInClosure<IgniteEx> cls) {
-            return new Runnable() {
-                @Override public void run() {
-                    for (IgniteEx ig : grids()) {
-                        try {
-                            cls.apply(ig);
-                        }
-                        catch (AssertionError e) {
-                            System.out.println("Assertion on " + ig.name());
-
-                            throw e;
-                        }
-                    }
-                }
-            };
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/ignite/blob/195147d5/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/standbycluster/IgniteChangeGlobalStateAbstractTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/standbycluster/IgniteChangeGlobalStateAbstractTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/standbycluster/IgniteChangeGlobalStateAbstractTest.java
index d16b845..4ccc8ed 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/standbycluster/IgniteChangeGlobalStateAbstractTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/standbycluster/IgniteChangeGlobalStateAbstractTest.java
@@ -152,6 +152,8 @@ public abstract class IgniteChangeGlobalStateAbstractTest extends GridCommonAbst
     protected void startPrimaryNodes(int cnt) throws Exception {
         for (int i = 0; i < cnt; i++)
             startPrimary(i);
+
+        grid("node0" + primarySuffix).active(true);
     }
 
     /**
@@ -164,7 +166,6 @@ public abstract class IgniteChangeGlobalStateAbstractTest extends GridCommonAbst
 
         IgniteConfiguration cfg = getConfiguration(name);
         cfg.setConsistentId(node);
-        cfg.setActiveOnStart(true);
         ((TcpDiscoverySpi)cfg.getDiscoverySpi()).setIpFinder(primaryIpFinder);
 
         Ignite ig = startGrid(name, cfg);
@@ -190,7 +191,6 @@ public abstract class IgniteChangeGlobalStateAbstractTest extends GridCommonAbst
 
         IgniteConfiguration cfg = getConfiguration(name);
         cfg.setConsistentId(node);
-        cfg.setActiveOnStart(false);
         ((TcpDiscoverySpi)cfg.getDiscoverySpi()).setIpFinder(backUpIpFinder);
 
         Ignite ig = startGrid(name, cfg);
@@ -242,7 +242,7 @@ public abstract class IgniteChangeGlobalStateAbstractTest extends GridCommonAbst
     /**
      *
      */
-    protected Iterable<Ignite> allBackUpNodes(){
+    protected Iterable<Ignite> allBackUpNodes() {
         List<Ignite> r = new ArrayList<>();
 
         for (String name : this.nodes.keySet())
@@ -261,9 +261,9 @@ public abstract class IgniteChangeGlobalStateAbstractTest extends GridCommonAbst
         List<Ignite> igs = new ArrayList<>();
 
         for (String name : this.nodes.keySet())
-            if (name.contains(backUpSuffix)){
+            if (name.contains(backUpSuffix)) {
                 if (includeClient)
-                   igs.add(this.nodes.get(name));
+                    igs.add(this.nodes.get(name));
                 else {
                     if (name.contains(clientSuffix))
                         continue;
@@ -277,7 +277,6 @@ public abstract class IgniteChangeGlobalStateAbstractTest extends GridCommonAbst
         return igs.get(idx);
     }
 
-
     /**
      * @param i Idx.
      */

http://git-wip-us.apache.org/repos/asf/ignite/blob/195147d5/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/standbycluster/IgniteStandByClusterTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/standbycluster/IgniteStandByClusterTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/standbycluster/IgniteStandByClusterTest.java
deleted file mode 100644
index 2d704db..0000000
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/standbycluster/IgniteStandByClusterTest.java
+++ /dev/null
@@ -1,213 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ignite.internal.processors.cache.persistence.standbycluster;
-
-import java.util.Arrays;
-import java.util.Map;
-import org.apache.ignite.cluster.ClusterNode;
-import org.apache.ignite.configuration.CacheConfiguration;
-import org.apache.ignite.configuration.IgniteConfiguration;
-import org.apache.ignite.configuration.PersistentStoreConfiguration;
-import org.apache.ignite.internal.IgniteEx;
-import org.apache.ignite.internal.processors.cache.DynamicCacheDescriptor;
-import org.apache.ignite.internal.processors.cache.GridCacheAdapter;
-import org.apache.ignite.internal.util.typedef.internal.U;
-import org.apache.ignite.lang.IgnitePredicate;
-import org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi;
-import org.apache.ignite.spi.discovery.tcp.ipfinder.TcpDiscoveryIpFinder;
-import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder;
-import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
-import org.junit.Assert;
-
-/**
- *
- */
-public class IgniteStandByClusterTest extends GridCommonAbstractTest {
-    private static final TcpDiscoveryIpFinder vmIpFinder = new TcpDiscoveryVmIpFinder(true);
-
-    @Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
-        IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
-
-        cfg.setDiscoverySpi(new TcpDiscoverySpi().setIpFinder(vmIpFinder));
-        cfg.setPersistentStoreConfiguration(new PersistentStoreConfiguration());
-        cfg.setConsistentId(igniteInstanceName);
-
-        return cfg;
-    }
-
-    public void testNotStartDynamicCachesOnClientAfterActivation() throws Exception {
-        final String cacheName0 = "cache0";
-        final String cacheName = "cache";
-
-        IgniteConfiguration cfg1 = getConfiguration("serv1");
-        IgniteConfiguration cfg2 = getConfiguration("serv2");
-
-        IgniteConfiguration cfg3 = getConfiguration("client");
-        cfg3.setCacheConfiguration(new CacheConfiguration(cacheName0));
-
-        cfg3.setClientMode(true);
-
-        IgniteEx ig1 = startGrid(cfg1);
-        IgniteEx ig2 = startGrid(cfg2);
-        IgniteEx ig3 = startGrid(cfg3);
-
-        assertTrue(!ig1.active());
-        assertTrue(!ig2.active());
-        assertTrue(!ig3.active());
-
-        ig3.active(true);
-
-        assertTrue(ig1.active());
-        assertTrue(ig2.active());
-        assertTrue(ig3.active());
-
-        ig3.createCache(new CacheConfiguration<>(cacheName));
-
-        assertNotNull(ig3.cache(cacheName));
-        assertNotNull(ig1.cache(cacheName));
-        assertNotNull(ig2.cache(cacheName));
-
-        assertNotNull(ig1.cache(cacheName0));
-        assertNotNull(ig3.cache(cacheName0));
-        assertNotNull(ig2.cache(cacheName0));
-
-        ig3.active(false);
-
-        assertTrue(!ig1.active());
-        assertTrue(!ig2.active());
-        assertTrue(!ig3.active());
-
-        ig3.active(true);
-
-        assertTrue(ig1.active());
-        assertTrue(ig2.active());
-        assertTrue(ig3.active());
-
-        assertNotNull(ig1.cache(cacheName));
-        assertNotNull(ig2.cache(cacheName));
-
-        Map<String, GridCacheAdapter<?, ?>> caches = U.field(ig3.context().cache(), "caches");
-
-        // Only system caches and cache0
-        assertTrue(caches.size() == 3);
-
-        assertNull(caches.get(cacheName));
-
-        assertNotNull(caches.get(cacheName0));
-
-        assertNotNull(ig3.cache(cacheName));
-    }
-
-    public void testStaticCacheStartAfterActivationWithCacheFilter() throws Exception {
-        String cache1 = "cache1";
-        String cache2 = "cache2";
-        String cache3 = "cache3";
-
-        IgniteConfiguration cfg1 = getConfiguration("node1");
-
-        cfg1.setCacheConfiguration(
-            new CacheConfiguration(cache1).setNodeFilter(new NodeFilterIgnoreByName("node2")));
-
-        IgniteConfiguration cfg2 = getConfiguration("node2");
-
-        cfg2.setCacheConfiguration(
-            new CacheConfiguration(cache2).setNodeFilter(new NodeFilterIgnoreByName("node3")));
-
-        IgniteConfiguration cfg3 = getConfiguration("node3");
-
-        cfg3.setCacheConfiguration(
-            new CacheConfiguration(cache3).setNodeFilter(new NodeFilterIgnoreByName("node1")));
-
-        IgniteEx ig1 = startGrid(cfg1);
-        IgniteEx ig2 = startGrid(cfg2);
-        IgniteEx ig3 = startGrid(cfg3);
-
-        assertTrue(!ig1.active());
-        assertTrue(!ig2.active());
-        assertTrue(!ig3.active());
-
-        for (IgniteEx ig: Arrays.asList(ig1,ig2,ig3)){
-            Map<String, DynamicCacheDescriptor> desc = U.field(U.field(ig.context().cache(), "cachesInfo"), "registeredCaches");
-
-            assertEquals(0, desc.size());
-        }
-
-        ig3.active(true);
-
-        assertTrue(ig1.active());
-        assertTrue(ig2.active());
-        assertTrue(ig3.active());
-
-        for (IgniteEx ig: Arrays.asList(ig1,ig2,ig3)){
-            Map<String, DynamicCacheDescriptor> desc = U.field(
-                U.field(ig.context().cache(), "cachesInfo"), "registeredCaches");
-
-            assertEquals(5, desc.size());
-
-            Map<String, GridCacheAdapter<?, ?>> caches = U.field(ig.context().cache(), "caches");
-
-            assertEquals(4, caches.keySet().size());
-        }
-
-        Map<String, GridCacheAdapter<?, ?>> caches1 = U.field(ig1.context().cache(), "caches");
-
-        Assert.assertNotNull(caches1.get(cache1));
-        Assert.assertNotNull(caches1.get(cache2));
-        Assert.assertNull(caches1.get(cache3));
-
-        Map<String, GridCacheAdapter<?, ?>> caches2 = U.field(ig2.context().cache(), "caches");
-
-        Assert.assertNull(caches2.get(cache1));
-        Assert.assertNotNull(caches2.get(cache2));
-        Assert.assertNotNull(caches2.get(cache3));
-
-        Map<String, GridCacheAdapter<?, ?>> caches3 = U.field(ig3.context().cache(), "caches");
-
-        Assert.assertNotNull(caches3.get(cache1));
-        Assert.assertNull(caches3.get(cache2));
-        Assert.assertNotNull(caches3.get(cache3));
-    }
-
-    private static class NodeFilterIgnoreByName implements IgnitePredicate<ClusterNode>{
-        private final String name;
-
-        private NodeFilterIgnoreByName(String name) {
-            this.name = name;
-        }
-
-        @Override public boolean apply(ClusterNode node) {
-            return !name.equals(node.consistentId());
-        }
-    }
-
-    @Override protected void beforeTest() throws Exception {
-        super.beforeTest();
-
-        stopAllGrids();
-
-        deleteRecursively(U.resolveWorkDirectory(U.defaultWorkDirectory(), "db", true));
-    }
-
-    @Override protected void afterTest() throws Exception {
-        super.beforeTest();
-
-        stopAllGrids();
-
-        deleteRecursively(U.resolveWorkDirectory(U.defaultWorkDirectory(), "db", true));
-    }
-}


Mime
View raw message