Index: modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySslWithWrongServerTest.java IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== diff --git a/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySslWithWrongServerTest.java b/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySslWithWrongServerTest.java new file mode 100644 --- /dev/null (revision 563ba0aad2cc400a92b94b2f675666925ee916b9) +++ b/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySslWithWrongServerTest.java (revision 563ba0aad2cc400a92b94b2f675666925ee916b9) @@ -0,0 +1,25 @@ +package org.apache.ignite.spi.discovery.tcp; + +import java.net.InetAddress; +import java.net.ServerSocket; +import org.apache.ignite.configuration.IgniteConfiguration; +import org.apache.ignite.testframework.GridTestUtils; +import org.jetbrains.annotations.NotNull; + +/** + * SSL enabled version of {@link TcpDiscoveryWithWrongServerTest}. + */ +public class TcpDiscoverySslWithWrongServerTest extends TcpDiscoveryWithWrongServerTest { + /** {@inheritDoc} */ + @Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception { + return super.getConfiguration(igniteInstanceName) + .setSslContextFactory(GridTestUtils.sslFactory()); + } + + /** {@inheritDoc} */ + @Override protected @NotNull ServerSocket getServerSocket(int port) throws Exception { + return GridTestUtils.sslContext() + .getServerSocketFactory() + .createServerSocket(port, 10, InetAddress.getByName("127.0.0.1")); + } +} Index: modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoveryWithWrongServerTest.java IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== diff --git a/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoveryWithWrongServerTest.java b/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoveryWithWrongServerTest.java --- a/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoveryWithWrongServerTest.java (revision b6082ae2ca07e7048a539573488fc32969be2791) +++ b/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoveryWithWrongServerTest.java (revision 563ba0aad2cc400a92b94b2f675666925ee916b9) @@ -36,6 +36,7 @@ import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder; import org.apache.ignite.testframework.GridTestThread; import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest; +import org.jetbrains.annotations.NotNull; import org.junit.Test; /** @@ -60,8 +61,7 @@ TcpDiscoveryVmIpFinder ipFinder = new TcpDiscoveryVmIpFinder(); - ipFinder.setAddresses(Collections.singleton("127.0.0.1:" + Integer.toString(SERVER_PORT) + ".." + - Integer.toString(LAST_SERVER_PORT))); + ipFinder.setAddresses(Collections.singleton("127.0.0.1:" + SERVER_PORT + ".." + LAST_SERVER_PORT)); cfg.setDiscoverySpi(new TcpDiscoverySpiWithOrderedIps().setIpFinder(ipFinder)); @@ -81,8 +81,8 @@ * Starts tcp test thread * @param workerFactory one of WorkerFactory */ - protected void startTcpThread(final WorkerFactory workerFactory, final int port) throws Exception { - final ServerSocket srvSock = new ServerSocket(port, 10, InetAddress.getByName("127.0.0.1")); + protected void startTcpThread(final WorkerFactory workerFactory, final int port) throws Exception { + ServerSocket srvSock = getServerSocket(port); srvSocks.add(srvSock); @@ -106,6 +106,13 @@ }).start(); } + /** + * @param port Port. + */ + @NotNull protected ServerSocket getServerSocket(int port) throws Exception { + return new ServerSocket(port, 10, InetAddress.getByName("127.0.0.1")); + } + /** * Stops tcp test thread * @throws IOException IOException