geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From u..@apache.org
Subject [1/3] incubator-geode git commit: GEODE-420: Amended method signature in SSLConfigurationFactory.java and SocketCreatorFactory.java to be more generic. Deprecated Cluster-ssl-* configuration and replaced it with new ssl-* configuration properties.
Date Tue, 09 Aug 2016 20:06:04 GMT
Repository: incubator-geode
Updated Branches:
  refs/heads/feature/GEODE-420 b557ccfef -> f7424db6e


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/f7424db6/geode-core/src/test/java/com/gemstone/gemfire/distributed/ServerLauncherLocalIntegrationTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/distributed/ServerLauncherLocalIntegrationTest.java
b/geode-core/src/test/java/com/gemstone/gemfire/distributed/ServerLauncherLocalIntegrationTest.java
index 854f02d..cfc3960 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/distributed/ServerLauncherLocalIntegrationTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/distributed/ServerLauncherLocalIntegrationTest.java
@@ -27,6 +27,7 @@ import com.gemstone.gemfire.distributed.ServerLauncher.ServerState;
 import com.gemstone.gemfire.internal.AvailablePort;
 import com.gemstone.gemfire.internal.AvailablePortHelper;
 import com.gemstone.gemfire.internal.GemFireVersion;
+import com.gemstone.gemfire.internal.net.SSLEnabledComponent;
 import com.gemstone.gemfire.internal.net.SocketCreator;
 import com.gemstone.gemfire.internal.cache.AbstractCacheServer;
 import com.gemstone.gemfire.internal.cache.xmlcache.CacheCreation;
@@ -350,7 +351,7 @@ public class ServerLauncherLocalIntegrationTest extends AbstractServerLauncherIn
     String rootFolder = this.temporaryFolder.getRoot().getCanonicalPath();
 
     // generate one free port and then use TEST_OVERRIDE_DEFAULT_PORT_PROPERTY
-    this.socket = SocketCreatorFactory.getClusterSSLSocketCreator().createServerSocket(this.serverPort,
50, null, -1);
+    this.socket = SocketCreatorFactory.getSSLSocketCreatorForComponent(SSLEnabledComponent.CLUSTER).createServerSocket(this.serverPort,
50, null, -1);
     assertFalse(AvailablePort.isPortAvailable(this.serverPort, AvailablePort.SOCKET));
     
     // build and start the server
@@ -609,7 +610,7 @@ public class ServerLauncherLocalIntegrationTest extends AbstractServerLauncherIn
     String rootFolder = this.temporaryFolder.getRoot().getCanonicalPath();
 
     // generate one free port and then use TEST_OVERRIDE_DEFAULT_PORT_PROPERTY
-    this.socket = SocketCreatorFactory.getClusterSSLSocketCreator().createServerSocket(this.serverPort,
50, null, -1);
+    this.socket = SocketCreatorFactory.getSSLSocketCreatorForComponent(SSLEnabledComponent.CLUSTER).createServerSocket(this.serverPort,
50, null, -1);
     assertFalse(AvailablePort.isPortAvailable(this.serverPort, AvailablePort.SOCKET));
     
     // build and start the server
@@ -770,7 +771,7 @@ public class ServerLauncherLocalIntegrationTest extends AbstractServerLauncherIn
 
     // generate one free port and then use TEST_OVERRIDE_DEFAULT_PORT_PROPERTY
     final int freeTCPPort = AvailablePort.getRandomAvailablePort(AvailablePort.SOCKET);
-    this.socket = SocketCreatorFactory.getClusterSSLSocketCreator().createServerSocket(freeTCPPort,
50, null, -1);
+    this.socket = SocketCreatorFactory.getSSLSocketCreatorForComponent(SSLEnabledComponent.CLUSTER).createServerSocket(freeTCPPort,
50, null, -1);
     
     // build and start the server
     final Builder builder = new Builder()

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/f7424db6/geode-core/src/test/java/com/gemstone/gemfire/distributed/ServerLauncherRemoteIntegrationTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/distributed/ServerLauncherRemoteIntegrationTest.java
b/geode-core/src/test/java/com/gemstone/gemfire/distributed/ServerLauncherRemoteIntegrationTest.java
index f1a8d41..96686a0 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/distributed/ServerLauncherRemoteIntegrationTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/distributed/ServerLauncherRemoteIntegrationTest.java
@@ -25,6 +25,7 @@ import com.gemstone.gemfire.distributed.internal.DistributionConfig;
 import com.gemstone.gemfire.internal.AvailablePort;
 import com.gemstone.gemfire.internal.AvailablePortHelper;
 import com.gemstone.gemfire.internal.GemFireVersion;
+import com.gemstone.gemfire.internal.net.SSLEnabledComponent;
 import com.gemstone.gemfire.internal.net.SocketCreator;
 import com.gemstone.gemfire.internal.cache.AbstractCacheServer;
 import com.gemstone.gemfire.internal.cache.xmlcache.CacheCreation;
@@ -428,7 +429,7 @@ public class ServerLauncherRemoteIntegrationTest extends AbstractServerLauncherR
   @Test
   public void testStartUsingDisableDefaultServerSkipsPortCheck() throws Throwable {
     // make serverPort in use
-    this.socket = SocketCreatorFactory.getClusterSSLSocketCreator().createServerSocket(this.serverPort,
50, null, -1);
+    this.socket = SocketCreatorFactory.getSSLSocketCreatorForComponent(SSLEnabledComponent.CLUSTER).createServerSocket(this.serverPort,
50, null, -1);
     assertFalse(AvailablePort.isPortAvailable(this.serverPort, AvailablePort.SOCKET));
     
     // build and start the server
@@ -552,7 +553,7 @@ public class ServerLauncherRemoteIntegrationTest extends AbstractServerLauncherR
   @Test
   public void testStartUsingServerPortInUseFails() throws Throwable {
     // make serverPort in use
-    this.socket = SocketCreatorFactory.getClusterSSLSocketCreator().createServerSocket(this.serverPort,
50, null, -1);
+    this.socket = SocketCreatorFactory.getSSLSocketCreatorForComponent(SSLEnabledComponent.CLUSTER).createServerSocket(this.serverPort,
50, null, -1);
     assertFalse(AvailablePort.isPortAvailable(this.serverPort, AvailablePort.SOCKET));
     
     final List<String> jvmArguments = getJvmArguments();
@@ -799,7 +800,7 @@ public class ServerLauncherRemoteIntegrationTest extends AbstractServerLauncherR
     AtomicBoolean outputContainedExpectedString = new AtomicBoolean();
 
     // make serverPort in use
-    this.socket = SocketCreatorFactory.getClusterSSLSocketCreator().createServerSocket(this.serverPort,
50, null, -1);
+    this.socket = SocketCreatorFactory.getSSLSocketCreatorForComponent(SSLEnabledComponent.CLUSTER).createServerSocket(this.serverPort,
50, null, -1);
     assertFalse(AvailablePort.isPortAvailable(this.serverPort, AvailablePort.SOCKET));
     
     // launch server

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/f7424db6/geode-core/src/test/java/com/gemstone/gemfire/distributed/internal/DistributionConfigJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/distributed/internal/DistributionConfigJUnitTest.java
b/geode-core/src/test/java/com/gemstone/gemfire/distributed/internal/DistributionConfigJUnitTest.java
index 7d7ce51..1596935 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/distributed/internal/DistributionConfigJUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/distributed/internal/DistributionConfigJUnitTest.java
@@ -78,7 +78,7 @@ public class DistributionConfigJUnitTest {
   @Test
   public void testGetAttributeNames() {
     String[] attNames = AbstractDistributionConfig._getAttNames();
-    assertEquals(attNames.length, 144);
+    assertEquals(attNames.length, 153);
 
     List boolList = new ArrayList();
     List intList = new ArrayList();
@@ -111,9 +111,9 @@ public class DistributionConfigJUnitTest {
     System.out.println("otherList: " + otherList);
 
     //TODO - This makes no sense. One has no idea what the correct expected number of attributes
are.
-    assertEquals(27, boolList.size());
+    assertEquals(28, boolList.size());
     assertEquals(33, intList.size());
-    assertEquals(75, stringList.size());
+    assertEquals(83, stringList.size());
     assertEquals(5, fileList.size());
     assertEquals(4, otherList.size());
   }
@@ -361,7 +361,6 @@ public class DistributionConfigJUnitTest {
   public void testSSLEnabledComponents() {
     Properties props = new Properties();
     props.put(MCAST_PORT, "0");
-    props.put(CLUSTER_SSL_ENABLED, "true");
     props.put(SSL_ENABLED_COMPONENTS, "all");
 
     DistributionConfig config = new DistributionConfigImpl(props);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/f7424db6/geode-core/src/test/java/com/gemstone/gemfire/distributed/internal/InternalDistributedSystemJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/distributed/internal/InternalDistributedSystemJUnitTest.java
b/geode-core/src/test/java/com/gemstone/gemfire/distributed/internal/InternalDistributedSystemJUnitTest.java
index 800fa84..d285d98 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/distributed/internal/InternalDistributedSystemJUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/distributed/internal/InternalDistributedSystemJUnitTest.java
@@ -34,11 +34,13 @@ import java.util.logging.Level;
 
 import org.junit.After;
 import org.junit.Assert;
+import org.junit.Ignore;
 import org.junit.Rule;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
 import org.junit.rules.ExpectedException;
 
+import com.gemstone.gemfire.GemFireConfigException;
 import com.gemstone.gemfire.distributed.DistributedSystem;
 import com.gemstone.gemfire.distributed.DistributedSystemDisconnectedException;
 import com.gemstone.gemfire.distributed.Locator;
@@ -48,22 +50,6 @@ import com.gemstone.gemfire.internal.ConfigSource;
 import com.gemstone.gemfire.internal.i18n.LocalizedStrings;
 import com.gemstone.gemfire.internal.logging.InternalLogWriter;
 import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
-import org.junit.After;
-import org.junit.Assert;
-import org.junit.Ignore;
-import org.junit.Test;
-import org.junit.experimental.categories.Category;
-
-import java.io.File;
-import java.io.FileWriter;
-import java.net.*;
-import java.util.Collection;
-import java.util.Enumeration;
-import java.util.Properties;
-import java.util.logging.Level;
-
-import static com.gemstone.gemfire.distributed.ConfigurationProperties.*;
-import static org.junit.Assert.*;
 
 /**
  * Tests the functionality of the {@link InternalDistributedSystem}
@@ -706,6 +692,7 @@ public class InternalDistributedSystemJUnitTest
   @Test
   public void testDeprecatedSSLProps() {
     Properties props = getCommonProperties();
+    props.setProperty(CLUSTER_SSL_ENABLED, "true");
     Config config1 = new DistributionConfigImpl(props, false);
     Properties props1 = config1.toProperties();
     // For the deprecated ssl-* properties a decision was made
@@ -734,7 +721,7 @@ public class InternalDistributedSystemJUnitTest
   @Rule
   public ExpectedException illegalArgumentException = ExpectedException.none();
 
-  @Test(expected = IllegalArgumentException.class)
+  @Test(expected = GemFireConfigException.class)
   public void testSSLEnabledComponentsWrongComponentName() {
     Properties props = getCommonProperties();
     props.setProperty(SSL_ENABLED_COMPONENTS, "testing");
@@ -791,7 +778,6 @@ public class InternalDistributedSystemJUnitTest
     Properties props = new Properties();
     props.setProperty(MCAST_PORT, "0");
     props.setProperty(LOCATORS, "");
-    props.setProperty(CLUSTER_SSL_ENABLED, "true");
     return props;
   }
 

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/f7424db6/geode-core/src/test/java/com/gemstone/gemfire/internal/net/JSSESocketJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/net/JSSESocketJUnitTest.java
b/geode-core/src/test/java/com/gemstone/gemfire/internal/net/JSSESocketJUnitTest.java
index bbcce71..36d9f9c 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/net/JSSESocketJUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/net/JSSESocketJUnitTest.java
@@ -125,13 +125,13 @@ public class JSSESocketJUnitTest {
       DistributionConfigImpl distributionConfig = new DistributionConfigImpl(new Properties());
 
       SocketCreatorFactory.setDistributionConfig(distributionConfig);
-      assertTrue(SocketCreatorFactory.getClusterSSLSocketCreator().useSSL());
+      assertTrue(SocketCreatorFactory.getSSLSocketCreatorForComponent(SSLEnabledComponent.CLUSTER).useSSL());
 
-      final ServerSocket serverSocket = SocketCreatorFactory.getClusterSSLSocketCreator().createServerSocket(randport,
0, InetAddress.getByName("localhost"));
+      final ServerSocket serverSocket = SocketCreatorFactory.getSSLSocketCreatorForComponent(SSLEnabledComponent.CLUSTER).createServerSocket(randport,
0, InetAddress.getByName("localhost"));
 
       Thread serverThread = startServer(serverSocket, receiver);
 
-      Socket client = SocketCreatorFactory.getClusterSSLSocketCreator().connectForServer(InetAddress.getByName("localhost"),
randport);
+      Socket client = SocketCreatorFactory.getSSLSocketCreatorForComponent(SSLEnabledComponent.CLUSTER).connectForServer(InetAddress.getByName("localhost"),
randport);
 
       ObjectOutputStream oos = new ObjectOutputStream(client.getOutputStream());
       String expected = new String("testing " + name.getMethodName());
@@ -185,7 +185,7 @@ public class JSSESocketJUnitTest {
     factoryInvoked = false;
     try {
       try {
-        Socket sock = SocketCreatorFactory.getClusterSSLSocketCreator().connectForClient("localhost",
12345, 0);
+        Socket sock = SocketCreatorFactory.getSSLSocketCreatorForComponent(SSLEnabledComponent.CLUSTER).connectForClient("localhost",
12345, 0);
         sock.close();
         fail("socket factory was invoked");
       } catch (IOException e) {
@@ -193,7 +193,7 @@ public class JSSESocketJUnitTest {
       }
     } finally {
       System.getProperties().remove(DistributionConfig.GEMFIRE_PREFIX + "clientSocketFactory");
-      SocketCreatorFactory.getClusterSSLSocketCreator().initializeClientSocketFactory();
+      SocketCreatorFactory.getSSLSocketCreatorForComponent(SSLEnabledComponent.CLUSTER).initializeClientSocketFactory();
     }
   }
 
@@ -221,7 +221,7 @@ public class JSSESocketJUnitTest {
       public void run() {
         try {
           Socket s = serverSocket.accept();
-          SocketCreatorFactory.getClusterSSLSocketCreator().configureServerSSLSocket(s);
+          SocketCreatorFactory.getSSLSocketCreatorForComponent(SSLEnabledComponent.CLUSTER).configureServerSSLSocket(s);
           ObjectInputStream ois = new ObjectInputStream(s.getInputStream());
           receiver[0] = ois.readObject();
           server = s;

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/f7424db6/geode-core/src/test/java/com/gemstone/gemfire/internal/net/SocketCreatorFactoryJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/net/SocketCreatorFactoryJUnitTest.java
b/geode-core/src/test/java/com/gemstone/gemfire/internal/net/SocketCreatorFactoryJUnitTest.java
index a3dd219..ededd6d 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/net/SocketCreatorFactoryJUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/net/SocketCreatorFactoryJUnitTest.java
@@ -53,11 +53,11 @@ public class SocketCreatorFactoryJUnitTest extends JSSESocketJUnitTest
{
     SocketCreatorFactory.setDistributionConfig(distributionConfig);
 
     Assert.assertTrue(SocketCreatorFactory.getSSLSocketCreatorForComponent(SSLEnabledComponent.LOCATOR).useSSL());
-    Assert.assertFalse(SocketCreatorFactory.getClusterSSLSocketCreator().useSSL());
-    Assert.assertFalse(SocketCreatorFactory.getGatewaySSLSocketCreator().useSSL());
-    Assert.assertFalse(SocketCreatorFactory.getJMXManagerSSLSocketCreator().useSSL());
-    Assert.assertFalse(SocketCreatorFactory.getServerSSLSocketCreator().useSSL());
-    Assert.assertFalse(SocketCreatorFactory.getHTTPServiceSSLSocketCreator().useSSL());
+    Assert.assertFalse(SocketCreatorFactory.getSSLSocketCreatorForComponent(SSLEnabledComponent.CLUSTER).useSSL());
+    Assert.assertFalse(SocketCreatorFactory.getSSLSocketCreatorForComponent(SSLEnabledComponent.GATEWAY).useSSL());
+    Assert.assertFalse(SocketCreatorFactory.getSSLSocketCreatorForComponent(SSLEnabledComponent.JMX).useSSL());
+    Assert.assertFalse(SocketCreatorFactory.getSSLSocketCreatorForComponent(SSLEnabledComponent.SERVER).useSSL());
+    Assert.assertFalse(SocketCreatorFactory.getSSLSocketCreatorForComponent(SSLEnabledComponent.HTTP_SERVICE).useSSL());
 
   }
 
@@ -68,12 +68,12 @@ public class SocketCreatorFactoryJUnitTest extends JSSESocketJUnitTest
{
     DistributionConfigImpl distributionConfig = new DistributionConfigImpl(properties);
     SocketCreatorFactory.setDistributionConfig(distributionConfig);
 
-    Assert.assertTrue(SocketCreatorFactory.getClusterSSLSocketCreator().useSSL());
+    Assert.assertTrue(SocketCreatorFactory.getSSLSocketCreatorForComponent(SSLEnabledComponent.CLUSTER).useSSL());
     Assert.assertTrue(SocketCreatorFactory.getSSLSocketCreatorForComponent(SSLEnabledComponent.LOCATOR).useSSL());
-    Assert.assertTrue(SocketCreatorFactory.getGatewaySSLSocketCreator().useSSL());
-    Assert.assertTrue(SocketCreatorFactory.getJMXManagerSSLSocketCreator().useSSL());
-    Assert.assertTrue(SocketCreatorFactory.getServerSSLSocketCreator().useSSL());
-    Assert.assertTrue(SocketCreatorFactory.getHTTPServiceSSLSocketCreator().useSSL());
+    Assert.assertTrue(SocketCreatorFactory.getSSLSocketCreatorForComponent(SSLEnabledComponent.GATEWAY).useSSL());
+    Assert.assertTrue(SocketCreatorFactory.getSSLSocketCreatorForComponent(SSLEnabledComponent.JMX).useSSL());
+    Assert.assertTrue(SocketCreatorFactory.getSSLSocketCreatorForComponent(SSLEnabledComponent.SERVER).useSSL());
+    Assert.assertTrue(SocketCreatorFactory.getSSLSocketCreatorForComponent(SSLEnabledComponent.HTTP_SERVICE).useSSL());
 
   }
 
@@ -84,11 +84,11 @@ public class SocketCreatorFactoryJUnitTest extends JSSESocketJUnitTest
{
     DistributionConfigImpl distributionConfig = new DistributionConfigImpl(properties);
     SocketCreatorFactory.setDistributionConfig(distributionConfig);
 
-    Assert.assertTrue(SocketCreatorFactory.getClusterSSLSocketCreator().useSSL());
-    Assert.assertFalse(SocketCreatorFactory.getGatewaySSLSocketCreator().useSSL());
-    Assert.assertFalse(SocketCreatorFactory.getJMXManagerSSLSocketCreator().useSSL());
-    Assert.assertFalse(SocketCreatorFactory.getServerSSLSocketCreator().useSSL());
-    Assert.assertFalse(SocketCreatorFactory.getHTTPServiceSSLSocketCreator().useSSL());
+    Assert.assertTrue(SocketCreatorFactory.getSSLSocketCreatorForComponent(SSLEnabledComponent.CLUSTER).useSSL());
+    Assert.assertFalse(SocketCreatorFactory.getSSLSocketCreatorForComponent(SSLEnabledComponent.GATEWAY).useSSL());
+    Assert.assertFalse(SocketCreatorFactory.getSSLSocketCreatorForComponent(SSLEnabledComponent.JMX).useSSL());
+    Assert.assertFalse(SocketCreatorFactory.getSSLSocketCreatorForComponent(SSLEnabledComponent.SERVER).useSSL());
+    Assert.assertFalse(SocketCreatorFactory.getSSLSocketCreatorForComponent(SSLEnabledComponent.HTTP_SERVICE).useSSL());
   }
 
   @Test
@@ -98,11 +98,11 @@ public class SocketCreatorFactoryJUnitTest extends JSSESocketJUnitTest
{
     DistributionConfigImpl distributionConfig = new DistributionConfigImpl(properties);
     SocketCreatorFactory.setDistributionConfig(distributionConfig);
 
-    Assert.assertFalse(SocketCreatorFactory.getClusterSSLSocketCreator().useSSL());
-    Assert.assertTrue(SocketCreatorFactory.getGatewaySSLSocketCreator().useSSL());
-    Assert.assertFalse(SocketCreatorFactory.getJMXManagerSSLSocketCreator().useSSL());
-    Assert.assertFalse(SocketCreatorFactory.getServerSSLSocketCreator().useSSL());
-    Assert.assertFalse(SocketCreatorFactory.getHTTPServiceSSLSocketCreator().useSSL());
+    Assert.assertFalse(SocketCreatorFactory.getSSLSocketCreatorForComponent(SSLEnabledComponent.CLUSTER).useSSL());
+    Assert.assertTrue(SocketCreatorFactory.getSSLSocketCreatorForComponent(SSLEnabledComponent.GATEWAY).useSSL());
+    Assert.assertFalse(SocketCreatorFactory.getSSLSocketCreatorForComponent(SSLEnabledComponent.JMX).useSSL());
+    Assert.assertFalse(SocketCreatorFactory.getSSLSocketCreatorForComponent(SSLEnabledComponent.SERVER).useSSL());
+    Assert.assertFalse(SocketCreatorFactory.getSSLSocketCreatorForComponent(SSLEnabledComponent.HTTP_SERVICE).useSSL());
 
   }
 
@@ -113,11 +113,11 @@ public class SocketCreatorFactoryJUnitTest extends JSSESocketJUnitTest
{
     DistributionConfigImpl distributionConfig = new DistributionConfigImpl(properties);
     SocketCreatorFactory.setDistributionConfig(distributionConfig);
 
-    Assert.assertFalse(SocketCreatorFactory.getClusterSSLSocketCreator().useSSL());
-    Assert.assertFalse(SocketCreatorFactory.getGatewaySSLSocketCreator().useSSL());
-    Assert.assertFalse(SocketCreatorFactory.getJMXManagerSSLSocketCreator().useSSL());
-    Assert.assertFalse(SocketCreatorFactory.getServerSSLSocketCreator().useSSL());
-    Assert.assertTrue(SocketCreatorFactory.getHTTPServiceSSLSocketCreator().useSSL());
+    Assert.assertFalse(SocketCreatorFactory.getSSLSocketCreatorForComponent(SSLEnabledComponent.CLUSTER).useSSL());
+    Assert.assertFalse(SocketCreatorFactory.getSSLSocketCreatorForComponent(SSLEnabledComponent.GATEWAY).useSSL());
+    Assert.assertFalse(SocketCreatorFactory.getSSLSocketCreatorForComponent(SSLEnabledComponent.JMX).useSSL());
+    Assert.assertFalse(SocketCreatorFactory.getSSLSocketCreatorForComponent(SSLEnabledComponent.SERVER).useSSL());
+    Assert.assertTrue(SocketCreatorFactory.getSSLSocketCreatorForComponent(SSLEnabledComponent.HTTP_SERVICE).useSSL());
 
   }
 
@@ -128,11 +128,11 @@ public class SocketCreatorFactoryJUnitTest extends JSSESocketJUnitTest
{
     DistributionConfigImpl distributionConfig = new DistributionConfigImpl(properties);
     SocketCreatorFactory.setDistributionConfig(distributionConfig);
 
-    Assert.assertFalse(SocketCreatorFactory.getClusterSSLSocketCreator().useSSL());
-    Assert.assertFalse(SocketCreatorFactory.getGatewaySSLSocketCreator().useSSL());
-    Assert.assertTrue(SocketCreatorFactory.getJMXManagerSSLSocketCreator().useSSL());
-    Assert.assertFalse(SocketCreatorFactory.getServerSSLSocketCreator().useSSL());
-    Assert.assertFalse(SocketCreatorFactory.getHTTPServiceSSLSocketCreator().useSSL());
+    Assert.assertFalse(SocketCreatorFactory.getSSLSocketCreatorForComponent(SSLEnabledComponent.CLUSTER).useSSL());
+    Assert.assertFalse(SocketCreatorFactory.getSSLSocketCreatorForComponent(SSLEnabledComponent.GATEWAY).useSSL());
+    Assert.assertTrue(SocketCreatorFactory.getSSLSocketCreatorForComponent(SSLEnabledComponent.JMX).useSSL());
+    Assert.assertFalse(SocketCreatorFactory.getSSLSocketCreatorForComponent(SSLEnabledComponent.SERVER).useSSL());
+    Assert.assertFalse(SocketCreatorFactory.getSSLSocketCreatorForComponent(SSLEnabledComponent.HTTP_SERVICE).useSSL());
 
   }
 
@@ -144,11 +144,11 @@ public class SocketCreatorFactoryJUnitTest extends JSSESocketJUnitTest
{
 
     SocketCreatorFactory.setDistributionConfig(distributionConfig);
 
-    Assert.assertFalse(SocketCreatorFactory.getClusterSSLSocketCreator().useSSL());
-    Assert.assertFalse(SocketCreatorFactory.getGatewaySSLSocketCreator().useSSL());
-    Assert.assertFalse(SocketCreatorFactory.getJMXManagerSSLSocketCreator().useSSL());
-    Assert.assertTrue(SocketCreatorFactory.getServerSSLSocketCreator().useSSL());
-    Assert.assertFalse(SocketCreatorFactory.getHTTPServiceSSLSocketCreator().useSSL());
+    Assert.assertFalse(SocketCreatorFactory.getSSLSocketCreatorForComponent(SSLEnabledComponent.CLUSTER).useSSL());
+    Assert.assertFalse(SocketCreatorFactory.getSSLSocketCreatorForComponent(SSLEnabledComponent.GATEWAY).useSSL());
+    Assert.assertFalse(SocketCreatorFactory.getSSLSocketCreatorForComponent(SSLEnabledComponent.JMX).useSSL());
+    Assert.assertTrue(SocketCreatorFactory.getSSLSocketCreatorForComponent(SSLEnabledComponent.SERVER).useSSL());
+    Assert.assertFalse(SocketCreatorFactory.getSSLSocketCreatorForComponent(SSLEnabledComponent.HTTP_SERVICE).useSSL());
   }
 
   @Test
@@ -158,11 +158,11 @@ public class SocketCreatorFactoryJUnitTest extends JSSESocketJUnitTest
{
     DistributionConfigImpl distributionConfig = new DistributionConfigImpl(properties);
     SocketCreatorFactory.setDistributionConfig(distributionConfig);
 
-    Assert.assertTrue(SocketCreatorFactory.getClusterSSLSocketCreator().useSSL());
-    Assert.assertFalse(SocketCreatorFactory.getGatewaySSLSocketCreator().useSSL());
-    Assert.assertFalse(SocketCreatorFactory.getJMXManagerSSLSocketCreator().useSSL());
-    Assert.assertTrue(SocketCreatorFactory.getServerSSLSocketCreator().useSSL());
-    Assert.assertFalse(SocketCreatorFactory.getHTTPServiceSSLSocketCreator().useSSL());
+    Assert.assertTrue(SocketCreatorFactory.getSSLSocketCreatorForComponent(SSLEnabledComponent.CLUSTER).useSSL());
+    Assert.assertFalse(SocketCreatorFactory.getSSLSocketCreatorForComponent(SSLEnabledComponent.GATEWAY).useSSL());
+    Assert.assertFalse(SocketCreatorFactory.getSSLSocketCreatorForComponent(SSLEnabledComponent.JMX).useSSL());
+    Assert.assertTrue(SocketCreatorFactory.getSSLSocketCreatorForComponent(SSLEnabledComponent.SERVER).useSSL());
+    Assert.assertFalse(SocketCreatorFactory.getSSLSocketCreatorForComponent(SSLEnabledComponent.HTTP_SERVICE).useSSL());
   }
 
   @Test
@@ -173,11 +173,11 @@ public class SocketCreatorFactoryJUnitTest extends JSSESocketJUnitTest
{
     DistributionConfigImpl distributionConfig = new DistributionConfigImpl(properties);
     SocketCreatorFactory.setDistributionConfig(distributionConfig);
 
-    Assert.assertTrue(SocketCreatorFactory.getClusterSSLSocketCreator().useSSL());
-    Assert.assertFalse(SocketCreatorFactory.getGatewaySSLSocketCreator().useSSL());
-    Assert.assertTrue(SocketCreatorFactory.getJMXManagerSSLSocketCreator().useSSL());
-    Assert.assertTrue(SocketCreatorFactory.getServerSSLSocketCreator().useSSL());
-    Assert.assertTrue(SocketCreatorFactory.getHTTPServiceSSLSocketCreator().useSSL());
+    Assert.assertTrue(SocketCreatorFactory.getSSLSocketCreatorForComponent(SSLEnabledComponent.CLUSTER).useSSL());
+    Assert.assertFalse(SocketCreatorFactory.getSSLSocketCreatorForComponent(SSLEnabledComponent.GATEWAY).useSSL());
+    Assert.assertTrue(SocketCreatorFactory.getSSLSocketCreatorForComponent(SSLEnabledComponent.JMX).useSSL());
+    Assert.assertTrue(SocketCreatorFactory.getSSLSocketCreatorForComponent(SSLEnabledComponent.SERVER).useSSL());
+    Assert.assertTrue(SocketCreatorFactory.getSSLSocketCreatorForComponent(SSLEnabledComponent.HTTP_SERVICE).useSSL());
   }
 
   @Test
@@ -192,12 +192,12 @@ public class SocketCreatorFactoryJUnitTest extends JSSESocketJUnitTest
{
     DistributionConfigImpl distributionConfig = new DistributionConfigImpl(properties);
     SocketCreatorFactory.setDistributionConfig(distributionConfig);
 
-    Assert.assertTrue(SocketCreatorFactory.getClusterSSLSocketCreator().useSSL());
-    Assert.assertTrue(SocketCreatorFactory.getClusterSSLSocketCreator().useSSL());
-    Assert.assertTrue(SocketCreatorFactory.getGatewaySSLSocketCreator().useSSL());
-    Assert.assertTrue(SocketCreatorFactory.getJMXManagerSSLSocketCreator().useSSL());
-    Assert.assertTrue(SocketCreatorFactory.getServerSSLSocketCreator().useSSL());
-    Assert.assertTrue(SocketCreatorFactory.getHTTPServiceSSLSocketCreator().useSSL());
+    Assert.assertTrue(SocketCreatorFactory.getSSLSocketCreatorForComponent(SSLEnabledComponent.CLUSTER).useSSL());
+    Assert.assertTrue(SocketCreatorFactory.getSSLSocketCreatorForComponent(SSLEnabledComponent.CLUSTER).useSSL());
+    Assert.assertTrue(SocketCreatorFactory.getSSLSocketCreatorForComponent(SSLEnabledComponent.GATEWAY).useSSL());
+    Assert.assertTrue(SocketCreatorFactory.getSSLSocketCreatorForComponent(SSLEnabledComponent.JMX).useSSL());
+    Assert.assertTrue(SocketCreatorFactory.getSSLSocketCreatorForComponent(SSLEnabledComponent.SERVER).useSSL());
+    Assert.assertTrue(SocketCreatorFactory.getSSLSocketCreatorForComponent(SSLEnabledComponent.HTTP_SERVICE).useSSL());
   }
 
   private Properties configureSSLProperties(String sslComponents) {
@@ -206,15 +206,14 @@ public class SocketCreatorFactoryJUnitTest extends JSSESocketJUnitTest
{
       File jks = findTestJKS();
 
       properties.setProperty(MCAST_PORT, "0");
-      properties.setProperty(CLUSTER_SSL_ENABLED, "true");
-      properties.setProperty(CLUSTER_SSL_REQUIRE_AUTHENTICATION, "true");
-      properties.setProperty(CLUSTER_SSL_CIPHERS, "any");
-      properties.setProperty(CLUSTER_SSL_PROTOCOLS, "TLSv1.2");
-      properties.setProperty(CLUSTER_SSL_KEYSTORE, jks.getCanonicalPath());
-      properties.setProperty(CLUSTER_SSL_KEYSTORE_PASSWORD, "password");
-      properties.setProperty(CLUSTER_SSL_KEYSTORE_TYPE, "JKS");
-      properties.setProperty(CLUSTER_SSL_TRUSTSTORE, jks.getCanonicalPath());
-      properties.setProperty(CLUSTER_SSL_TRUSTSTORE_PASSWORD, "password");
+      properties.setProperty(SSL_REQUIRE_AUTHENTICATION, "true");
+      properties.setProperty(SSL_CIPHERS, "any");
+      properties.setProperty(SSL_PROTOCOLS, "TLSv1.2");
+      properties.setProperty(SSL_KEYSTORE, jks.getCanonicalPath());
+      properties.setProperty(SSL_KEYSTORE_PASSWORD, "password");
+      properties.setProperty(SSL_KEYSTORE_TYPE, "JKS");
+      properties.setProperty(SSL_TRUSTSTORE, jks.getCanonicalPath());
+      properties.setProperty(SSL_TRUSTSTORE_PASSWORD, "password");
       properties.setProperty(SSL_ENABLED_COMPONENTS, sslComponents);
     } catch (IOException e) {
       Assert.fail("Failed to configure the cluster");

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/f7424db6/geode-core/src/test/java/com/gemstone/gemfire/management/JMXMBeanDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/management/JMXMBeanDUnitTest.java
b/geode-core/src/test/java/com/gemstone/gemfire/management/JMXMBeanDUnitTest.java
index 5fc4b11..4c6bd30 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/management/JMXMBeanDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/management/JMXMBeanDUnitTest.java
@@ -286,18 +286,17 @@ public class JMXMBeanDUnitTest extends DistributedTestCase {
       properties.setProperty(JMX_MANAGER_SSL_TRUSTSTORE_PASSWORD, "password");
     } else {
       {
-        properties.setProperty(CLUSTER_SSL_ENABLED, "true");
-        properties.setProperty(CLUSTER_SSL_CIPHERS, "any");
-        properties.setProperty(CLUSTER_SSL_PROTOCOLS, "any");
-        properties.setProperty(CLUSTER_SSL_KEYSTORE_PASSWORD, "password");
-        properties.setProperty(CLUSTER_SSL_TRUSTSTORE_PASSWORD, "password");
-        properties.setProperty(CLUSTER_SSL_KEYSTORE, getSimpleSingleKeyKeystore());
-        properties.setProperty(CLUSTER_SSL_TRUSTSTORE, getSimpleSingleKeyKeystore());
+        properties.setProperty(SSL_CIPHERS, "any");
+        properties.setProperty(SSL_PROTOCOLS, "any");
+        properties.setProperty(SSL_KEYSTORE_PASSWORD, "password");
+        properties.setProperty(SSL_TRUSTSTORE_PASSWORD, "password");
+        properties.setProperty(SSL_KEYSTORE, getSimpleSingleKeyKeystore());
+        properties.setProperty(SSL_TRUSTSTORE, getSimpleSingleKeyKeystore());
         properties.setProperty(SSL_ENABLED_COMPONENTS, SSLEnabledComponent.JMX.toString());
 
         if (useMultiKey) {
-          properties.setProperty(CLUSTER_SSL_KEYSTORE, getMultiKeyKeystore());
-          properties.setProperty(CLUSTER_SSL_TRUSTSTORE, getMultiKeyTruststore());
+          properties.setProperty(SSL_KEYSTORE, getMultiKeyKeystore());
+          properties.setProperty(SSL_TRUSTSTORE, getMultiKeyTruststore());
           properties.setProperty(JMX_MANAGER_SSL_ALIAS, "jmxkey");
         }
       }


Mime
View raw message