ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sevdoki...@apache.org
Subject [3/6] incubator-ignite git commit: # IGNITE-943 Added test for broken configuration.
Date Thu, 28 May 2015 11:47:22 GMT
# IGNITE-943 Added test for broken configuration.


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

Branch: refs/heads/ignite-943
Commit: b3ac88f8f6613c1cef89657cd2118134f4ad4a06
Parents: b0d9ef8
Author: sevdokimov <sevdokimov@gridgain.com>
Authored: Thu May 28 12:45:19 2015 +0300
Committer: sevdokimov <sevdokimov@gridgain.com>
Committed: Thu May 28 14:46:08 2015 +0300

----------------------------------------------------------------------
 .../tcp/TcpClientDiscoverySpiSelfTest.java      | 24 +++++++++++++++++++-
 1 file changed, 23 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b3ac88f8/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/TcpClientDiscoverySpiSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/TcpClientDiscoverySpiSelfTest.java
b/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/TcpClientDiscoverySpiSelfTest.java
index f27ef33..0d08a0d 100644
--- a/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/TcpClientDiscoverySpiSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/TcpClientDiscoverySpiSelfTest.java
@@ -103,6 +103,9 @@ public class TcpClientDiscoverySpiSelfTest extends GridCommonAbstractTest
{
     /** */
     private boolean longSockTimeouts;
 
+    /** */
+    private Boolean cfgClientMode;
+
     /** {@inheritDoc} */
     @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception
{
         IgniteConfiguration cfg = super.getConfiguration(gridName);
@@ -119,7 +122,7 @@ public class TcpClientDiscoverySpiSelfTest extends GridCommonAbstractTest
{
 
             disco.setClientMode(true);
 
-            cfg.setClientMode(true);
+            cfg.setClientMode(cfgClientMode == null ? true : cfgClientMode);
 
             TcpDiscoveryVmIpFinder ipFinder;
 
@@ -872,6 +875,25 @@ public class TcpClientDiscoverySpiSelfTest extends GridCommonAbstractTest
{
     }
 
     /**
+     *
+     */
+    public void testBrokenConfiguration() throws Exception {
+        startServerNodes(1);
+
+        cfgClientMode = false;
+
+        try {
+            startClientNodes(1);
+
+            fail("Configuration is boken, node cannot be started with DiscoverySpi.clientMode
= true and " +
+                "IgniteConfiguration.clientMode = false");
+        }
+        catch (Exception e) {
+            assertTrue(e.getMessage(), e.getMessage().contains("DiscoverySpi is in client
mode"));
+        }
+    }
+
+    /**
      * @param clientIdx Index.
      * @throws Exception In case of error.
      */


Mime
View raw message