ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [47/50] incubator-ignite git commit: # ignite-sprint-6 added test for lastSuccessfulAddress
Date Fri, 19 Jun 2015 10:35:33 GMT
# ignite-sprint-6 added test for lastSuccessfulAddress


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

Branch: refs/heads/ignite-950
Commit: d699faa34d66b8e5f1487daf3386c4d677d8c1e5
Parents: 4d9868a
Author: sboikov <sboikov@gridgain.com>
Authored: Fri Jun 19 13:01:51 2015 +0300
Committer: sboikov <sboikov@gridgain.com>
Committed: Fri Jun 19 13:01:51 2015 +0300

----------------------------------------------------------------------
 .../spi/discovery/tcp/TcpDiscoverySelfTest.java | 44 ++++++++++++++++++--
 1 file changed, 41 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/d699faa3/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySelfTest.java
b/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySelfTest.java
index ad12753..9a44c24 100644
--- a/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySelfTest.java
@@ -149,9 +149,47 @@ public class TcpDiscoverySelfTest extends GridCommonAbstractTest {
      */
     public void testThreeNodesStartStop() throws Exception {
         try {
-            startGrid(1);
-            startGrid(2);
-            startGrid(3);
+            IgniteEx ignite1 = startGrid(1);
+            IgniteEx ignite2 = startGrid(2);
+            IgniteEx ignite3 = startGrid(3);
+
+            TcpDiscoverySpi spi1 = (TcpDiscoverySpi)ignite1.configuration().getDiscoverySpi();
+            TcpDiscoverySpi spi2 = (TcpDiscoverySpi)ignite2.configuration().getDiscoverySpi();
+            TcpDiscoverySpi spi3 = (TcpDiscoverySpi)ignite3.configuration().getDiscoverySpi();
+
+            TcpDiscoveryNode node = (TcpDiscoveryNode)spi1.getNode(ignite2.localNode().id());
+
+            assertNotNull(node);
+            assertNotNull(node.lastSuccessfulAddress());
+
+            LinkedHashSet<InetSocketAddress> addrs = spi1.getNodeAddresses(node);
+
+            assertEquals(addrs.iterator().next(), node.lastSuccessfulAddress());
+
+            assertTrue(spi1.pingNode(ignite3.localNode().id()));
+
+            node = (TcpDiscoveryNode)spi1.getNode(ignite3.localNode().id());
+
+            assertNotNull(node);
+            assertNotNull(node.lastSuccessfulAddress());
+
+            addrs = spi1.getNodeAddresses(node);
+            assertEquals(addrs.iterator().next(), node.lastSuccessfulAddress());
+
+            node = (TcpDiscoveryNode)spi2.getNode(ignite1.localNode().id());
+
+            assertNotNull(node);
+            assertNotNull(node.lastSuccessfulAddress());
+
+            node = (TcpDiscoveryNode)spi2.getNode(ignite3.localNode().id());
+
+            assertNotNull(node);
+            assertNotNull(node.lastSuccessfulAddress());
+
+            node = (TcpDiscoveryNode)spi3.getNode(ignite1.localNode().id());
+
+            assertNotNull(node);
+            assertNotNull(node.lastSuccessfulAddress());
         }
         finally {
             stopAllGrids();


Mime
View raw message