IGNITE-10715 Remove boilerplate of settings 'TcpDiscoveryVmIpFinder' in tests (hotfix)
authorVyacheslav Daradur <daradurvs@gmail.com>
Wed, 26 Dec 2018 11:22:49 +0000 (14:22 +0300)
committerAnton Vinogradov <av@apache.org>
Wed, 26 Dec 2018 11:22:49 +0000 (14:22 +0300)
Signed-off-by: Anton Vinogradov <av@apache.org>
modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/IgniteClientConnectTest.java

index 2cf8bcb..784078f 100644 (file)
@@ -60,7 +60,7 @@ public class IgniteClientConnectTest extends GridCommonAbstractTest {
     @Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
         IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
 
-        TestTcpDiscoverySpi disco = (TestTcpDiscoverySpi)cfg.getDiscoverySpi();
+        TestTcpDiscoverySpi disco = new TestTcpDiscoverySpi();
 
         if (igniteInstanceName.equals("client")) {
             TcpDiscoveryVmIpFinder ipFinder = new TcpDiscoveryVmIpFinder();
@@ -69,11 +69,15 @@ public class IgniteClientConnectTest extends GridCommonAbstractTest {
 
             disco.setIpFinder(ipFinder);
         }
+        else
+            disco.setIpFinder(sharedStaticIpFinder);
 
         disco.setJoinTimeout(2 * 60_000);
         disco.setSocketTimeout(1000);
         disco.setNetworkTimeout(2000);
 
+        cfg.setDiscoverySpi(disco);
+
         CacheConfiguration cacheConfiguration = new CacheConfiguration()
                 .setName(DEFAULT_CACHE_NAME)
                 .setCacheMode(CacheMode.PARTITIONED)