ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sevdoki...@apache.org
Subject incubator-ignite git commit: # IGNITE-709 Fix tests.
Date Wed, 20 May 2015 12:14:02 GMT
Repository: incubator-ignite
Updated Branches:
  refs/heads/ignite-709_2 ecf34cae4 -> 9d4d01c31


# IGNITE-709 Fix tests.


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

Branch: refs/heads/ignite-709_2
Commit: 9d4d01c31dbc90f453406ba41ae9b375e014193d
Parents: ecf34ca
Author: sevdokimov <sevdokimov@gridgain.com>
Authored: Wed May 20 15:13:46 2015 +0300
Committer: sevdokimov <sevdokimov@gridgain.com>
Committed: Wed May 20 15:13:46 2015 +0300

----------------------------------------------------------------------
 .../GridDiscoveryManagerAttributesSelfTest.java | 29 ++++++++++++--------
 .../discovery/GridDiscoveryManagerSelfTest.java | 19 ++++++-------
 2 files changed, 27 insertions(+), 21 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/9d4d01c3/modules/core/src/test/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManagerAttributesSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManagerAttributesSelfTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManagerAttributesSelfTest.java
index 2698eca..fc953d9 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManagerAttributesSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManagerAttributesSelfTest.java
@@ -19,7 +19,6 @@ package org.apache.ignite.internal.managers.discovery;
 
 import org.apache.ignite.*;
 import org.apache.ignite.configuration.*;
-import org.apache.ignite.spi.discovery.*;
 import org.apache.ignite.spi.discovery.tcp.*;
 import org.apache.ignite.spi.discovery.tcp.ipfinder.*;
 import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.*;
@@ -38,7 +37,7 @@ public abstract class GridDiscoveryManagerAttributesSelfTest extends GridCommonA
     private static final TcpDiscoveryIpFinder IP_FINDER = new TcpDiscoveryVmIpFinder(true);
 
     /** */
-    private static DeploymentMode mode = SHARED;
+    private static DeploymentMode mode;
 
     /** */
     private static boolean p2pEnabled;
@@ -53,12 +52,24 @@ public abstract class GridDiscoveryManagerAttributesSelfTest extends GridCommonA
         cfg.setIncludeProperties(PREFER_IPV4);
         cfg.setDeploymentMode(mode);
         cfg.setPeerClassLoadingEnabled(p2pEnabled);
-        cfg.setDiscoverySpi(createDiscovery(cfg));
+
+        TcpDiscoverySpiAdapter discoverySpi = createDiscovery(cfg);
+
+        discoverySpi.setIpFinder(IP_FINDER);
+
+        cfg.setDiscoverySpi(discoverySpi);
 
         return cfg;
     }
 
     /** {@inheritDoc} */
+    @Override protected void beforeTest() throws Exception {
+        mode = SHARED;
+
+        p2pEnabled = false;
+    }
+
+    /** {@inheritDoc} */
     @Override protected void afterTest() throws Exception {
         stopAllGrids();
     }
@@ -67,12 +78,8 @@ public abstract class GridDiscoveryManagerAttributesSelfTest extends GridCommonA
      * @return Discovery SPI.
      * @param cfg DiscoverySpi
      */
-    protected DiscoverySpi createDiscovery(IgniteConfiguration cfg) {
-        TcpDiscoverySpi disc = new TcpDiscoverySpi();
-
-        disc.setIpFinder(IP_FINDER);
-
-        return disc;
+    protected TcpDiscoverySpiAdapter createDiscovery(IgniteConfiguration cfg) {
+        return new TcpDiscoverySpi();
     }
 
     /**
@@ -180,9 +187,9 @@ public abstract class GridDiscoveryManagerAttributesSelfTest extends GridCommonA
     public static class ClientDiscovery extends GridDiscoveryManagerAttributesSelfTest {
         /** {@inheritDoc}
          * @param cfg*/
-        @Override protected DiscoverySpi createDiscovery(IgniteConfiguration cfg) {
+        @Override protected TcpDiscoverySpiAdapter createDiscovery(IgniteConfiguration cfg)
{
             if (Boolean.TRUE.equals(cfg.isClientMode()))
-                return createClientDiscovery(IP_FINDER);
+                return new TcpClientDiscoverySpi();
 
             return super.createDiscovery(cfg);
         }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/9d4d01c3/modules/core/src/test/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManagerSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManagerSelfTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManagerSelfTest.java
index 2fdc084..5f5bddb 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManagerSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManagerSelfTest.java
@@ -23,7 +23,6 @@ import org.apache.ignite.internal.*;
 import org.apache.ignite.internal.processors.affinity.*;
 import org.apache.ignite.internal.util.typedef.*;
 import org.apache.ignite.lang.*;
-import org.apache.ignite.spi.discovery.*;
 import org.apache.ignite.spi.discovery.tcp.*;
 import org.apache.ignite.spi.discovery.tcp.ipfinder.*;
 import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.*;
@@ -71,7 +70,11 @@ public abstract class GridDiscoveryManagerSelfTest extends GridCommonAbstractTes
             cfg.setCacheConfiguration(ccfg1, ccfg2);
         }
 
-        cfg.setDiscoverySpi(createDiscovery(cfg));
+        TcpDiscoverySpiAdapter discoverySpi = createDiscovery(cfg);
+
+        discoverySpi.setIpFinder(IP_FINDER);
+
+        cfg.setDiscoverySpi(discoverySpi);
 
         return cfg;
     }
@@ -80,12 +83,8 @@ public abstract class GridDiscoveryManagerSelfTest extends GridCommonAbstractTes
      * @return Discovery SPI.
      * @param cfg DiscoverySpi
      */
-    protected DiscoverySpi createDiscovery(IgniteConfiguration cfg) {
-        TcpDiscoverySpi disc = new TcpDiscoverySpi();
-
-        disc.setIpFinder(IP_FINDER);
-
-        return disc;
+    protected TcpDiscoverySpiAdapter createDiscovery(IgniteConfiguration cfg) {
+        return new TcpDiscoverySpi();
     }
 
     /**
@@ -210,9 +209,9 @@ public abstract class GridDiscoveryManagerSelfTest extends GridCommonAbstractTes
     public static class ClientDiscovery extends GridDiscoveryManagerSelfTest {
         /** {@inheritDoc}
          * @param cfg*/
-        @Override protected DiscoverySpi createDiscovery(IgniteConfiguration cfg) {
+        @Override protected TcpDiscoverySpiAdapter createDiscovery(IgniteConfiguration cfg)
{
             if (Boolean.TRUE.equals(cfg.isClientMode()))
-                return createClientDiscovery(IP_FINDER);
+                return new TcpClientDiscoverySpi();
 
             return super.createDiscovery(cfg);
         }


Mime
View raw message