You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@geode.apache.org by kl...@apache.org on 2016/05/25 22:27:33 UTC

[11/34] incubator-geode git commit: GEODE-1367: Cleaned up some more code.

GEODE-1367: Cleaned up some more code.


Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/0b3686ff
Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/0b3686ff
Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/0b3686ff

Branch: refs/heads/feature/GEODE-835
Commit: 0b3686ff92cabf5067c7cf32a87464215d0cf952
Parents: 0ff390a
Author: Udo Kohlmeyer <uk...@pivotal.io>
Authored: Thu May 19 07:59:58 2016 +1000
Committer: Udo Kohlmeyer <uk...@pivotal.io>
Committed: Tue May 24 03:37:40 2016 +1000

----------------------------------------------------------------------
 .../controllers/RestAPIsWithSSLDUnitTest.java   | 24 ++++++++++----------
 1 file changed, 12 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/0b3686ff/geode-assembly/src/test/java/com/gemstone/gemfire/rest/internal/web/controllers/RestAPIsWithSSLDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-assembly/src/test/java/com/gemstone/gemfire/rest/internal/web/controllers/RestAPIsWithSSLDUnitTest.java b/geode-assembly/src/test/java/com/gemstone/gemfire/rest/internal/web/controllers/RestAPIsWithSSLDUnitTest.java
index 50fb0df..7b006d7 100644
--- a/geode-assembly/src/test/java/com/gemstone/gemfire/rest/internal/web/controllers/RestAPIsWithSSLDUnitTest.java
+++ b/geode-assembly/src/test/java/com/gemstone/gemfire/rest/internal/web/controllers/RestAPIsWithSSLDUnitTest.java
@@ -68,7 +68,6 @@ public class RestAPIsWithSSLDUnitTest extends LocatorTestBase {
   public RestAPIsWithSSLDUnitTest(String name) {
     super(name);
     this.jks = findTrustedJKS();
-
   }
 
   @Override
@@ -170,7 +169,9 @@ public class RestAPIsWithSSLDUnitTest extends LocatorTestBase {
     final int locatorPort = AvailablePort.getRandomAvailablePort(AvailablePort.SOCKET);
     final String locatorHostName = NetworkUtils.getServerHostName(locator.getHost());
 
-    locator.invoke("Start Locator", () -> startLocator(locatorHostName, locatorPort, ""));
+    locator.invoke("Start Locator", () -> {
+      startLocator(locatorHostName, locatorPort, "");
+    });
 
     // find locators
     String locators = locatorHostName + "[" + locatorPort + "]";
@@ -222,18 +223,19 @@ public class RestAPIsWithSSLDUnitTest extends LocatorTestBase {
     client.invoke(()-> closeCache());
   }
 
-  private void closeCache() {
-    Cache cache = CacheFactory.getAnyInstance();
+  private void closeCache()
+  {
+    GemFireCacheImpl cache = GemFireCacheImpl.getInstance();
     if (cache != null && !cache.isClosed()) {
       cache.close();
       cache.getDistributedSystem().disconnect();
     }
   }
 
-  private void sslPropertyConverter(Properties oldProperties, Properties newProperties, String oldPropertyName, String newPropertyName) {
-    String oldProperty = oldProperties.getProperty(oldPropertyName);
-    if (oldProperty != null) {
-      newProperties.setProperty((newPropertyName != null ? newPropertyName : oldPropertyName), oldProperty);
+  private void sslPropertyConverter(Properties properties, Properties newProperties, String propertyName, String newPropertyName) {
+    String property = properties.getProperty(propertyName);
+    if (property != null) {
+      newProperties.setProperty((newPropertyName != null ? newPropertyName : propertyName), property);
     }
   }
 
@@ -274,16 +276,14 @@ public class RestAPIsWithSSLDUnitTest extends LocatorTestBase {
     props.setProperty(DistributionConfig.LOCATORS_NAME, locators);
     props.setProperty("jmx-manager", "true");
     props.setProperty("jmx-manager-start", "true");
-    props.setProperty("http-service-port", "7070");
-    props.setProperty("jmx-manager-port", "1099");
 
     Cache cache = null;
     configureSSL(props, sslProperties, false);
     while (true) {
       try {
         DistributedSystem ds = getSystem(props);
-        System.out.println("Creating cache with http-service-port " + props.getProperty("http-service-port")
-            + " and jmx-manager-port " + props.getProperty("jmx-manager-port"));
+        System.out.println("Creating cache with http-service-port " + props.getProperty("http-service-port", "7070")
+            + " and jmx-manager-port " + props.getProperty("jmx-manager-port", "1099"));
         cache = CacheFactory.create(ds);
         System.out.println("Successfully created cache.");
         break;