ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dpav...@apache.org
Subject ignite git commit: IGNITE-8711 test was adopted to take into account changes from IGNITE-5789 - Fixes #4157.
Date Fri, 08 Jun 2018 13:14:25 GMT
Repository: ignite
Updated Branches:
  refs/heads/master fa34308b6 -> 051648b52


IGNITE-8711 test was adopted to take into account changes from IGNITE-5789 - Fixes #4157.

Signed-off-by: dpavlov <dpavlov@apache.org>


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

Branch: refs/heads/master
Commit: 051648b52c2610a061601665d283f435890d4675
Parents: fa34308
Author: Sergey Chugunov <sergey.chugunov@gmail.com>
Authored: Fri Jun 8 16:11:18 2018 +0300
Committer: dpavlov <dpavlov@apache.org>
Committed: Fri Jun 8 16:11:18 2018 +0300

----------------------------------------------------------------------
 ...gniteAbstractStandByClientReconnectTest.java |  28 +++--
 ...eStandByClientReconnectToNewClusterTest.java | 117 ++++++++++---------
 2 files changed, 78 insertions(+), 67 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/051648b5/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/standbycluster/reconnect/IgniteAbstractStandByClientReconnectTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/standbycluster/reconnect/IgniteAbstractStandByClientReconnectTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/standbycluster/reconnect/IgniteAbstractStandByClientReconnectTest.java
index 9590112..f7b0ed7 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/standbycluster/reconnect/IgniteAbstractStandByClientReconnectTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/standbycluster/reconnect/IgniteAbstractStandByClientReconnectTest.java
@@ -277,37 +277,45 @@ public abstract class IgniteAbstractStandByClientReconnectTest extends
GridCommo
     }
 
     /**
-     *
+     * @param checkClientCaches Check presence of client caches, false to skip.
      */
-    protected void checkOnlySystemCaches() {
+    protected void checkOnlySystemCaches(boolean checkClientCaches) {
         IgniteEx ig1 = grid(node1);
         IgniteEx ig2 = grid(node2);
         IgniteEx client = grid(nodeClient);
 
         Assert.assertNull(ig1.cache(ccfg1staticName));
         Assert.assertNull(ig1.cache(ccfg2staticName));
-        Assert.assertNull(ig1.cache(ccfg3staticName));
 
         Assert.assertNull(ig1.cache(ccfg1staticWithFilterName));
         Assert.assertNull(ig1.cache(ccfg2staticWithFilterName));
 
         Assert.assertNull(ig2.cache(ccfg1staticName));
         Assert.assertNull(ig2.cache(ccfg2staticName));
-        Assert.assertNull(ig2.cache(ccfg3staticName));
 
-        Assert.assertNull(ig2.cache(ccfg3staticWithFilterName));
         Assert.assertNull(ig2.cache(ccfg2staticWithFilterName));
 
         Assert.assertNull(client.cache(ccfg1staticName));
         Assert.assertNull(client.cache(ccfg2staticName));
-        Assert.assertNull(client.cache(ccfg3staticName));
 
-        Assert.assertNull(client.cache(ccfg3staticWithFilterName));
         Assert.assertNull(client.cache(ccfg1staticWithFilterName));
 
-        checkDescriptors(ig1,Collections.emptySet());
-        checkDescriptors(ig2,Collections.emptySet());
-        checkDescriptors(client, Collections.emptySet());
+        if (checkClientCaches) {
+            Assert.assertNull(ig1.cache(ccfg3staticName));
+
+            Assert.assertNull(ig2.cache(ccfg3staticName));
+            Assert.assertNull(ig2.cache(ccfg3staticWithFilterName));
+
+            Assert.assertNull(client.cache(ccfg3staticName));
+            Assert.assertNull(client.cache(ccfg3staticWithFilterName));
+        }
+
+        Set cachesToCheck = checkClientCaches ? Collections.emptySet()
+            : Sets.newHashSet(ccfg3staticName, ccfg3staticWithFilterName);
+
+        checkDescriptors(ig1, cachesToCheck);
+        checkDescriptors(ig2, cachesToCheck);
+        checkDescriptors(client, cachesToCheck);
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/ignite/blob/051648b5/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/standbycluster/reconnect/IgniteStandByClientReconnectToNewClusterTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/standbycluster/reconnect/IgniteStandByClientReconnectToNewClusterTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/standbycluster/reconnect/IgniteStandByClientReconnectToNewClusterTest.java
index 871098f..c1f672b 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/standbycluster/reconnect/IgniteStandByClientReconnectToNewClusterTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/standbycluster/reconnect/IgniteStandByClientReconnectToNewClusterTest.java
@@ -30,24 +30,24 @@ public class IgniteStandByClientReconnectToNewClusterTest extends IgniteAbstract
     /**
      * @throws Exception If failed.
      */
-    public void testActiveClientReconnectToActiveCluster() throws Exception {
+    public void testActiveClientReconnectsToActiveCluster() throws Exception {
         CountDownLatch activateLatch = new CountDownLatch(1);
 
         startNodes(activateLatch);
 
-        info(">>>> star grid");
+        info(">>>> start grid");
 
         IgniteEx ig1 = grid(node1);
         IgniteEx ig2 = grid(node2);
         IgniteEx client = grid(nodeClient);
 
-        assertTrue(!ig1.active());
-        assertTrue(!ig2.active());
-        assertTrue(!client.active());
+        assertTrue(!ig1.cluster().active());
+        assertTrue(!ig2.cluster().active());
+        assertTrue(!client.cluster().active());
 
         info(">>>> activate grid");
 
-        client.active(true);
+        client.cluster().active(true);
 
         checkDescriptors(ig1, staticCacheNames);
         checkDescriptors(ig2, staticCacheNames);
@@ -61,9 +61,9 @@ public class IgniteStandByClientReconnectToNewClusterTest extends IgniteAbstract
 
         client.createCache(ccfgDynamicWithFilter);
 
-        assertTrue(ig1.active());
-        assertTrue(ig2.active());
-        assertTrue(client.active());
+        assertTrue(ig1.cluster().active());
+        assertTrue(ig2.cluster().active());
+        assertTrue(client.cluster().active());
 
         checkDescriptors(ig1, allCacheNames);
         checkDescriptors(ig2, allCacheNames);
@@ -86,10 +86,10 @@ public class IgniteStandByClientReconnectToNewClusterTest extends IgniteAbstract
 
         info(">>>> activate new servers");
 
-        ig1.active(true);
+        ig1.cluster().active(true);
 
-        assertTrue(ig1.active());
-        assertTrue(ig2.active());
+        assertTrue(ig1.cluster().active());
+        assertTrue(ig2.cluster().active());
 
         activateLatch.countDown();
 
@@ -99,9 +99,9 @@ public class IgniteStandByClientReconnectToNewClusterTest extends IgniteAbstract
 
         info(">>>> client reconnected");
 
-        assertTrue(ig1.active());
-        assertTrue(ig2.active());
-        assertTrue(client.active());
+        assertTrue(ig1.cluster().active());
+        assertTrue(ig2.cluster().active());
+        assertTrue(client.cluster().active());
 
         checkAllCaches();
     }
@@ -109,22 +109,22 @@ public class IgniteStandByClientReconnectToNewClusterTest extends IgniteAbstract
     /**
      * @throws Exception If failed.
      */
-    public void testActiveClientReconnectToInactiveCluster() throws Exception {
+    public void testActiveClientReconnectsToInactiveCluster() throws Exception {
         startNodes(null);
 
-        info(">>>> star grid");
+        info(">>>> start grid");
 
         IgniteEx ig1 = grid(node1);
         IgniteEx ig2 = grid(node2);
         IgniteEx client = grid(nodeClient);
 
-        assertTrue(!ig1.active());
-        assertTrue(!ig2.active());
-        assertTrue(!client.active());
+        assertTrue(!ig1.cluster().active());
+        assertTrue(!ig2.cluster().active());
+        assertTrue(!client.cluster().active());
 
         info(">>>> activate grid");
 
-        client.active(true);
+        client.cluster().active(true);
 
         checkStaticCaches();
 
@@ -142,9 +142,9 @@ public class IgniteStandByClientReconnectToNewClusterTest extends IgniteAbstract
         checkDescriptors(ig2, allCacheNames);
         checkDescriptors(client, allCacheNames);
 
-        assertTrue(ig1.active());
-        assertTrue(ig2.active());
-        assertTrue(client.active());
+        assertTrue(ig1.cluster().active());
+        assertTrue(ig2.cluster().active());
+        assertTrue(client.cluster().active());
 
         final CountDownLatch disconnectedLatch = new CountDownLatch(1);
         final CountDownLatch reconnectedLatch = new CountDownLatch(1);
@@ -156,7 +156,7 @@ public class IgniteStandByClientReconnectToNewClusterTest extends IgniteAbstract
         stopGrid(node1);
         stopGrid(node2);
 
-        assertTrue(client.active());
+        assertTrue(client.cluster().active());
 
         System.out.println("Await disconnected");
 
@@ -171,17 +171,17 @@ public class IgniteStandByClientReconnectToNewClusterTest extends IgniteAbstract
 
         info(">>>> client reconnected");
 
-        assertTrue(!ig1.active());
-        assertTrue(!ig2.active());
-        assertTrue(!client.active());
+        assertTrue(!ig1.cluster().active());
+        assertTrue(!ig2.cluster().active());
+        assertTrue(!client.cluster().active());
 
         info(">>>> activate new servers");
 
-        client.active(true);
+        client.cluster().active(true);
 
-        assertTrue(ig1.active());
-        assertTrue(ig2.active());
-        assertTrue(client.active());
+        assertTrue(ig1.cluster().active());
+        assertTrue(ig2.cluster().active());
+        assertTrue(client.cluster().active());
 
         checkAllCaches();
     }
@@ -189,7 +189,7 @@ public class IgniteStandByClientReconnectToNewClusterTest extends IgniteAbstract
     /**
      * @throws Exception If failed.
      */
-    public void testInactiveClientReconnectToActiveCluster() throws Exception {
+    public void testInactiveClientReconnectsToActiveCluster() throws Exception {
         CountDownLatch activateLatch = new CountDownLatch(1);
 
         startNodes(activateLatch);
@@ -198,9 +198,9 @@ public class IgniteStandByClientReconnectToNewClusterTest extends IgniteAbstract
         IgniteEx ig2 = grid(node2);
         IgniteEx client = grid(nodeClient);
 
-        assertTrue(!ig1.active());
-        assertTrue(!ig2.active());
-        assertTrue(!client.active());
+        assertTrue(!ig1.cluster().active());
+        assertTrue(!ig2.cluster().active());
+        assertTrue(!client.cluster().active());
 
         final CountDownLatch disconnectedLatch = new CountDownLatch(1);
         final CountDownLatch reconnectedLatch = new CountDownLatch(1);
@@ -215,10 +215,10 @@ public class IgniteStandByClientReconnectToNewClusterTest extends IgniteAbstract
         ig1 = startGrid(getConfiguration(node1));
         ig2 = startGrid(getConfiguration(node2));
 
-        ig1.active(true);
+        ig1.cluster().active(true);
 
-        assertTrue(ig1.active());
-        assertTrue(ig2.active());
+        assertTrue(ig1.cluster().active());
+        assertTrue(ig2.cluster().active());
 
         checkDescriptors(ig1, Collections.<String>emptySet());
         checkDescriptors(ig2, Collections.<String>emptySet());
@@ -227,17 +227,20 @@ public class IgniteStandByClientReconnectToNewClusterTest extends IgniteAbstract
 
         reconnectedLatch.await();
 
-        assertTrue(ig1.active());
-        assertTrue(ig2.active());
-        assertTrue(client.active());
+        assertTrue(ig1.cluster().active());
+        assertTrue(ig2.cluster().active());
+        assertTrue(client.cluster().active());
 
-        checkOnlySystemCaches();
+        checkOnlySystemCaches(false);
 
         client.createCache(ccfgDynamic);
 
         client.createCache(ccfgDynamicWithFilter);
 
-        Set<String> exp2 = Sets.newHashSet(ccfgDynamicName, ccfgDynamicWithFilterName);
+        Set<String> exp2 = Sets.newHashSet(ccfg3staticName,
+            ccfg3staticWithFilterName,
+            ccfgDynamicName,
+            ccfgDynamicWithFilterName);
 
         checkDescriptors(ig1, exp2);
         checkDescriptors(ig2, exp2);
@@ -247,16 +250,16 @@ public class IgniteStandByClientReconnectToNewClusterTest extends IgniteAbstract
     /**
      * @throws Exception If failed.
      */
-    public void testInActiveClientReconnectToInactiveCluster() throws Exception {
+    public void testInactiveClientReconnectsToInactiveCluster() throws Exception {
         startNodes(null);
 
         IgniteEx ig1 = grid(node1);
         IgniteEx ig2 = grid(node2);
         IgniteEx client = grid(nodeClient);
 
-        assertTrue(!ig1.active());
-        assertTrue(!ig2.active());
-        assertTrue(!client.active());
+        assertTrue(!ig1.cluster().active());
+        assertTrue(!ig2.cluster().active());
+        assertTrue(!client.cluster().active());
 
         final CountDownLatch disconnectedLatch = new CountDownLatch(1);
         final CountDownLatch reconnectedLatch = new CountDownLatch(1);
@@ -266,7 +269,7 @@ public class IgniteStandByClientReconnectToNewClusterTest extends IgniteAbstract
         stopGrid(node1);
         stopGrid(node2);
 
-        assertTrue(!client.active());
+        assertTrue(!client.cluster().active());
 
         disconnectedLatch.await();
 
@@ -275,17 +278,17 @@ public class IgniteStandByClientReconnectToNewClusterTest extends IgniteAbstract
 
         reconnectedLatch.await();
 
-        assertTrue(!ig1.active());
-        assertTrue(!ig2.active());
-        assertTrue(!client.active());
+        assertTrue(!ig1.cluster().active());
+        assertTrue(!ig2.cluster().active());
+        assertTrue(!client.cluster().active());
 
-        client.active(true);
+        client.cluster().active(true);
 
-        assertTrue(ig1.active());
-        assertTrue(ig2.active());
-        assertTrue(client.active());
+        assertTrue(ig1.cluster().active());
+        assertTrue(ig2.cluster().active());
+        assertTrue(client.cluster().active());
 
-        checkOnlySystemCaches();
+        checkOnlySystemCaches(true);
 
         client.createCache(ccfgDynamic);
 


Mime
View raw message