ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [14/50] incubator-ignite git commit: # IGNITE-943 Fix GridProjectionSelfTest
Date Mon, 01 Jun 2015 17:24:05 GMT
# IGNITE-943 Fix GridProjectionSelfTest


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

Branch: refs/heads/ignite-218
Commit: 5cec2ba61b98cabd421aeb0091c5531b246f54e3
Parents: e2e90c4
Author: sevdokimov <sevdokimov@gridgain.com>
Authored: Thu May 28 15:43:34 2015 +0300
Committer: sevdokimov <sevdokimov@gridgain.com>
Committed: Thu May 28 15:43:34 2015 +0300

----------------------------------------------------------------------
 .../ignite/spi/discovery/tcp/TcpDiscoverySpi.java   |  4 +++-
 .../ignite/internal/GridProjectionAbstractTest.java | 16 ++++++++++++++++
 2 files changed, 19 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/5cec2ba6/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpi.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpi.java
b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpi.java
index 5a2ddd6..52ea78c 100644
--- a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpi.java
+++ b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpi.java
@@ -393,8 +393,10 @@ public class TcpDiscoverySpi extends IgniteSpiAdapter implements DiscoverySpi,
T
      *
      * @param forceSrvMode forceServerMode flag.
      */
-    public void setForceServerMode(boolean forceSrvMode) {
+    public TcpDiscoverySpi setForceServerMode(boolean forceSrvMode) {
         this.forceSrvMode = forceSrvMode;
+
+        return this;
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/5cec2ba6/modules/core/src/test/java/org/apache/ignite/internal/GridProjectionAbstractTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/GridProjectionAbstractTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/GridProjectionAbstractTest.java
index 0171290..cb1341c 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/GridProjectionAbstractTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/GridProjectionAbstractTest.java
@@ -20,9 +20,13 @@ package org.apache.ignite.internal;
 import org.apache.ignite.*;
 import org.apache.ignite.cluster.*;
 import org.apache.ignite.compute.*;
+import org.apache.ignite.configuration.*;
 import org.apache.ignite.events.*;
 import org.apache.ignite.internal.util.typedef.*;
 import org.apache.ignite.lang.*;
+import org.apache.ignite.spi.discovery.tcp.*;
+import org.apache.ignite.spi.discovery.tcp.ipfinder.*;
+import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.*;
 import org.apache.ignite.testframework.junits.common.*;
 import org.jetbrains.annotations.*;
 
@@ -38,6 +42,9 @@ import static org.apache.ignite.events.EventType.*;
  */
 @SuppressWarnings("deprecation")
 public abstract class GridProjectionAbstractTest extends GridCommonAbstractTest implements
Externalizable {
+    /** VM ip finder for TCP discovery. */
+    private static TcpDiscoveryIpFinder ipFinder = new TcpDiscoveryVmIpFinder(true);
+
     /** Waiting timeout. */
     private static final int WAIT_TIMEOUT = 30000;
 
@@ -87,6 +94,15 @@ public abstract class GridProjectionAbstractTest extends GridCommonAbstractTest
         // No-op.
     }
 
+    /** {@inheritDoc} */
+    @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception
{
+        IgniteConfiguration cfg = super.getConfiguration(gridName);
+
+        cfg.setDiscoverySpi(new TcpDiscoverySpi().setForceServerMode(true).setIpFinder(ipFinder));
+
+        return cfg;
+    }
+
     /**
      * @param startGrid Start grid flag.
      */


Mime
View raw message