Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 1142C200B40 for ; Thu, 2 Jun 2016 02:08:23 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 1010D160A4F; Thu, 2 Jun 2016 00:08:23 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id BF7A1160A4E for ; Thu, 2 Jun 2016 02:08:20 +0200 (CEST) Received: (qmail 14566 invoked by uid 500); 2 Jun 2016 00:08:19 -0000 Mailing-List: contact commits-help@geode.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@geode.incubator.apache.org Delivered-To: mailing list commits@geode.incubator.apache.org Received: (qmail 14557 invoked by uid 99); 2 Jun 2016 00:08:19 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 02 Jun 2016 00:08:19 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id 48C22C0771 for ; Thu, 2 Jun 2016 00:08:19 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -4.646 X-Spam-Level: X-Spam-Status: No, score=-4.646 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, KAM_LAZY_DOMAIN_SECURITY=1, RCVD_IN_DNSWL_HI=-5, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RP_MATCHES_RCVD=-1.426] autolearn=disabled Received: from mx2-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id 8QCGS2wtwP-s for ; Thu, 2 Jun 2016 00:07:55 +0000 (UTC) Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx2-lw-eu.apache.org (ASF Mail Server at mx2-lw-eu.apache.org) with SMTP id 28C6460D0C for ; Thu, 2 Jun 2016 00:07:48 +0000 (UTC) Received: (qmail 5778 invoked by uid 99); 2 Jun 2016 00:07:47 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 02 Jun 2016 00:07:47 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id D808AE974B; Thu, 2 Jun 2016 00:07:47 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: udo@apache.org To: commits@geode.incubator.apache.org Date: Thu, 02 Jun 2016 00:08:03 -0000 Message-Id: <115d501afb3b48c3a87c1f5b9ca7d843@git.apache.org> In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [17/67] [abbrv] incubator-geode git commit: GEODE-1377: Initial move of system properties from private to public archived-at: Thu, 02 Jun 2016 00:08:23 -0000 http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/70612010/geode-core/src/test/java/com/gemstone/gemfire/internal/SSLConfigJUnitTest.java ---------------------------------------------------------------------- diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/SSLConfigJUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/SSLConfigJUnitTest.java index 543574a..59ec773 100755 --- a/geode-core/src/test/java/com/gemstone/gemfire/internal/SSLConfigJUnitTest.java +++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/SSLConfigJUnitTest.java @@ -16,21 +16,20 @@ */ package com.gemstone.gemfire.internal; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; +import com.gemstone.gemfire.distributed.internal.DistributionConfig; +import com.gemstone.gemfire.distributed.internal.DistributionConfigImpl; +import com.gemstone.gemfire.test.junit.categories.IntegrationTest; +import junit.framework.AssertionFailedError; +import org.junit.Test; +import org.junit.experimental.categories.Category; import java.util.Map.Entry; import java.util.Properties; import java.util.Set; -import junit.framework.AssertionFailedError; - -import org.junit.Test; -import org.junit.experimental.categories.Category; - -import com.gemstone.gemfire.distributed.internal.DistributionConfig; -import com.gemstone.gemfire.distributed.internal.DistributionConfigImpl; -import com.gemstone.gemfire.test.junit.categories.IntegrationTest; +import static com.gemstone.gemfire.distributed.SystemConfigurationProperties.MCAST_PORT; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; /** * Test that DistributionConfigImpl handles SSL options correctly. @@ -59,48 +58,48 @@ public class SSLConfigJUnitTest { SSL_PROPS_MAP.put("javax.net.ssl.trustStorePassword", "gemfire-trust-password"); // SSL Properties for GemFire in-cluster connections - CLUSTER_SSL_PROPS_MAP.put("cluster-ssl-keystore-type", "jks"); - CLUSTER_SSL_PROPS_MAP.put("cluster-ssl-keystore", "/export/gemfire-configs/gemfire.keystore"); - CLUSTER_SSL_PROPS_MAP.put("cluster-ssl-keystore-password", "gemfire-key-password"); - CLUSTER_SSL_PROPS_MAP.put("cluster-ssl-truststore", "/export/gemfire-configs/gemfire.truststore"); - CLUSTER_SSL_PROPS_MAP.put("cluster-ssl-truststore-password", "gemfire-trust-password"); + CLUSTER_SSL_PROPS_MAP.put(DistributionConfig.CLUSTER_SSL_KEYSTORE_TYPE_NAME, "jks"); + CLUSTER_SSL_PROPS_MAP.put(DistributionConfig.CLUSTER_SSL_KEYSTORE_NAME, "/export/gemfire-configs/gemfire.keystore"); + CLUSTER_SSL_PROPS_MAP.put(DistributionConfig.CLUSTER_SSL_KEYSTORE_PASSWORD_NAME, "gemfire-key-password"); + CLUSTER_SSL_PROPS_MAP.put(DistributionConfig.CLUSTER_SSL_TRUSTSTORE_NAME, "/export/gemfire-configs/gemfire.truststore"); + CLUSTER_SSL_PROPS_MAP.put(DistributionConfig.CLUSTER_SSL_TRUSTSTORE_PASSWORD_NAME, "gemfire-trust-password"); // Partially over-ridden SSL Properties for cluster - CLUSTER_SSL_PROPS_SUBSET_MAP.put("cluster-ssl-keystore", "/export/gemfire-configs/gemfire.keystore"); - CLUSTER_SSL_PROPS_SUBSET_MAP.put("cluster-ssl-truststore", "/export/gemfire-configs/gemfire.truststore"); + CLUSTER_SSL_PROPS_SUBSET_MAP.put(DistributionConfig.CLUSTER_SSL_KEYSTORE_NAME, "/export/gemfire-configs/gemfire.keystore"); + CLUSTER_SSL_PROPS_SUBSET_MAP.put(DistributionConfig.CLUSTER_SSL_TRUSTSTORE_NAME, "/export/gemfire-configs/gemfire.truststore"); // SSL Properties for GemFire JMX Manager connections - JMX_SSL_PROPS_MAP.put("jmx-manager-ssl-keystore-type", "jks"); - JMX_SSL_PROPS_MAP.put("jmx-manager-ssl-keystore", "/export/gemfire-configs/manager.keystore"); - JMX_SSL_PROPS_MAP.put("jmx-manager-ssl-keystore-password", "manager-key-password"); - JMX_SSL_PROPS_MAP.put("jmx-manager-ssl-truststore", "/export/gemfire-configs/manager.truststore"); - JMX_SSL_PROPS_MAP.put("jmx-manager-ssl-truststore-password", "manager-trust-password"); + JMX_SSL_PROPS_MAP.put(DistributionConfig.JMX_MANAGER_SSL_KEYSTORE_TYPE_NAME, "jks"); + JMX_SSL_PROPS_MAP.put(DistributionConfig.JMX_MANAGER_SSL_KEYSTORE_NAME, "/export/gemfire-configs/manager.keystore"); + JMX_SSL_PROPS_MAP.put(DistributionConfig.JMX_MANAGER_SSL_KEYSTORE_PASSWORD_NAME, "manager-key-password"); + JMX_SSL_PROPS_MAP.put(DistributionConfig.JMX_MANAGER_SSL_TRUSTSTORE_NAME, "/export/gemfire-configs/manager.truststore"); + JMX_SSL_PROPS_MAP.put(DistributionConfig.JMX_MANAGER_SSL_TRUSTSTORE_PASSWORD_NAME, "manager-trust-password"); // SSL Properties for GemFire CacheServer connections - SERVER_SSL_PROPS_MAP.put("server-ssl-keystore-type", "jks"); - SERVER_SSL_PROPS_MAP.put("server-ssl-keystore", "/export/gemfire-configs/cacheserver.keystore"); - SERVER_SSL_PROPS_MAP.put("server-ssl-keystore-password", "cacheserver-key-password"); - SERVER_SSL_PROPS_MAP.put("server-ssl-truststore", "/export/gemfire-configs/cacheserver.truststore"); - SERVER_SSL_PROPS_MAP.put("server-ssl-truststore-password", "cacheserver-trust-password"); + SERVER_SSL_PROPS_MAP.put(DistributionConfig.SERVER_SSL_KEYSTORE_TYPE_NAME, "jks"); + SERVER_SSL_PROPS_MAP.put(DistributionConfig.SERVER_SSL_KEYSTORE_NAME, "/export/gemfire-configs/cacheserver.keystore"); + SERVER_SSL_PROPS_MAP.put(DistributionConfig.SERVER_SSL_KEYSTORE_PASSWORD_NAME, "cacheserver-key-password"); + SERVER_SSL_PROPS_MAP.put(DistributionConfig.SERVER_SSL_TRUSTSTORE_NAME, "/export/gemfire-configs/cacheserver.truststore"); + SERVER_SSL_PROPS_MAP.put(DistributionConfig.SERVER_SSL_TRUSTSTORE_PASSWORD_NAME, "cacheserver-trust-password"); // SSL Properties for GemFire gateway connections - GATEWAY_SSL_PROPS_MAP.put("gateway-ssl-keystore-type", "jks"); - GATEWAY_SSL_PROPS_MAP.put("gateway-ssl-keystore", "/export/gemfire-configs/gateway.keystore"); - GATEWAY_SSL_PROPS_MAP.put("gateway-ssl-keystore-password", "gateway-key-password"); - GATEWAY_SSL_PROPS_MAP.put("gateway-ssl-truststore", "/export/gemfire-configs/gateway.truststore"); - GATEWAY_SSL_PROPS_MAP.put("gateway-ssl-truststore-password", "gateway-trust-password"); + GATEWAY_SSL_PROPS_MAP.put(DistributionConfig.GATEWAY_SSL_KEYSTORE_TYPE_NAME, "jks"); + GATEWAY_SSL_PROPS_MAP.put(DistributionConfig.GATEWAY_SSL_KEYSTORE_NAME, "/export/gemfire-configs/gateway.keystore"); + GATEWAY_SSL_PROPS_MAP.put(DistributionConfig.GATEWAY_SSL_KEYSTORE_PASSWORD_NAME, "gateway-key-password"); + GATEWAY_SSL_PROPS_MAP.put(DistributionConfig.GATEWAY_SSL_TRUSTSTORE_NAME, "/export/gemfire-configs/gateway.truststore"); + GATEWAY_SSL_PROPS_MAP.put(DistributionConfig.GATEWAY_SSL_TRUSTSTORE_PASSWORD_NAME, "gateway-trust-password"); // Partially over-ridden SSL Properties for GemFire JMX Manager connections - JMX_SSL_PROPS_SUBSET_MAP.put("jmx-manager-ssl-keystore", "/export/gemfire-configs/manager.keystore"); - JMX_SSL_PROPS_SUBSET_MAP.put("jmx-manager-ssl-truststore", "/export/gemfire-configs/manager.truststore"); + JMX_SSL_PROPS_SUBSET_MAP.put(DistributionConfig.JMX_MANAGER_SSL_KEYSTORE_NAME, "/export/gemfire-configs/manager.keystore"); + JMX_SSL_PROPS_SUBSET_MAP.put(DistributionConfig.JMX_MANAGER_SSL_TRUSTSTORE_NAME, "/export/gemfire-configs/manager.truststore"); // Partially over-ridden SSL Properties for GemFire JMX Manager connections - SERVER_PROPS_SUBSET_MAP.put("server-ssl-keystore", "/export/gemfire-configs/cacheserver.keystore"); - SERVER_PROPS_SUBSET_MAP.put("server-ssl-truststore", "/export/gemfire-configs/cacheserver.truststore"); + SERVER_PROPS_SUBSET_MAP.put(DistributionConfig.SERVER_SSL_KEYSTORE_NAME, "/export/gemfire-configs/cacheserver.keystore"); + SERVER_PROPS_SUBSET_MAP.put(DistributionConfig.SERVER_SSL_TRUSTSTORE_NAME, "/export/gemfire-configs/cacheserver.truststore"); // Partially over-ridden SSL Properties for GemFire JMX Manager connections - GATEWAY_PROPS_SUBSET_MAP.put("gateway-ssl-keystore", "/export/gemfire-configs/gateway.keystore"); - GATEWAY_PROPS_SUBSET_MAP.put("gateway-ssl-truststore", "/export/gemfire-configs/gateway.truststore"); + GATEWAY_PROPS_SUBSET_MAP.put(DistributionConfig.GATEWAY_SSL_KEYSTORE_NAME, "/export/gemfire-configs/gateway.keystore"); + GATEWAY_PROPS_SUBSET_MAP.put(DistributionConfig.GATEWAY_SSL_TRUSTSTORE_NAME, "/export/gemfire-configs/gateway.truststore"); } @@ -110,7 +109,7 @@ public class SSLConfigJUnitTest { public void testMCastPortWithSSL() throws Exception { Properties props = new Properties( ); // default mcast-port is not 0. - props.setProperty( "ssl-enabled", "true" ); + props.setProperty(DistributionConfig.SSL_ENABLED_NAME, "true"); try { new DistributionConfigImpl( props ); @@ -119,8 +118,8 @@ public class SSLConfigJUnitTest { throw new Exception( "did not get expected exception, got this instead...", e ); } } - - props.setProperty( "mcast-port", "0" ); + + props.setProperty(MCAST_PORT, "0"); new DistributionConfigImpl( props ); } @@ -128,7 +127,7 @@ public class SSLConfigJUnitTest { public void testMCastPortWithClusterSSL() throws Exception { Properties props = new Properties( ); // default mcast-port is not 0. - props.setProperty( "cluster-ssl-enabled", "true" ); + props.setProperty(DistributionConfig.CLUSTER_SSL_ENABLED_NAME, "true"); try { new DistributionConfigImpl( props ); @@ -137,8 +136,8 @@ public class SSLConfigJUnitTest { throw new Exception( "did not get expected exception, got this instead...", e ); } } - - props.setProperty( "mcast-port", "0" ); + + props.setProperty(MCAST_PORT, "0"); new DistributionConfigImpl( props ); } @@ -157,7 +156,7 @@ public class SSLConfigJUnitTest { Properties props = new Properties(); sslciphers = "RSA_WITH_GARBAGE"; - props.setProperty("ssl-ciphers", sslciphers ); + props.setProperty(DistributionConfig.SSL_CIPHERS_NAME, sslciphers); config = new DistributionConfigImpl( props ); isEqual( config.getSSLEnabled(), sslenabled ); @@ -166,7 +165,7 @@ public class SSLConfigJUnitTest { isEqual( config.getSSLRequireAuthentication(), requireAuth ); sslprotocols = "SSLv7"; - props.setProperty("ssl-protocols", sslprotocols ); + props.setProperty(DistributionConfig.SSL_PROTOCOLS_NAME, sslprotocols); config = new DistributionConfigImpl( props ); isEqual( config.getSSLEnabled(), sslenabled ); @@ -175,7 +174,7 @@ public class SSLConfigJUnitTest { isEqual( config.getSSLRequireAuthentication(), requireAuth ); requireAuth = false; - props.setProperty("ssl-require-authentication", String.valueOf( requireAuth ) ); + props.setProperty(DistributionConfig.SSL_REQUIRE_AUTHENTICATION_NAME, String.valueOf(requireAuth)); config = new DistributionConfigImpl( props ); isEqual( config.getSSLEnabled(), sslenabled ); @@ -184,8 +183,8 @@ public class SSLConfigJUnitTest { isEqual( config.getSSLRequireAuthentication(), requireAuth ); sslenabled = true; - props.setProperty("ssl-enabled", String.valueOf( sslenabled ) ); - props.setProperty("mcast-port", "0" ); + props.setProperty(DistributionConfig.SSL_ENABLED_NAME, String.valueOf(sslenabled)); + props.setProperty(MCAST_PORT, "0"); config = new DistributionConfigImpl( props ); isEqual( config.getSSLEnabled(), sslenabled ); @@ -215,7 +214,7 @@ public class SSLConfigJUnitTest { Properties props = new Properties(); sslciphers = "RSA_WITH_GARBAGE"; - props.setProperty("cluster-ssl-ciphers", sslciphers ); + props.setProperty(DistributionConfig.CLUSTER_SSL_CIPHERS_NAME, sslciphers); config = new DistributionConfigImpl( props ); isEqual( config.getClusterSSLEnabled(), sslenabled ); @@ -224,7 +223,7 @@ public class SSLConfigJUnitTest { isEqual( config.getClusterSSLRequireAuthentication(), requireAuth ); sslprotocols = "SSLv7"; - props.setProperty("cluster-ssl-protocols", sslprotocols ); + props.setProperty(DistributionConfig.CLUSTER_SSL_PROTOCOLS_NAME, sslprotocols); config = new DistributionConfigImpl( props ); isEqual( config.getClusterSSLEnabled(), sslenabled ); @@ -233,7 +232,7 @@ public class SSLConfigJUnitTest { isEqual( config.getClusterSSLRequireAuthentication(), requireAuth ); requireAuth = false; - props.setProperty("cluster-ssl-require-authentication", String.valueOf( requireAuth ) ); + props.setProperty(DistributionConfig.CLUSTER_SSL_REQUIRE_AUTHENTICATION_NAME, String.valueOf(requireAuth)); config = new DistributionConfigImpl( props ); isEqual( config.getClusterSSLEnabled(), sslenabled ); @@ -242,8 +241,8 @@ public class SSLConfigJUnitTest { isEqual( config.getClusterSSLRequireAuthentication(), requireAuth ); sslenabled = true; - props.setProperty("cluster-ssl-enabled", String.valueOf( sslenabled ) ); - props.setProperty("mcast-port", "0" ); + props.setProperty(DistributionConfig.CLUSTER_SSL_ENABLED_NAME, String.valueOf(sslenabled)); + props.setProperty(MCAST_PORT, "0"); config = new DistributionConfigImpl( props ); isEqual( config.getClusterSSLEnabled(), sslenabled ); @@ -469,7 +468,7 @@ public class SSLConfigJUnitTest { //sslEnabled and clusterSSLEnabled set at the same time Properties gemFireProps = new Properties(); - gemFireProps.setProperty( "mcast-port", "0" ); + gemFireProps.setProperty(MCAST_PORT, "0"); gemFireProps.put(DistributionConfig.SSL_ENABLED_NAME, "true"); gemFireProps.put(DistributionConfig.CLUSTER_SSL_ENABLED_NAME, "false"); DistributionConfigImpl config = null; @@ -484,7 +483,7 @@ public class SSLConfigJUnitTest { //ssl-protocol and cluster-ssl-protocol set at the same time gemFireProps = new Properties(); - gemFireProps.setProperty( "mcast-port", "0" ); + gemFireProps.setProperty(MCAST_PORT, "0"); gemFireProps.put(DistributionConfig.SSL_ENABLED_NAME, "true"); gemFireProps.put(DistributionConfig.SSL_PROTOCOLS_NAME, sslprotocols); gemFireProps.put(DistributionConfig.CLUSTER_SSL_ENABLED_NAME, "true"); @@ -500,7 +499,7 @@ public class SSLConfigJUnitTest { //ssl-protocol and cluster-ssl-protocol set at the same time with same value gemFireProps = new Properties(); - gemFireProps.setProperty( "mcast-port", "0" ); + gemFireProps.setProperty(MCAST_PORT, "0"); gemFireProps.put(DistributionConfig.SSL_ENABLED_NAME, "true"); gemFireProps.put(DistributionConfig.SSL_PROTOCOLS_NAME, sslprotocols); gemFireProps.put(DistributionConfig.CLUSTER_SSL_ENABLED_NAME, "true"); @@ -513,7 +512,7 @@ public class SSLConfigJUnitTest { //ssl-cipher and cluster-ssl-cipher set at the same time gemFireProps = new Properties(); - gemFireProps.setProperty( "mcast-port", "0" ); + gemFireProps.setProperty(MCAST_PORT, "0"); gemFireProps.put(DistributionConfig.SSL_ENABLED_NAME, "true"); gemFireProps.put(DistributionConfig.SSL_CIPHERS_NAME, sslciphers); gemFireProps.put(DistributionConfig.CLUSTER_SSL_ENABLED_NAME, "true"); @@ -529,7 +528,7 @@ public class SSLConfigJUnitTest { //ssl-cipher and cluster-ssl-cipher set at the same time with same value gemFireProps = new Properties(); - gemFireProps.setProperty( "mcast-port", "0" ); + gemFireProps.setProperty(MCAST_PORT, "0"); gemFireProps.put(DistributionConfig.SSL_ENABLED_NAME, "true"); gemFireProps.put(DistributionConfig.SSL_CIPHERS_NAME, sslciphers); gemFireProps.put(DistributionConfig.CLUSTER_SSL_ENABLED_NAME, "true"); @@ -542,7 +541,7 @@ public class SSLConfigJUnitTest { //ssl-require-authentication and cluster-ssl-require-authentication set at the same time gemFireProps = new Properties(); - gemFireProps.setProperty( "mcast-port", "0" ); + gemFireProps.setProperty(MCAST_PORT, "0"); gemFireProps.put(DistributionConfig.SSL_ENABLED_NAME, "true"); gemFireProps.put(DistributionConfig.SSL_REQUIRE_AUTHENTICATION_NAME, "true"); gemFireProps.put(DistributionConfig.CLUSTER_SSL_ENABLED_NAME, "true"); @@ -558,7 +557,7 @@ public class SSLConfigJUnitTest { //ssl-require-authentication and cluster-ssl-require-authentication set at the same time and have the same value gemFireProps = new Properties(); - gemFireProps.setProperty( "mcast-port", "0" ); + gemFireProps.setProperty(MCAST_PORT, "0"); gemFireProps.put(DistributionConfig.SSL_ENABLED_NAME, "true"); gemFireProps.put(DistributionConfig.SSL_REQUIRE_AUTHENTICATION_NAME, "true"); gemFireProps.put(DistributionConfig.CLUSTER_SSL_ENABLED_NAME, "true"); @@ -571,7 +570,7 @@ public class SSLConfigJUnitTest { // only ssl-* properties provided. same should reflect in cluster-ssl properties gemFireProps = new Properties(); - gemFireProps.setProperty("mcast-port", "0"); + gemFireProps.setProperty(MCAST_PORT, "0"); gemFireProps.put(DistributionConfig.SSL_ENABLED_NAME, String.valueOf(sslenabled)); gemFireProps.put(DistributionConfig.SSL_REQUIRE_AUTHENTICATION_NAME, String.valueOf(requireAuth)); gemFireProps.put(DistributionConfig.SSL_CIPHERS_NAME, sslciphers); @@ -599,7 +598,7 @@ public class SSLConfigJUnitTest { //only clutser-ssl-properties provided. gemFireProps = new Properties(); - gemFireProps.setProperty("mcast-port", "0"); + gemFireProps.setProperty(MCAST_PORT, "0"); gemFireProps.put(DistributionConfig.CLUSTER_SSL_ENABLED_NAME, String.valueOf(clusterSslenabled)); gemFireProps.put(DistributionConfig.CLUSTER_SSL_REQUIRE_AUTHENTICATION_NAME, String.valueOf(clusterSslRequireAuth)); gemFireProps.put(DistributionConfig.CLUSTER_SSL_CIPHERS_NAME, clusterSslciphers); @@ -613,12 +612,12 @@ public class SSLConfigJUnitTest { isEqual(clusterSslprotocols, config.getClusterSSLProtocols()); isEqual(clusterSslciphers, config.getClusterSSLCiphers()); isEqual(clusterSslRequireAuth, config.getClusterSSLRequireAuthentication()); - - isEqual( CLUSTER_SSL_PROPS_MAP.get("cluster-ssl-keystore"), config.getClusterSSLKeyStore() ); - isEqual( CLUSTER_SSL_PROPS_MAP.get("cluster-ssl-keystore-type"), config.getClusterSSLKeyStoreType()); - isEqual( CLUSTER_SSL_PROPS_MAP.get("cluster-ssl-keystore-password"), config.getClusterSSLKeyStorePassword()); - isEqual( CLUSTER_SSL_PROPS_MAP.get("cluster-ssl-truststore"), config.getClusterSSLTrustStore()); - isEqual( CLUSTER_SSL_PROPS_MAP.get("cluster-ssl-truststore-password"), config.getClusterSSLTrustStorePassword()); + + isEqual(CLUSTER_SSL_PROPS_MAP.get(DistributionConfig.CLUSTER_SSL_KEYSTORE_NAME), config.getClusterSSLKeyStore()); + isEqual(CLUSTER_SSL_PROPS_MAP.get(DistributionConfig.CLUSTER_SSL_KEYSTORE_TYPE_NAME), config.getClusterSSLKeyStoreType()); + isEqual(CLUSTER_SSL_PROPS_MAP.get(DistributionConfig.CLUSTER_SSL_KEYSTORE_PASSWORD_NAME), config.getClusterSSLKeyStorePassword()); + isEqual(CLUSTER_SSL_PROPS_MAP.get(DistributionConfig.CLUSTER_SSL_TRUSTSTORE_NAME), config.getClusterSSLTrustStore()); + isEqual(CLUSTER_SSL_PROPS_MAP.get(DistributionConfig.CLUSTER_SSL_TRUSTSTORE_PASSWORD_NAME), config.getClusterSSLTrustStorePassword()); clusterSSLProperties = config.getClusterSSLProperties(); isEqual( SSL_PROPS_MAP, clusterSSLProperties ); @@ -661,11 +660,11 @@ public class SSLConfigJUnitTest { isEqual( config.getJmxManagerSSLCiphers(), jmxManagerSslciphers ); isEqual( config.getJmxManagerSSLRequireAuthentication(), jmxManagerSslRequireAuth ); - isEqual( JMX_SSL_PROPS_MAP.get("jmx-manager-ssl-keystore") , config.getJmxManagerSSLKeyStore()); - isEqual( JMX_SSL_PROPS_MAP.get("jmx-manager-ssl-keystore-type"), config.getJmxManagerSSLKeyStoreType()); - isEqual( JMX_SSL_PROPS_MAP.get("jmx-manager-ssl-keystore-password"), config.getJmxManagerSSLKeyStorePassword()); - isEqual( JMX_SSL_PROPS_MAP.get("jmx-manager-ssl-truststore"), config.getJmxManagerSSLTrustStore()); - isEqual( JMX_SSL_PROPS_MAP.get("jmx-manager-ssl-truststore-password"),config.getJmxManagerSSLTrustStorePassword()); + isEqual(JMX_SSL_PROPS_MAP.get(DistributionConfig.JMX_MANAGER_SSL_KEYSTORE_NAME), config.getJmxManagerSSLKeyStore()); + isEqual(JMX_SSL_PROPS_MAP.get(DistributionConfig.JMX_MANAGER_SSL_KEYSTORE_TYPE_NAME), config.getJmxManagerSSLKeyStoreType()); + isEqual(JMX_SSL_PROPS_MAP.get(DistributionConfig.JMX_MANAGER_SSL_KEYSTORE_PASSWORD_NAME), config.getJmxManagerSSLKeyStorePassword()); + isEqual(JMX_SSL_PROPS_MAP.get(DistributionConfig.JMX_MANAGER_SSL_TRUSTSTORE_NAME), config.getJmxManagerSSLTrustStore()); + isEqual(JMX_SSL_PROPS_MAP.get(DistributionConfig.JMX_MANAGER_SSL_TRUSTSTORE_PASSWORD_NAME), config.getJmxManagerSSLTrustStorePassword()); } @Test @@ -704,11 +703,11 @@ public class SSLConfigJUnitTest { isEqual( config.getServerSSLCiphers(), cacheServerSslciphers ); isEqual( config.getServerSSLRequireAuthentication(), cacheServerSslRequireAuth ); - isEqual( SERVER_SSL_PROPS_MAP.get("server-ssl-keystore") , config.getServerSSLKeyStore()); - isEqual( SERVER_SSL_PROPS_MAP.get("server-ssl-keystore-type"), config.getServerSSLKeyStoreType()); - isEqual( SERVER_SSL_PROPS_MAP.get("server-ssl-keystore-password"), config.getServerSSLKeyStorePassword()); - isEqual( SERVER_SSL_PROPS_MAP.get("server-ssl-truststore"), config.getServerSSLTrustStore()); - isEqual( SERVER_SSL_PROPS_MAP.get("server-ssl-truststore-password"),config.getServerSSLTrustStorePassword()); + isEqual(SERVER_SSL_PROPS_MAP.get(DistributionConfig.SERVER_SSL_KEYSTORE_NAME), config.getServerSSLKeyStore()); + isEqual(SERVER_SSL_PROPS_MAP.get(DistributionConfig.SERVER_SSL_KEYSTORE_TYPE_NAME), config.getServerSSLKeyStoreType()); + isEqual(SERVER_SSL_PROPS_MAP.get(DistributionConfig.SERVER_SSL_KEYSTORE_PASSWORD_NAME), config.getServerSSLKeyStorePassword()); + isEqual(SERVER_SSL_PROPS_MAP.get(DistributionConfig.SERVER_SSL_TRUSTSTORE_NAME), config.getServerSSLTrustStore()); + isEqual(SERVER_SSL_PROPS_MAP.get(DistributionConfig.SERVER_SSL_TRUSTSTORE_PASSWORD_NAME), config.getServerSSLTrustStorePassword()); } @Test @@ -747,11 +746,11 @@ public class SSLConfigJUnitTest { isEqual( config.getGatewaySSLCiphers(), gatewaySslciphers ); isEqual( config.getGatewaySSLRequireAuthentication(), gatewaySslRequireAuth ); - isEqual( GATEWAY_SSL_PROPS_MAP.get("gateway-ssl-keystore") , config.getGatewaySSLKeyStore()); - isEqual( GATEWAY_SSL_PROPS_MAP.get("gateway-ssl-keystore-type"), config.getGatewaySSLKeyStoreType()); - isEqual( GATEWAY_SSL_PROPS_MAP.get("gateway-ssl-keystore-password"), config.getGatewaySSLKeyStorePassword()); - isEqual( GATEWAY_SSL_PROPS_MAP.get("gateway-ssl-truststore"), config.getGatewaySSLTrustStore()); - isEqual( GATEWAY_SSL_PROPS_MAP.get("gateway-ssl-truststore-password"),config.getGatewaySSLTrustStorePassword()); + isEqual(GATEWAY_SSL_PROPS_MAP.get(DistributionConfig.GATEWAY_SSL_KEYSTORE_NAME), config.getGatewaySSLKeyStore()); + isEqual(GATEWAY_SSL_PROPS_MAP.get(DistributionConfig.GATEWAY_SSL_KEYSTORE_TYPE_NAME), config.getGatewaySSLKeyStoreType()); + isEqual(GATEWAY_SSL_PROPS_MAP.get(DistributionConfig.GATEWAY_SSL_KEYSTORE_PASSWORD_NAME), config.getGatewaySSLKeyStorePassword()); + isEqual(GATEWAY_SSL_PROPS_MAP.get(DistributionConfig.GATEWAY_SSL_TRUSTSTORE_NAME), config.getGatewaySSLTrustStore()); + isEqual(GATEWAY_SSL_PROPS_MAP.get(DistributionConfig.GATEWAY_SSL_TRUSTSTORE_PASSWORD_NAME), config.getGatewaySSLTrustStorePassword()); } @@ -791,17 +790,17 @@ public class SSLConfigJUnitTest { isEqual( config.getJmxManagerSSLCiphers(), jmxManagerSslciphers ); isEqual( config.getJmxManagerSSLRequireAuthentication(), jmxManagerSslRequireAuth ); - isEqual( CLUSTER_SSL_PROPS_MAP.get("cluster-ssl-keystore"), config.getClusterSSLKeyStore() ); - isEqual( CLUSTER_SSL_PROPS_MAP.get("cluster-ssl-keystore-type"), config.getClusterSSLKeyStoreType()); - isEqual( CLUSTER_SSL_PROPS_MAP.get("cluster-ssl-keystore-password"), config.getClusterSSLKeyStorePassword()); - isEqual( CLUSTER_SSL_PROPS_MAP.get("cluster-ssl-truststore"), config.getClusterSSLTrustStore()); - isEqual( CLUSTER_SSL_PROPS_MAP.get("cluster-ssl-truststore-password"), config.getClusterSSLTrustStorePassword()); - - isEqual( JMX_SSL_PROPS_SUBSET_MAP.get("jmx-manager-ssl-keystore") , config.getJmxManagerSSLKeyStore()); - isEqual( CLUSTER_SSL_PROPS_MAP.get("cluster-ssl-keystore-type"), config.getJmxManagerSSLKeyStoreType()); - isEqual( CLUSTER_SSL_PROPS_MAP.get("cluster-ssl-keystore-password"), config.getJmxManagerSSLKeyStorePassword()); - isEqual( JMX_SSL_PROPS_SUBSET_MAP.get("jmx-manager-ssl-truststore"), config.getJmxManagerSSLTrustStore()); - isEqual( CLUSTER_SSL_PROPS_MAP.get("cluster-ssl-truststore-password"),config.getJmxManagerSSLTrustStorePassword()); + isEqual(CLUSTER_SSL_PROPS_MAP.get(DistributionConfig.CLUSTER_SSL_KEYSTORE_NAME), config.getClusterSSLKeyStore()); + isEqual(CLUSTER_SSL_PROPS_MAP.get(DistributionConfig.CLUSTER_SSL_KEYSTORE_TYPE_NAME), config.getClusterSSLKeyStoreType()); + isEqual(CLUSTER_SSL_PROPS_MAP.get(DistributionConfig.CLUSTER_SSL_KEYSTORE_PASSWORD_NAME), config.getClusterSSLKeyStorePassword()); + isEqual(CLUSTER_SSL_PROPS_MAP.get(DistributionConfig.CLUSTER_SSL_TRUSTSTORE_NAME), config.getClusterSSLTrustStore()); + isEqual(CLUSTER_SSL_PROPS_MAP.get(DistributionConfig.CLUSTER_SSL_TRUSTSTORE_PASSWORD_NAME), config.getClusterSSLTrustStorePassword()); + + isEqual(JMX_SSL_PROPS_SUBSET_MAP.get(DistributionConfig.JMX_MANAGER_SSL_KEYSTORE_NAME), config.getJmxManagerSSLKeyStore()); + isEqual(CLUSTER_SSL_PROPS_MAP.get(DistributionConfig.CLUSTER_SSL_KEYSTORE_TYPE_NAME), config.getJmxManagerSSLKeyStoreType()); + isEqual(CLUSTER_SSL_PROPS_MAP.get(DistributionConfig.CLUSTER_SSL_KEYSTORE_PASSWORD_NAME), config.getJmxManagerSSLKeyStorePassword()); + isEqual(JMX_SSL_PROPS_SUBSET_MAP.get(DistributionConfig.JMX_MANAGER_SSL_TRUSTSTORE_NAME), config.getJmxManagerSSLTrustStore()); + isEqual(CLUSTER_SSL_PROPS_MAP.get(DistributionConfig.CLUSTER_SSL_TRUSTSTORE_PASSWORD_NAME), config.getJmxManagerSSLTrustStorePassword()); } @@ -841,17 +840,17 @@ public class SSLConfigJUnitTest { isEqual( config.getServerSSLCiphers(), cacheServerSslciphers ); isEqual( config.getServerSSLRequireAuthentication(), cacheServerSslRequireAuth ); - isEqual( CLUSTER_SSL_PROPS_MAP.get("cluster-ssl-keystore"), config.getClusterSSLKeyStore() ); - isEqual( CLUSTER_SSL_PROPS_MAP.get("cluster-ssl-keystore-type"), config.getClusterSSLKeyStoreType()); - isEqual( CLUSTER_SSL_PROPS_MAP.get("cluster-ssl-keystore-password"), config.getClusterSSLKeyStorePassword()); - isEqual( CLUSTER_SSL_PROPS_MAP.get("cluster-ssl-truststore"), config.getClusterSSLTrustStore()); - isEqual( CLUSTER_SSL_PROPS_MAP.get("cluster-ssl-truststore-password"), config.getClusterSSLTrustStorePassword()); - - isEqual( SERVER_PROPS_SUBSET_MAP.get("server-ssl-keystore") , config.getServerSSLKeyStore()); - isEqual( CLUSTER_SSL_PROPS_MAP.get("cluster-ssl-keystore-type"), config.getServerSSLKeyStoreType()); - isEqual( CLUSTER_SSL_PROPS_MAP.get("cluster-ssl-keystore-password"), config.getServerSSLKeyStorePassword()); - isEqual( SERVER_PROPS_SUBSET_MAP.get("server-ssl-truststore"), config.getServerSSLTrustStore()); - isEqual( CLUSTER_SSL_PROPS_MAP.get("cluster-ssl-truststore-password"),config.getServerSSLTrustStorePassword()); + isEqual(CLUSTER_SSL_PROPS_MAP.get(DistributionConfig.CLUSTER_SSL_KEYSTORE_NAME), config.getClusterSSLKeyStore()); + isEqual(CLUSTER_SSL_PROPS_MAP.get(DistributionConfig.CLUSTER_SSL_KEYSTORE_TYPE_NAME), config.getClusterSSLKeyStoreType()); + isEqual(CLUSTER_SSL_PROPS_MAP.get(DistributionConfig.CLUSTER_SSL_KEYSTORE_PASSWORD_NAME), config.getClusterSSLKeyStorePassword()); + isEqual(CLUSTER_SSL_PROPS_MAP.get(DistributionConfig.CLUSTER_SSL_TRUSTSTORE_NAME), config.getClusterSSLTrustStore()); + isEqual(CLUSTER_SSL_PROPS_MAP.get(DistributionConfig.CLUSTER_SSL_TRUSTSTORE_PASSWORD_NAME), config.getClusterSSLTrustStorePassword()); + + isEqual(SERVER_PROPS_SUBSET_MAP.get(DistributionConfig.SERVER_SSL_KEYSTORE_NAME), config.getServerSSLKeyStore()); + isEqual(CLUSTER_SSL_PROPS_MAP.get(DistributionConfig.CLUSTER_SSL_KEYSTORE_TYPE_NAME), config.getServerSSLKeyStoreType()); + isEqual(CLUSTER_SSL_PROPS_MAP.get(DistributionConfig.CLUSTER_SSL_KEYSTORE_PASSWORD_NAME), config.getServerSSLKeyStorePassword()); + isEqual(SERVER_PROPS_SUBSET_MAP.get(DistributionConfig.SERVER_SSL_TRUSTSTORE_NAME), config.getServerSSLTrustStore()); + isEqual(CLUSTER_SSL_PROPS_MAP.get(DistributionConfig.CLUSTER_SSL_TRUSTSTORE_PASSWORD_NAME), config.getServerSSLTrustStorePassword()); } @Test @@ -889,18 +888,18 @@ public class SSLConfigJUnitTest { isEqual( config.getGatewaySSLProtocols(), gatewaySslprotocols ); isEqual( config.getGatewaySSLCiphers(), gatewaySslciphers ); isEqual( config.getGatewaySSLRequireAuthentication(), gatewaySslRequireAuth ); - - isEqual( CLUSTER_SSL_PROPS_MAP.get("cluster-ssl-keystore"), config.getClusterSSLKeyStore() ); - isEqual( CLUSTER_SSL_PROPS_MAP.get("cluster-ssl-keystore-type"), config.getClusterSSLKeyStoreType()); - isEqual( CLUSTER_SSL_PROPS_MAP.get("cluster-ssl-keystore-password"), config.getClusterSSLKeyStorePassword()); - isEqual( CLUSTER_SSL_PROPS_MAP.get("cluster-ssl-truststore"), config.getClusterSSLTrustStore()); - isEqual( CLUSTER_SSL_PROPS_MAP.get("cluster-ssl-truststore-password"), config.getClusterSSLTrustStorePassword()); - - isEqual( GATEWAY_PROPS_SUBSET_MAP.get("gateway-ssl-keystore") , config.getGatewaySSLKeyStore()); - isEqual( CLUSTER_SSL_PROPS_MAP.get("cluster-ssl-keystore-type"), config.getGatewaySSLKeyStoreType()); - isEqual( CLUSTER_SSL_PROPS_MAP.get("cluster-ssl-keystore-password"), config.getGatewaySSLKeyStorePassword()); - isEqual( GATEWAY_PROPS_SUBSET_MAP.get("gateway-ssl-truststore"), config.getGatewaySSLTrustStore()); - isEqual( CLUSTER_SSL_PROPS_MAP.get("cluster-ssl-truststore-password"),config.getGatewaySSLTrustStorePassword()); + + isEqual(CLUSTER_SSL_PROPS_MAP.get(DistributionConfig.CLUSTER_SSL_KEYSTORE_NAME), config.getClusterSSLKeyStore()); + isEqual(CLUSTER_SSL_PROPS_MAP.get(DistributionConfig.CLUSTER_SSL_KEYSTORE_TYPE_NAME), config.getClusterSSLKeyStoreType()); + isEqual(CLUSTER_SSL_PROPS_MAP.get(DistributionConfig.CLUSTER_SSL_KEYSTORE_PASSWORD_NAME), config.getClusterSSLKeyStorePassword()); + isEqual(CLUSTER_SSL_PROPS_MAP.get(DistributionConfig.CLUSTER_SSL_TRUSTSTORE_NAME), config.getClusterSSLTrustStore()); + isEqual(CLUSTER_SSL_PROPS_MAP.get(DistributionConfig.CLUSTER_SSL_TRUSTSTORE_PASSWORD_NAME), config.getClusterSSLTrustStorePassword()); + + isEqual(GATEWAY_PROPS_SUBSET_MAP.get(DistributionConfig.GATEWAY_SSL_KEYSTORE_NAME), config.getGatewaySSLKeyStore()); + isEqual(CLUSTER_SSL_PROPS_MAP.get(DistributionConfig.CLUSTER_SSL_KEYSTORE_TYPE_NAME), config.getGatewaySSLKeyStoreType()); + isEqual(CLUSTER_SSL_PROPS_MAP.get(DistributionConfig.CLUSTER_SSL_KEYSTORE_PASSWORD_NAME), config.getGatewaySSLKeyStorePassword()); + isEqual(GATEWAY_PROPS_SUBSET_MAP.get(DistributionConfig.GATEWAY_SSL_TRUSTSTORE_NAME), config.getGatewaySSLTrustStore()); + isEqual(CLUSTER_SSL_PROPS_MAP.get(DistributionConfig.CLUSTER_SSL_TRUSTSTORE_PASSWORD_NAME), config.getGatewaySSLTrustStorePassword()); } @@ -917,7 +916,7 @@ public class SSLConfigJUnitTest { boolean cacheServerSslRequireAuth = false; Properties gemFireProps = new Properties(); - gemFireProps.put(DistributionConfig.MCAST_PORT_NAME,"0"); + gemFireProps.put(MCAST_PORT, "0"); gemFireProps.put(DistributionConfig.CLUSTER_SSL_ENABLED_NAME, String.valueOf(sslenabled)); gemFireProps.put(DistributionConfig.CLUSTER_SSL_PROTOCOLS_NAME, sslprotocols); gemFireProps.put(DistributionConfig.CLUSTER_SSL_CIPHERS_NAME, sslciphers); @@ -943,17 +942,17 @@ public class SSLConfigJUnitTest { System.out.println(config.toLoggerString()); - isEqual( CLUSTER_SSL_PROPS_MAP.get("cluster-ssl-keystore"), config.getClusterSSLKeyStore() ); - isEqual( CLUSTER_SSL_PROPS_MAP.get("cluster-ssl-keystore-type"), config.getClusterSSLKeyStoreType()); - isEqual( CLUSTER_SSL_PROPS_MAP.get("cluster-ssl-keystore-password"), config.getClusterSSLKeyStorePassword()); - isEqual( CLUSTER_SSL_PROPS_MAP.get("cluster-ssl-truststore"), config.getClusterSSLTrustStore()); - isEqual( CLUSTER_SSL_PROPS_MAP.get("cluster-ssl-truststore-password"), config.getClusterSSLTrustStorePassword()); - - isEqual( CLUSTER_SSL_PROPS_MAP.get("cluster-ssl-keystore") , config.getServerSSLKeyStore()); - isEqual( CLUSTER_SSL_PROPS_MAP.get("cluster-ssl-keystore-type"), config.getServerSSLKeyStoreType()); - isEqual( CLUSTER_SSL_PROPS_MAP.get("cluster-ssl-keystore-password"), config.getServerSSLKeyStorePassword()); - isEqual( CLUSTER_SSL_PROPS_MAP.get("cluster-ssl-truststore"), config.getServerSSLTrustStore()); - isEqual( CLUSTER_SSL_PROPS_MAP.get("cluster-ssl-truststore-password"),config.getServerSSLTrustStorePassword()); + isEqual(CLUSTER_SSL_PROPS_MAP.get(DistributionConfig.CLUSTER_SSL_KEYSTORE_NAME), config.getClusterSSLKeyStore()); + isEqual(CLUSTER_SSL_PROPS_MAP.get(DistributionConfig.CLUSTER_SSL_KEYSTORE_TYPE_NAME), config.getClusterSSLKeyStoreType()); + isEqual(CLUSTER_SSL_PROPS_MAP.get(DistributionConfig.CLUSTER_SSL_KEYSTORE_PASSWORD_NAME), config.getClusterSSLKeyStorePassword()); + isEqual(CLUSTER_SSL_PROPS_MAP.get(DistributionConfig.CLUSTER_SSL_TRUSTSTORE_NAME), config.getClusterSSLTrustStore()); + isEqual(CLUSTER_SSL_PROPS_MAP.get(DistributionConfig.CLUSTER_SSL_TRUSTSTORE_PASSWORD_NAME), config.getClusterSSLTrustStorePassword()); + + isEqual(CLUSTER_SSL_PROPS_MAP.get(DistributionConfig.CLUSTER_SSL_KEYSTORE_NAME), config.getServerSSLKeyStore()); + isEqual(CLUSTER_SSL_PROPS_MAP.get(DistributionConfig.CLUSTER_SSL_KEYSTORE_TYPE_NAME), config.getServerSSLKeyStoreType()); + isEqual(CLUSTER_SSL_PROPS_MAP.get(DistributionConfig.CLUSTER_SSL_KEYSTORE_PASSWORD_NAME), config.getServerSSLKeyStorePassword()); + isEqual(CLUSTER_SSL_PROPS_MAP.get(DistributionConfig.CLUSTER_SSL_TRUSTSTORE_NAME), config.getServerSSLTrustStore()); + isEqual(CLUSTER_SSL_PROPS_MAP.get(DistributionConfig.CLUSTER_SSL_TRUSTSTORE_PASSWORD_NAME), config.getServerSSLTrustStorePassword()); } @@ -970,7 +969,7 @@ public class SSLConfigJUnitTest { boolean cacheServerSslRequireAuth = false; Properties gemFireProps = new Properties(); - gemFireProps.put(DistributionConfig.MCAST_PORT_NAME,"0"); + gemFireProps.put(MCAST_PORT, "0"); gemFireProps.put(DistributionConfig.CLUSTER_SSL_ENABLED_NAME, String.valueOf(sslenabled)); gemFireProps.put(DistributionConfig.CLUSTER_SSL_PROTOCOLS_NAME, sslprotocols); gemFireProps.put(DistributionConfig.CLUSTER_SSL_CIPHERS_NAME, sslciphers); @@ -1001,17 +1000,17 @@ public class SSLConfigJUnitTest { System.out.println(config.toLoggerString()); - isEqual( CLUSTER_SSL_PROPS_MAP.get("cluster-ssl-keystore"), config.getClusterSSLKeyStore() ); - isEqual( CLUSTER_SSL_PROPS_MAP.get("cluster-ssl-keystore-type"), config.getClusterSSLKeyStoreType()); - isEqual( CLUSTER_SSL_PROPS_MAP.get("cluster-ssl-keystore-password"), config.getClusterSSLKeyStorePassword()); - isEqual( CLUSTER_SSL_PROPS_MAP.get("cluster-ssl-truststore"), config.getClusterSSLTrustStore()); - isEqual( CLUSTER_SSL_PROPS_MAP.get("cluster-ssl-truststore-password"), config.getClusterSSLTrustStorePassword()); - - isEqual( SERVER_PROPS_SUBSET_MAP.get("server-ssl-keystore") , config.getServerSSLKeyStore()); - isEqual( CLUSTER_SSL_PROPS_MAP.get("cluster-ssl-keystore-type"), config.getServerSSLKeyStoreType()); - isEqual( CLUSTER_SSL_PROPS_MAP.get("cluster-ssl-keystore-password"), config.getServerSSLKeyStorePassword()); - isEqual( SERVER_PROPS_SUBSET_MAP.get("server-ssl-truststore"), config.getServerSSLTrustStore()); - isEqual( CLUSTER_SSL_PROPS_MAP.get("cluster-ssl-truststore-password"),config.getServerSSLTrustStorePassword()); + isEqual(CLUSTER_SSL_PROPS_MAP.get(DistributionConfig.CLUSTER_SSL_KEYSTORE_NAME), config.getClusterSSLKeyStore()); + isEqual(CLUSTER_SSL_PROPS_MAP.get(DistributionConfig.CLUSTER_SSL_KEYSTORE_TYPE_NAME), config.getClusterSSLKeyStoreType()); + isEqual(CLUSTER_SSL_PROPS_MAP.get(DistributionConfig.CLUSTER_SSL_KEYSTORE_PASSWORD_NAME), config.getClusterSSLKeyStorePassword()); + isEqual(CLUSTER_SSL_PROPS_MAP.get(DistributionConfig.CLUSTER_SSL_TRUSTSTORE_NAME), config.getClusterSSLTrustStore()); + isEqual(CLUSTER_SSL_PROPS_MAP.get(DistributionConfig.CLUSTER_SSL_TRUSTSTORE_PASSWORD_NAME), config.getClusterSSLTrustStorePassword()); + + isEqual(SERVER_PROPS_SUBSET_MAP.get(DistributionConfig.SERVER_SSL_KEYSTORE_NAME), config.getServerSSLKeyStore()); + isEqual(CLUSTER_SSL_PROPS_MAP.get(DistributionConfig.CLUSTER_SSL_KEYSTORE_TYPE_NAME), config.getServerSSLKeyStoreType()); + isEqual(CLUSTER_SSL_PROPS_MAP.get(DistributionConfig.CLUSTER_SSL_KEYSTORE_PASSWORD_NAME), config.getServerSSLKeyStorePassword()); + isEqual(SERVER_PROPS_SUBSET_MAP.get(DistributionConfig.SERVER_SSL_TRUSTSTORE_NAME), config.getServerSSLTrustStore()); + isEqual(CLUSTER_SSL_PROPS_MAP.get(DistributionConfig.CLUSTER_SSL_TRUSTSTORE_PASSWORD_NAME), config.getServerSSLTrustStorePassword()); } @Test @@ -1027,7 +1026,7 @@ public class SSLConfigJUnitTest { boolean gatewayServerSslRequireAuth = false; Properties gemFireProps = new Properties(); - gemFireProps.put(DistributionConfig.MCAST_PORT_NAME,"0"); + gemFireProps.put(MCAST_PORT, "0"); gemFireProps.put(DistributionConfig.CLUSTER_SSL_ENABLED_NAME, String.valueOf(sslenabled)); gemFireProps.put(DistributionConfig.CLUSTER_SSL_PROTOCOLS_NAME, sslprotocols); gemFireProps.put(DistributionConfig.CLUSTER_SSL_CIPHERS_NAME, sslciphers); @@ -1053,17 +1052,17 @@ public class SSLConfigJUnitTest { System.out.println(config.toLoggerString()); - isEqual( CLUSTER_SSL_PROPS_MAP.get("cluster-ssl-keystore"), config.getClusterSSLKeyStore() ); - isEqual( CLUSTER_SSL_PROPS_MAP.get("cluster-ssl-keystore-type"), config.getClusterSSLKeyStoreType()); - isEqual( CLUSTER_SSL_PROPS_MAP.get("cluster-ssl-keystore-password"), config.getClusterSSLKeyStorePassword()); - isEqual( CLUSTER_SSL_PROPS_MAP.get("cluster-ssl-truststore"), config.getClusterSSLTrustStore()); - isEqual( CLUSTER_SSL_PROPS_MAP.get("cluster-ssl-truststore-password"), config.getClusterSSLTrustStorePassword()); - - isEqual( CLUSTER_SSL_PROPS_MAP.get("cluster-ssl-keystore") , config.getGatewaySSLKeyStore()); - isEqual( CLUSTER_SSL_PROPS_MAP.get("cluster-ssl-keystore-type"), config.getGatewaySSLKeyStoreType()); - isEqual( CLUSTER_SSL_PROPS_MAP.get("cluster-ssl-keystore-password"), config.getGatewaySSLKeyStorePassword()); - isEqual( CLUSTER_SSL_PROPS_MAP.get("cluster-ssl-truststore"), config.getGatewaySSLTrustStore()); - isEqual( CLUSTER_SSL_PROPS_MAP.get("cluster-ssl-truststore-password"),config.getGatewaySSLTrustStorePassword()); + isEqual(CLUSTER_SSL_PROPS_MAP.get(DistributionConfig.CLUSTER_SSL_KEYSTORE_NAME), config.getClusterSSLKeyStore()); + isEqual(CLUSTER_SSL_PROPS_MAP.get(DistributionConfig.CLUSTER_SSL_KEYSTORE_TYPE_NAME), config.getClusterSSLKeyStoreType()); + isEqual(CLUSTER_SSL_PROPS_MAP.get(DistributionConfig.CLUSTER_SSL_KEYSTORE_PASSWORD_NAME), config.getClusterSSLKeyStorePassword()); + isEqual(CLUSTER_SSL_PROPS_MAP.get(DistributionConfig.CLUSTER_SSL_TRUSTSTORE_NAME), config.getClusterSSLTrustStore()); + isEqual(CLUSTER_SSL_PROPS_MAP.get(DistributionConfig.CLUSTER_SSL_TRUSTSTORE_PASSWORD_NAME), config.getClusterSSLTrustStorePassword()); + + isEqual(CLUSTER_SSL_PROPS_MAP.get(DistributionConfig.CLUSTER_SSL_KEYSTORE_NAME), config.getGatewaySSLKeyStore()); + isEqual(CLUSTER_SSL_PROPS_MAP.get(DistributionConfig.CLUSTER_SSL_KEYSTORE_TYPE_NAME), config.getGatewaySSLKeyStoreType()); + isEqual(CLUSTER_SSL_PROPS_MAP.get(DistributionConfig.CLUSTER_SSL_KEYSTORE_PASSWORD_NAME), config.getGatewaySSLKeyStorePassword()); + isEqual(CLUSTER_SSL_PROPS_MAP.get(DistributionConfig.CLUSTER_SSL_TRUSTSTORE_NAME), config.getGatewaySSLTrustStore()); + isEqual(CLUSTER_SSL_PROPS_MAP.get(DistributionConfig.CLUSTER_SSL_TRUSTSTORE_PASSWORD_NAME), config.getGatewaySSLTrustStorePassword()); } @@ -1080,7 +1079,7 @@ public class SSLConfigJUnitTest { boolean gatewayServerSslRequireAuth = false; Properties gemFireProps = new Properties(); - gemFireProps.put(DistributionConfig.MCAST_PORT_NAME,"0"); + gemFireProps.put(MCAST_PORT, "0"); gemFireProps.put(DistributionConfig.CLUSTER_SSL_ENABLED_NAME, String.valueOf(sslenabled)); gemFireProps.put(DistributionConfig.CLUSTER_SSL_PROTOCOLS_NAME, sslprotocols); gemFireProps.put(DistributionConfig.CLUSTER_SSL_CIPHERS_NAME, sslciphers); @@ -1106,17 +1105,17 @@ public class SSLConfigJUnitTest { System.out.println(config.toLoggerString()); - isEqual( CLUSTER_SSL_PROPS_MAP.get("cluster-ssl-keystore"), config.getClusterSSLKeyStore() ); - isEqual( CLUSTER_SSL_PROPS_MAP.get("cluster-ssl-keystore-type"), config.getClusterSSLKeyStoreType()); - isEqual( CLUSTER_SSL_PROPS_MAP.get("cluster-ssl-keystore-password"), config.getClusterSSLKeyStorePassword()); - isEqual( CLUSTER_SSL_PROPS_MAP.get("cluster-ssl-truststore"), config.getClusterSSLTrustStore()); - isEqual( CLUSTER_SSL_PROPS_MAP.get("cluster-ssl-truststore-password"), config.getClusterSSLTrustStorePassword()); - - isEqual( GATEWAY_PROPS_SUBSET_MAP.get("gateway-ssl-keystore") , config.getGatewaySSLKeyStore()); - isEqual( CLUSTER_SSL_PROPS_MAP.get("cluster-ssl-keystore-type"), config.getGatewaySSLKeyStoreType()); - isEqual( CLUSTER_SSL_PROPS_MAP.get("cluster-ssl-keystore-password"), config.getGatewaySSLKeyStorePassword()); - isEqual( GATEWAY_PROPS_SUBSET_MAP.get("gateway-ssl-truststore"), config.getGatewaySSLTrustStore()); - isEqual( CLUSTER_SSL_PROPS_MAP.get("cluster-ssl-truststore-password"),config.getGatewaySSLTrustStorePassword()); + isEqual(CLUSTER_SSL_PROPS_MAP.get(DistributionConfig.CLUSTER_SSL_KEYSTORE_NAME), config.getClusterSSLKeyStore()); + isEqual(CLUSTER_SSL_PROPS_MAP.get(DistributionConfig.CLUSTER_SSL_KEYSTORE_TYPE_NAME), config.getClusterSSLKeyStoreType()); + isEqual(CLUSTER_SSL_PROPS_MAP.get(DistributionConfig.CLUSTER_SSL_KEYSTORE_PASSWORD_NAME), config.getClusterSSLKeyStorePassword()); + isEqual(CLUSTER_SSL_PROPS_MAP.get(DistributionConfig.CLUSTER_SSL_TRUSTSTORE_NAME), config.getClusterSSLTrustStore()); + isEqual(CLUSTER_SSL_PROPS_MAP.get(DistributionConfig.CLUSTER_SSL_TRUSTSTORE_PASSWORD_NAME), config.getClusterSSLTrustStorePassword()); + + isEqual(GATEWAY_PROPS_SUBSET_MAP.get(DistributionConfig.GATEWAY_SSL_KEYSTORE_NAME), config.getGatewaySSLKeyStore()); + isEqual(CLUSTER_SSL_PROPS_MAP.get(DistributionConfig.CLUSTER_SSL_KEYSTORE_TYPE_NAME), config.getGatewaySSLKeyStoreType()); + isEqual(CLUSTER_SSL_PROPS_MAP.get(DistributionConfig.CLUSTER_SSL_KEYSTORE_PASSWORD_NAME), config.getGatewaySSLKeyStorePassword()); + isEqual(GATEWAY_PROPS_SUBSET_MAP.get(DistributionConfig.GATEWAY_SSL_TRUSTSTORE_NAME), config.getGatewaySSLTrustStore()); + isEqual(CLUSTER_SSL_PROPS_MAP.get(DistributionConfig.CLUSTER_SSL_TRUSTSTORE_PASSWORD_NAME), config.getGatewaySSLTrustStorePassword()); } @@ -1133,7 +1132,7 @@ public class SSLConfigJUnitTest { boolean jmxManagerSslRequireAuth = false; Properties gemFireProps = new Properties(); - gemFireProps.put(DistributionConfig.MCAST_PORT_NAME,"0"); + gemFireProps.put(MCAST_PORT, "0"); gemFireProps.put(DistributionConfig.CLUSTER_SSL_ENABLED_NAME, String.valueOf(sslenabled)); gemFireProps.put(DistributionConfig.CLUSTER_SSL_PROTOCOLS_NAME, sslprotocols); gemFireProps.put(DistributionConfig.CLUSTER_SSL_CIPHERS_NAME, sslciphers); @@ -1159,17 +1158,17 @@ public class SSLConfigJUnitTest { System.out.println(config.toLoggerString()); - isEqual( CLUSTER_SSL_PROPS_MAP.get("cluster-ssl-keystore"), config.getClusterSSLKeyStore() ); - isEqual( CLUSTER_SSL_PROPS_MAP.get("cluster-ssl-keystore-type"), config.getClusterSSLKeyStoreType()); - isEqual( CLUSTER_SSL_PROPS_MAP.get("cluster-ssl-keystore-password"), config.getClusterSSLKeyStorePassword()); - isEqual( CLUSTER_SSL_PROPS_MAP.get("cluster-ssl-truststore"), config.getClusterSSLTrustStore()); - isEqual( CLUSTER_SSL_PROPS_MAP.get("cluster-ssl-truststore-password"), config.getClusterSSLTrustStorePassword()); - - isEqual( CLUSTER_SSL_PROPS_MAP.get("cluster-ssl-keystore") , config.getJmxManagerSSLKeyStore()); - isEqual( CLUSTER_SSL_PROPS_MAP.get("cluster-ssl-keystore-type"), config.getJmxManagerSSLKeyStoreType()); - isEqual( CLUSTER_SSL_PROPS_MAP.get("cluster-ssl-keystore-password"), config.getJmxManagerSSLKeyStorePassword()); - isEqual( CLUSTER_SSL_PROPS_MAP.get("cluster-ssl-truststore"), config.getJmxManagerSSLTrustStore()); - isEqual( CLUSTER_SSL_PROPS_MAP.get("cluster-ssl-truststore-password"),config.getJmxManagerSSLTrustStorePassword()); + isEqual(CLUSTER_SSL_PROPS_MAP.get(DistributionConfig.CLUSTER_SSL_KEYSTORE_NAME), config.getClusterSSLKeyStore()); + isEqual(CLUSTER_SSL_PROPS_MAP.get(DistributionConfig.CLUSTER_SSL_KEYSTORE_TYPE_NAME), config.getClusterSSLKeyStoreType()); + isEqual(CLUSTER_SSL_PROPS_MAP.get(DistributionConfig.CLUSTER_SSL_KEYSTORE_PASSWORD_NAME), config.getClusterSSLKeyStorePassword()); + isEqual(CLUSTER_SSL_PROPS_MAP.get(DistributionConfig.CLUSTER_SSL_TRUSTSTORE_NAME), config.getClusterSSLTrustStore()); + isEqual(CLUSTER_SSL_PROPS_MAP.get(DistributionConfig.CLUSTER_SSL_TRUSTSTORE_PASSWORD_NAME), config.getClusterSSLTrustStorePassword()); + + isEqual(CLUSTER_SSL_PROPS_MAP.get(DistributionConfig.CLUSTER_SSL_KEYSTORE_NAME), config.getJmxManagerSSLKeyStore()); + isEqual(CLUSTER_SSL_PROPS_MAP.get(DistributionConfig.CLUSTER_SSL_KEYSTORE_TYPE_NAME), config.getJmxManagerSSLKeyStoreType()); + isEqual(CLUSTER_SSL_PROPS_MAP.get(DistributionConfig.CLUSTER_SSL_KEYSTORE_PASSWORD_NAME), config.getJmxManagerSSLKeyStorePassword()); + isEqual(CLUSTER_SSL_PROPS_MAP.get(DistributionConfig.CLUSTER_SSL_TRUSTSTORE_NAME), config.getJmxManagerSSLTrustStore()); + isEqual(CLUSTER_SSL_PROPS_MAP.get(DistributionConfig.CLUSTER_SSL_TRUSTSTORE_PASSWORD_NAME), config.getJmxManagerSSLTrustStorePassword()); } http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/70612010/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/BackupJUnitTest.java ---------------------------------------------------------------------- diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/BackupJUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/BackupJUnitTest.java index a953155..197c28b 100644 --- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/BackupJUnitTest.java +++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/BackupJUnitTest.java @@ -16,43 +16,26 @@ */ package com.gemstone.gemfire.internal.cache; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertTrue; - -import java.io.BufferedReader; -import java.io.File; -import java.io.FileInputStream; -import java.io.IOException; -import java.io.InputStream; -import java.io.InputStreamReader; -import java.net.URISyntaxException; -import java.net.URL; -import java.util.Arrays; -import java.util.Collections; -import java.util.List; -import java.util.Properties; -import java.util.Random; - -import org.junit.After; -import org.junit.Before; -import org.junit.Test; -import org.junit.experimental.categories.Category; - -import com.gemstone.gemfire.cache.CacheFactory; -import com.gemstone.gemfire.cache.DataPolicy; -import com.gemstone.gemfire.cache.DiskStore; -import com.gemstone.gemfire.cache.DiskStoreFactory; -import com.gemstone.gemfire.cache.DiskWriteAttributesFactory; -import com.gemstone.gemfire.cache.EvictionAction; -import com.gemstone.gemfire.cache.EvictionAttributes; -import com.gemstone.gemfire.cache.Region; -import com.gemstone.gemfire.cache.RegionFactory; +import com.gemstone.gemfire.cache.*; import com.gemstone.gemfire.distributed.DistributedSystem; +import com.gemstone.gemfire.distributed.internal.DistributionConfig; import com.gemstone.gemfire.internal.FileUtil; import com.gemstone.gemfire.internal.cache.persistence.BackupManager; import com.gemstone.gemfire.internal.cache.persistence.RestoreScript; import com.gemstone.gemfire.test.junit.categories.IntegrationTest; +import org.junit.After; +import org.junit.Before; +import org.junit.Test; +import org.junit.experimental.categories.Category; + +import java.io.*; +import java.net.URISyntaxException; +import java.net.URL; +import java.util.*; + +import static com.gemstone.gemfire.distributed.SystemConfigurationProperties.LOCATORS; +import static com.gemstone.gemfire.distributed.SystemConfigurationProperties.MCAST_PORT; +import static org.junit.Assert.*; /** * @@ -80,8 +63,8 @@ public class BackupJUnitTest { @Before public void setUp() throws Exception { if (TMP_DIR == null) { - props.setProperty("mcast-port", "0"); - props.setProperty("locators", ""); + props.setProperty(MCAST_PORT, "0"); + props.setProperty(LOCATORS, ""); String tmpDirName = System.getProperty("java.io.tmpdir"); TMP_DIR = tmpDirName == null ? new File("") : new File(tmpDirName); try { @@ -90,8 +73,8 @@ public class BackupJUnitTest { } catch (URISyntaxException e) { throw new ExceptionInInitializerError(e); } - props.setProperty("cache-xml-file", CACHE_XML_FILE.getAbsolutePath()); - props.setProperty("log-level", "config"); // to keep diskPerf logs smaller + props.setProperty(DistributionConfig.CACHE_XML_FILE_NAME, CACHE_XML_FILE.getAbsolutePath()); + props.setProperty(DistributionConfig.LOG_LEVEL_NAME, "config"); // to keep diskPerf logs smaller } createCache(); http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/70612010/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug33726JUnitTest.java ---------------------------------------------------------------------- diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug33726JUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug33726JUnitTest.java index e088930..005d569 100755 --- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug33726JUnitTest.java +++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug33726JUnitTest.java @@ -16,23 +16,18 @@ */ package com.gemstone.gemfire.internal.cache; -import static org.junit.Assert.fail; - -import java.util.Properties; - +import com.gemstone.gemfire.cache.*; +import com.gemstone.gemfire.cache.util.CacheListenerAdapter; +import com.gemstone.gemfire.distributed.DistributedSystem; +import com.gemstone.gemfire.test.junit.categories.IntegrationTest; import org.junit.After; import org.junit.Test; import org.junit.experimental.categories.Category; -import com.gemstone.gemfire.cache.AttributesFactory; -import com.gemstone.gemfire.cache.Cache; -import com.gemstone.gemfire.cache.CacheFactory; -import com.gemstone.gemfire.cache.Region; -import com.gemstone.gemfire.cache.RegionEvent; -import com.gemstone.gemfire.cache.util.CacheListenerAdapter; -import com.gemstone.gemfire.distributed.DistributedSystem; -import com.gemstone.gemfire.distributed.internal.DistributionConfig; -import com.gemstone.gemfire.test.junit.categories.IntegrationTest; +import java.util.Properties; + +import static com.gemstone.gemfire.distributed.SystemConfigurationProperties.MCAST_PORT; +import static org.junit.Assert.fail; /** * AFTER_REGION_CREATE was being sent before region @@ -65,7 +60,7 @@ public class Bug33726JUnitTest{ @Test public void testAfterRegionCreate() { Properties props = new Properties(); - props.put(DistributionConfig.MCAST_PORT_NAME, "0"); + props.put(MCAST_PORT, "0"); DistributedSystem ds = DistributedSystem.connect(props); AttributesFactory factory = new AttributesFactory(); factory.setCacheListener(new TestCacheListener()); http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/70612010/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug34583JUnitTest.java ---------------------------------------------------------------------- diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug34583JUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug34583JUnitTest.java index 7f3081a..d00c87b 100644 --- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug34583JUnitTest.java +++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug34583JUnitTest.java @@ -16,22 +16,22 @@ */ package com.gemstone.gemfire.internal.cache; -import static org.junit.Assert.assertEquals; - -import java.util.Collection; -import java.util.Iterator; -import java.util.Properties; - -import org.junit.After; -import org.junit.Test; -import org.junit.experimental.categories.Category; - import com.gemstone.gemfire.cache.AttributesFactory; import com.gemstone.gemfire.cache.Cache; import com.gemstone.gemfire.cache.CacheFactory; import com.gemstone.gemfire.cache.Region; import com.gemstone.gemfire.distributed.DistributedSystem; import com.gemstone.gemfire.test.junit.categories.IntegrationTest; +import org.junit.After; +import org.junit.Test; +import org.junit.experimental.categories.Category; + +import java.util.Collection; +import java.util.Iterator; +import java.util.Properties; + +import static com.gemstone.gemfire.distributed.SystemConfigurationProperties.MCAST_PORT; +import static org.junit.Assert.assertEquals; /** * Confirm that bug 34583 is fixed. Cause of bug is recursion is @@ -55,7 +55,7 @@ public class Bug34583JUnitTest { @Test public void testBunchOfInvalidEntries() throws Exception { Properties props = new Properties(); - props.setProperty("mcast-port", "0"); + props.setProperty(MCAST_PORT, "0"); DistributedSystem ds = DistributedSystem.connect(props); try { AttributesFactory factory = new AttributesFactory(); http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/70612010/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug37244JUnitTest.java ---------------------------------------------------------------------- diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug37244JUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug37244JUnitTest.java index d6b6e2e..ef4e6be 100644 --- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug37244JUnitTest.java +++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug37244JUnitTest.java @@ -16,32 +16,23 @@ */ package com.gemstone.gemfire.internal.cache; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertTrue; -import static org.junit.Assert.fail; - -import java.io.File; -import java.util.Properties; - -import org.junit.Test; -import org.junit.experimental.categories.Category; - -import com.gemstone.gemfire.cache.AttributesFactory; -import com.gemstone.gemfire.cache.Cache; -import com.gemstone.gemfire.cache.CacheFactory; -import com.gemstone.gemfire.cache.DataPolicy; -import com.gemstone.gemfire.cache.DiskStoreFactory; -import com.gemstone.gemfire.cache.EvictionAction; -import com.gemstone.gemfire.cache.EvictionAttributes; -import com.gemstone.gemfire.cache.Region; -import com.gemstone.gemfire.cache.RegionAttributes; -import com.gemstone.gemfire.cache.Scope; +import com.gemstone.gemfire.cache.*; import com.gemstone.gemfire.distributed.DistributedSystem; +import com.gemstone.gemfire.distributed.internal.DistributionConfig; import com.gemstone.gemfire.internal.Assert; import com.gemstone.gemfire.internal.cache.lru.EnableLRU; import com.gemstone.gemfire.internal.cache.lru.LRUClockNode; import com.gemstone.gemfire.internal.cache.lru.NewLRUClockHand; import com.gemstone.gemfire.test.junit.categories.IntegrationTest; +import org.junit.Test; +import org.junit.experimental.categories.Category; + +import java.io.File; +import java.util.Properties; + +import static com.gemstone.gemfire.distributed.SystemConfigurationProperties.LOCATORS; +import static com.gemstone.gemfire.distributed.SystemConfigurationProperties.MCAST_PORT; +import static org.junit.Assert.*; /** * Test for simluating the deadLock condition as in bug#37244 @@ -64,9 +55,9 @@ public class Bug37244JUnitTest private static void initializeVM() throws Exception { Properties props = new Properties(); - props.setProperty("mcast-port", "0"); - props.setProperty("locators", ""); - props.setProperty("log-level", "info"); // to keep diskPerf logs smaller + props.setProperty(MCAST_PORT, "0"); + props.setProperty(LOCATORS, ""); + props.setProperty(DistributionConfig.LOG_LEVEL_NAME, "info"); // to keep diskPerf logs smaller distributedSystem = DistributedSystem.connect(props); cache = CacheFactory.create(distributedSystem); assertNotNull(cache); http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/70612010/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug39079DUnitTest.java ---------------------------------------------------------------------- diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug39079DUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug39079DUnitTest.java index 74f31cd..ba105c4 100644 --- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug39079DUnitTest.java +++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug39079DUnitTest.java @@ -19,35 +19,24 @@ */ package com.gemstone.gemfire.internal.cache; -import java.io.File; -import java.io.IOException; -import java.nio.channels.FileChannel; -import java.util.List; -import java.util.Properties; - -import com.gemstone.gemfire.cache.AttributesFactory; -import com.gemstone.gemfire.cache.Cache; -import com.gemstone.gemfire.cache.CacheFactory; -import com.gemstone.gemfire.cache.DataPolicy; -import com.gemstone.gemfire.cache.DiskAccessException; -import com.gemstone.gemfire.cache.EntryEvent; -import com.gemstone.gemfire.cache.Region; -import com.gemstone.gemfire.cache.RegionAttributes; -import com.gemstone.gemfire.cache.Scope; +import com.gemstone.gemfire.cache.*; import com.gemstone.gemfire.cache.client.PoolManager; import com.gemstone.gemfire.cache.client.internal.PoolImpl; import com.gemstone.gemfire.cache.server.CacheServer; import com.gemstone.gemfire.cache30.CacheSerializableRunnable; import com.gemstone.gemfire.cache30.CacheTestCase; import com.gemstone.gemfire.distributed.DistributedSystem; -import com.gemstone.gemfire.distributed.internal.DistributionConfig; import com.gemstone.gemfire.internal.AvailablePort; import com.gemstone.gemfire.internal.cache.persistence.UninterruptibleFileChannel; -import com.gemstone.gemfire.test.dunit.Assert; -import com.gemstone.gemfire.test.dunit.Host; -import com.gemstone.gemfire.test.dunit.NetworkUtils; -import com.gemstone.gemfire.test.dunit.SerializableRunnable; -import com.gemstone.gemfire.test.dunit.VM; +import com.gemstone.gemfire.test.dunit.*; + +import java.io.File; +import java.io.IOException; +import java.util.List; +import java.util.Properties; + +import static com.gemstone.gemfire.distributed.SystemConfigurationProperties.LOCATORS; +import static com.gemstone.gemfire.distributed.SystemConfigurationProperties.MCAST_PORT; /** * Tests that if a node doing GII experiences DiskAccessException, it should @@ -387,8 +376,8 @@ public class Bug39079DUnitTest extends CacheTestCase { throws Exception { new Bug39079DUnitTest("temp"); Properties props = new Properties(); - props.setProperty(DistributionConfig.MCAST_PORT_NAME, "0"); - props.setProperty(DistributionConfig.LOCATORS_NAME, ""); + props.setProperty(MCAST_PORT, "0"); + props.setProperty(LOCATORS, ""); new Bug39079DUnitTest("temp").createCache(props); PoolImpl p = (PoolImpl)PoolManager.createFactory().addServer(host, port1.intValue()) http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/70612010/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug41091DUnitTest.java ---------------------------------------------------------------------- diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug41091DUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug41091DUnitTest.java index 0e11829..8432b69 100644 --- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug41091DUnitTest.java +++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug41091DUnitTest.java @@ -16,12 +16,6 @@ */ package com.gemstone.gemfire.internal.cache; -import java.io.File; -import java.io.IOException; -import java.net.InetAddress; -import java.net.UnknownHostException; -import java.util.Properties; - import com.gemstone.gemfire.cache.AttributesFactory; import com.gemstone.gemfire.cache.Cache; import com.gemstone.gemfire.cache.PartitionAttributesFactory; @@ -34,12 +28,16 @@ import com.gemstone.gemfire.distributed.internal.DistributionMessage; import com.gemstone.gemfire.distributed.internal.DistributionMessageObserver; import com.gemstone.gemfire.internal.AvailablePort; import com.gemstone.gemfire.internal.cache.InitialImageOperation.RequestImageMessage; -import com.gemstone.gemfire.test.dunit.Assert; -import com.gemstone.gemfire.test.dunit.Host; -import com.gemstone.gemfire.test.dunit.LogWriterUtils; -import com.gemstone.gemfire.test.dunit.NetworkUtils; -import com.gemstone.gemfire.test.dunit.SerializableRunnable; -import com.gemstone.gemfire.test.dunit.VM; +import com.gemstone.gemfire.test.dunit.*; + +import java.io.File; +import java.io.IOException; +import java.net.InetAddress; +import java.net.UnknownHostException; +import java.util.Properties; + +import static com.gemstone.gemfire.distributed.SystemConfigurationProperties.LOCATORS; +import static com.gemstone.gemfire.distributed.SystemConfigurationProperties.MCAST_PORT; /** * @@ -97,7 +95,7 @@ public class Bug41091DUnitTest extends CacheTestCase { Properties props = new Properties(); props.setProperty(DistributionConfig.ENABLE_NETWORK_PARTITION_DETECTION_NAME, "true"); - props.setProperty(DistributionConfig.LOCATORS_NAME, NetworkUtils.getServerHostName(host) + "[" + locatorPort + "]"); + props.setProperty(LOCATORS, NetworkUtils.getServerHostName(host) + "[" + locatorPort + "]"); getSystem(props); @@ -117,7 +115,7 @@ public class Bug41091DUnitTest extends CacheTestCase { public void run() { Properties props = new Properties(); props.setProperty(DistributionConfig.ENABLE_NETWORK_PARTITION_DETECTION_NAME, "true"); - props.setProperty(DistributionConfig.LOCATORS_NAME, NetworkUtils.getServerHostName(host) + "[" + locatorPort + "]"); + props.setProperty(LOCATORS, NetworkUtils.getServerHostName(host) + "[" + locatorPort + "]"); getSystem(props); Cache cache = getCache(); AttributesFactory af = new AttributesFactory(); @@ -150,7 +148,7 @@ public class Bug41091DUnitTest extends CacheTestCase { public void run() { disconnectFromDS(); Properties props = new Properties(); - props.setProperty(DistributionConfig.MCAST_PORT_NAME, String.valueOf(0)); + props.setProperty(MCAST_PORT, String.valueOf(0)); props.setProperty(DistributionConfig.LOG_LEVEL_NAME, LogWriterUtils.getDUnitLogLevel()); props.setProperty(DistributionConfig.ENABLE_NETWORK_PARTITION_DETECTION_NAME, "true"); props.setProperty(DistributionConfig.ENABLE_CLUSTER_CONFIGURATION_NAME, "false"); http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/70612010/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug41957DUnitTest.java ---------------------------------------------------------------------- diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug41957DUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug41957DUnitTest.java index 6f18c36..c701f7c 100644 --- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug41957DUnitTest.java +++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug41957DUnitTest.java @@ -16,29 +16,18 @@ */ package com.gemstone.gemfire.internal.cache; -import java.util.Properties; - -import com.gemstone.gemfire.cache.AttributesFactory; -import com.gemstone.gemfire.cache.CacheException; -import com.gemstone.gemfire.cache.DataPolicy; -import com.gemstone.gemfire.cache.EvictionAttributes; -import com.gemstone.gemfire.cache.InterestPolicy; -import com.gemstone.gemfire.cache.InterestResultPolicy; -import com.gemstone.gemfire.cache.PartitionAttributesFactory; -import com.gemstone.gemfire.cache.Region; -import com.gemstone.gemfire.cache.Scope; -import com.gemstone.gemfire.cache.SubscriptionAttributes; +import com.gemstone.gemfire.cache.*; import com.gemstone.gemfire.cache.client.PoolFactory; import com.gemstone.gemfire.cache.client.PoolManager; import com.gemstone.gemfire.cache30.CacheSerializableRunnable; import com.gemstone.gemfire.cache30.ClientServerTestCase; -import com.gemstone.gemfire.distributed.internal.DistributionConfig; import com.gemstone.gemfire.internal.AvailablePort; -import com.gemstone.gemfire.test.dunit.Assert; -import com.gemstone.gemfire.test.dunit.DistributedTestUtils; -import com.gemstone.gemfire.test.dunit.Host; -import com.gemstone.gemfire.test.dunit.NetworkUtils; -import com.gemstone.gemfire.test.dunit.VM; +import com.gemstone.gemfire.test.dunit.*; + +import java.util.Properties; + +import static com.gemstone.gemfire.distributed.SystemConfigurationProperties.LOCATORS; +import static com.gemstone.gemfire.distributed.SystemConfigurationProperties.MCAST_PORT; /** * Test for bug 41957. @@ -90,7 +79,7 @@ import com.gemstone.gemfire.test.dunit.VM; public void run2() throws CacheException { // Create DS Properties config = new Properties(); - config.setProperty("locators", "localhost["+DistributedTestUtils.getDUnitLocatorPort()+"]"); + config.setProperty(LOCATORS, "localhost[" + DistributedTestUtils.getDUnitLocatorPort() + "]"); getSystem(config); // Create Region @@ -125,8 +114,8 @@ import com.gemstone.gemfire.test.dunit.VM; public void run2() throws CacheException { // Create DS Properties config = new Properties(); - config.setProperty(DistributionConfig.MCAST_PORT_NAME, "0"); - config.setProperty(DistributionConfig.LOCATORS_NAME, ""); + config.setProperty(MCAST_PORT, "0"); + config.setProperty(LOCATORS, ""); getSystem(config); // Create Region http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/70612010/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug45934DUnitTest.java ---------------------------------------------------------------------- diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug45934DUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug45934DUnitTest.java index ca1c1b1..451df52 100644 --- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug45934DUnitTest.java +++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug45934DUnitTest.java @@ -16,22 +16,19 @@ */ package com.gemstone.gemfire.internal.cache; -import java.util.HashMap; -import java.util.Map; - -import com.gemstone.gemfire.cache.Cache; -import com.gemstone.gemfire.cache.CacheFactory; -import com.gemstone.gemfire.cache.DataPolicy; -import com.gemstone.gemfire.cache.Region; -import com.gemstone.gemfire.cache.RegionFactory; -import com.gemstone.gemfire.cache.RegionShortcut; -import com.gemstone.gemfire.cache.Scope; +import com.gemstone.gemfire.cache.*; import com.gemstone.gemfire.cache30.CacheTestCase; +import com.gemstone.gemfire.distributed.internal.DistributionConfig; import com.gemstone.gemfire.internal.util.DelayedAction; import com.gemstone.gemfire.test.dunit.Host; import com.gemstone.gemfire.test.dunit.SerializableCallable; import com.gemstone.gemfire.test.dunit.VM; +import java.util.HashMap; +import java.util.Map; + +import static com.gemstone.gemfire.distributed.SystemConfigurationProperties.MCAST_PORT; + public class Bug45934DUnitTest extends CacheTestCase { public Bug45934DUnitTest(String name) { super(name); @@ -48,8 +45,8 @@ public class Bug45934DUnitTest extends CacheTestCase { // 1. create the local cache CacheFactory cf = new CacheFactory(); - cf.set("mcast-port", "45934"); - cf.set("conserve-sockets", "false"); + cf.set(MCAST_PORT, "45934"); + cf.set(DistributionConfig.CONSERVE_SOCKETS_NAME, "false"); Cache cache = getCache(cf); // 2. create normal region locally @@ -86,8 +83,8 @@ public class Bug45934DUnitTest extends CacheTestCase { @Override public Object call() throws Exception { CacheFactory cf = new CacheFactory(); - cf.set("mcast-port", "45934"); - cf.set("conserve-sockets", "false"); + cf.set(MCAST_PORT, "45934"); + cf.set(DistributionConfig.CONSERVE_SOCKETS_NAME, "false"); getCache(cf). createRegionFactory(RegionShortcut.REPLICATE_PERSISTENT) .create(name); http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/70612010/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug48182JUnitTest.java ---------------------------------------------------------------------- diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug48182JUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug48182JUnitTest.java index efac0bc..85ebf7d 100644 --- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug48182JUnitTest.java +++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug48182JUnitTest.java @@ -16,22 +16,20 @@ */ package com.gemstone.gemfire.internal.cache; -import static org.junit.Assert.assertTrue; -import static org.junit.Assert.fail; - -import java.util.Properties; - +import com.gemstone.gemfire.cache.*; +import com.gemstone.gemfire.distributed.SystemConfigurationProperties; +import com.gemstone.gemfire.test.junit.categories.IntegrationTest; import org.junit.After; import org.junit.Before; import org.junit.Test; import org.junit.experimental.categories.Category; -import com.gemstone.gemfire.cache.CacheClosedException; -import com.gemstone.gemfire.cache.CacheFactory; -import com.gemstone.gemfire.cache.Region; -import com.gemstone.gemfire.cache.RegionDestroyedException; -import com.gemstone.gemfire.cache.RegionShortcut; -import com.gemstone.gemfire.test.junit.categories.IntegrationTest; +import java.util.Properties; + +import static com.gemstone.gemfire.distributed.SystemConfigurationProperties.LOCATORS; +import static com.gemstone.gemfire.distributed.SystemConfigurationProperties.MCAST_PORT; +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; /** * TestCase that emulates the conditions that produce defect 48182 and ensures that the fix works under those conditions. @@ -124,9 +122,9 @@ public class Bug48182JUnitTest { */ protected GemFireCacheImpl createCache() { Properties props = new Properties(); - props.setProperty("locators", ""); - props.setProperty("mcast-port", "0"); - props.setProperty("off-heap-memory-size", getOffHeapMemorySize()); + props.setProperty(LOCATORS, ""); + props.setProperty(MCAST_PORT, "0"); + props.setProperty(SystemConfigurationProperties.OFF_HEAP_MEMORY_SIZE, getOffHeapMemorySize()); GemFireCacheImpl result = (GemFireCacheImpl) new CacheFactory(props).create(); return result; } http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/70612010/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/CacheLifecycleListenerJUnitTest.java ---------------------------------------------------------------------- diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/CacheLifecycleListenerJUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/CacheLifecycleListenerJUnitTest.java index f2a4a8d..078197b 100755 --- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/CacheLifecycleListenerJUnitTest.java +++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/CacheLifecycleListenerJUnitTest.java @@ -16,23 +16,19 @@ */ package com.gemstone.gemfire.internal.cache; +import com.gemstone.gemfire.cache.CacheFactory; +import com.gemstone.gemfire.test.junit.categories.IntegrationTest; +import org.junit.Test; +import org.junit.experimental.categories.Category; + import java.util.ArrayList; import java.util.List; import java.util.Properties; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; -import org.junit.experimental.categories.Category; - +import static com.gemstone.gemfire.distributed.SystemConfigurationProperties.LOCATORS; +import static com.gemstone.gemfire.distributed.SystemConfigurationProperties.MCAST_PORT; import static org.junit.Assert.*; -import com.gemstone.gemfire.cache.CacheFactory; -import com.gemstone.gemfire.distributed.internal.DistributionConfig; -import com.gemstone.gemfire.test.junit.categories.IntegrationTest; - -import junit.framework.TestCase; - /** * Tests notifications of CacheLifecycleListener from GemFireCacheImpl. * @@ -69,8 +65,8 @@ public class CacheLifecycleListenerJUnitTest { assertTrue(cacheClosedCallbacks.isEmpty()); final Properties props = new Properties(); - props.setProperty(DistributionConfig.MCAST_PORT_NAME, "0"); - props.setProperty(DistributionConfig.LOCATORS_NAME, ""); + props.setProperty(MCAST_PORT, "0"); + props.setProperty(LOCATORS, ""); final GemFireCacheImpl cache = (GemFireCacheImpl) new CacheFactory(props).create(); try { @@ -113,8 +109,8 @@ public class CacheLifecycleListenerJUnitTest { assertTrue(cacheClosedCallbacks.isEmpty()); final Properties props = new Properties(); - props.setProperty(DistributionConfig.MCAST_PORT_NAME, "0"); - props.setProperty(DistributionConfig.LOCATORS_NAME, ""); + props.setProperty(MCAST_PORT, "0"); + props.setProperty(LOCATORS, ""); final GemFireCacheImpl cache = (GemFireCacheImpl) new CacheFactory(props).create(); try { @@ -150,8 +146,8 @@ public class CacheLifecycleListenerJUnitTest { assertTrue(cacheClosedCallbacks.isEmpty()); final Properties props = new Properties(); - props.setProperty(DistributionConfig.MCAST_PORT_NAME, "0"); - props.setProperty(DistributionConfig.LOCATORS_NAME, ""); + props.setProperty(MCAST_PORT, "0"); + props.setProperty(LOCATORS, ""); final GemFireCacheImpl cache = (GemFireCacheImpl) new CacheFactory(props).create(); try { @@ -192,8 +188,8 @@ public class CacheLifecycleListenerJUnitTest { assertTrue(cacheClosedCallbacks.isEmpty()); final Properties props = new Properties(); - props.setProperty(DistributionConfig.MCAST_PORT_NAME, "0"); - props.setProperty(DistributionConfig.LOCATORS_NAME, ""); + props.setProperty(MCAST_PORT, "0"); + props.setProperty(LOCATORS, ""); final GemFireCacheImpl cache1 = (GemFireCacheImpl) new CacheFactory(props).create(); try { @@ -258,8 +254,8 @@ public class CacheLifecycleListenerJUnitTest { assertTrue(cacheClosedCallbacks.isEmpty()); final Properties props = new Properties(); - props.setProperty(DistributionConfig.MCAST_PORT_NAME, "0"); - props.setProperty(DistributionConfig.LOCATORS_NAME, ""); + props.setProperty(MCAST_PORT, "0"); + props.setProperty(LOCATORS, ""); final GemFireCacheImpl cache = (GemFireCacheImpl) new CacheFactory(props).create(); try { http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/70612010/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/CacheServiceJUnitTest.java ---------------------------------------------------------------------- diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/CacheServiceJUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/CacheServiceJUnitTest.java index 5674141..7e8a23b 100644 --- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/CacheServiceJUnitTest.java +++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/CacheServiceJUnitTest.java @@ -16,22 +16,15 @@ */ package com.gemstone.gemfire.internal.cache; -import static org.junit.Assert.*; - -import java.util.concurrent.atomic.AtomicBoolean; - +import com.gemstone.gemfire.cache.CacheFactory; +import com.gemstone.gemfire.test.junit.categories.IntegrationTest; import org.junit.After; import org.junit.Before; import org.junit.Test; import org.junit.experimental.categories.Category; -import com.gemstone.gemfire.cache.AttributesFactory; -import com.gemstone.gemfire.cache.CacheFactory; -import com.gemstone.gemfire.cache.DataPolicy; -import com.gemstone.gemfire.cache.Region; -import com.gemstone.gemfire.cache.RegionAttributes; -import com.gemstone.gemfire.cache.RegionShortcut; -import com.gemstone.gemfire.test.junit.categories.IntegrationTest; +import static com.gemstone.gemfire.distributed.SystemConfigurationProperties.MCAST_PORT; +import static org.junit.Assert.assertEquals; @Category(IntegrationTest.class) public class CacheServiceJUnitTest { @@ -40,7 +33,7 @@ public class CacheServiceJUnitTest { @Before public void setUp() { - cache = (GemFireCacheImpl) new CacheFactory().set("mcast-port", "0").create(); + cache = (GemFireCacheImpl) new CacheFactory().set(MCAST_PORT, "0").create(); } @After http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/70612010/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ClearDAckDUnitTest.java ---------------------------------------------------------------------- diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ClearDAckDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ClearDAckDUnitTest.java index 95a4969..bb0e02d 100644 --- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ClearDAckDUnitTest.java +++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ClearDAckDUnitTest.java @@ -21,27 +21,13 @@ */ package com.gemstone.gemfire.internal.cache; -import java.util.Properties; - -import com.gemstone.gemfire.cache.AttributesFactory; -import com.gemstone.gemfire.cache.Cache; -import com.gemstone.gemfire.cache.CacheException; -import com.gemstone.gemfire.cache.CacheFactory; -import com.gemstone.gemfire.cache.CacheTransactionManager; -import com.gemstone.gemfire.cache.DataPolicy; -import com.gemstone.gemfire.cache.Region; -import com.gemstone.gemfire.cache.RegionAttributes; -import com.gemstone.gemfire.cache.RegionEvent; -import com.gemstone.gemfire.cache.Scope; +import com.gemstone.gemfire.cache.*; import com.gemstone.gemfire.distributed.DistributedMember; import com.gemstone.gemfire.distributed.DistributedSystem; import com.gemstone.gemfire.internal.cache.versions.VersionSource; -import com.gemstone.gemfire.test.dunit.DistributedTestCase; -import com.gemstone.gemfire.test.dunit.Host; -import com.gemstone.gemfire.test.dunit.Invoke; -import com.gemstone.gemfire.test.dunit.LogWriterUtils; -import com.gemstone.gemfire.test.dunit.SerializableRunnable; -import com.gemstone.gemfire.test.dunit.VM; +import com.gemstone.gemfire.test.dunit.*; + +import java.util.Properties; /** * @@ -101,7 +87,7 @@ public class ClearDAckDUnitTest extends DistributedTestCase { public static DistributedMember createCacheVM0() { try{ - // props.setProperty("mcast-port", "1234"); + // props.setProperty(DistributionConfig.SystemConfigurationProperties.MCAST_PORT, "1234"); // ds = DistributedSystem.connect(props); LogWriterUtils.getLogWriter().info("I am vm0"); ds = (new ClearDAckDUnitTest("temp")).getSystem(props); @@ -126,7 +112,7 @@ public class ClearDAckDUnitTest extends DistributedTestCase { } //end of create cache for VM0 public static DistributedMember createCacheVM1(){ try{ - // props.setProperty("mcast-port", "1234"); + // props.setProperty(DistributionConfig.SystemConfigurationProperties.MCAST_PORT, "1234"); // ds = DistributedSystem.connect(props); LogWriterUtils.getLogWriter().info("I am vm1"); ds = (new ClearDAckDUnitTest("temp")).getSystem(props); @@ -155,7 +141,7 @@ public class ClearDAckDUnitTest extends DistributedTestCase { public static void createCacheVM2AndLocalClear(){ try{ - // props.setProperty("mcast-port", "1234"); + // props.setProperty(DistributionConfig.SystemConfigurationProperties.MCAST_PORT, "1234"); // ds = DistributedSystem.connect(props); LogWriterUtils.getLogWriter().info("I am vm2"); ds = (new ClearDAckDUnitTest("temp")).getSystem(props); http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/70612010/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ClientMessagesRegionCreationAndDestroyJUnitTest.java ---------------------------------------------------------------------- diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ClientMessagesRegionCreationAndDestroyJUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ClientMessagesRegionCreationAndDestroyJUnitTest.java index e0cde11..67fd72c 100755 --- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ClientMessagesRegionCreationAndDestroyJUnitTest.java +++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ClientMessagesRegionCreationAndDestroyJUnitTest.java @@ -16,20 +16,6 @@ */ package com.gemstone.gemfire.internal.cache; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertTrue; - -import java.io.IOException; -import java.util.HashSet; -import java.util.Iterator; -import java.util.Properties; - -import org.junit.After; -import org.junit.Before; -import org.junit.Test; -import org.junit.experimental.categories.Category; - import com.gemstone.gemfire.cache.Cache; import com.gemstone.gemfire.cache.CacheException; import com.gemstone.gemfire.cache.CacheFactory; @@ -39,6 +25,18 @@ import com.gemstone.gemfire.internal.AvailablePort; import com.gemstone.gemfire.internal.cache.ha.HAContainerWrapper; import com.gemstone.gemfire.internal.cache.ha.HARegionQueue; import com.gemstone.gemfire.test.junit.categories.IntegrationTest; +import org.junit.After; +import org.junit.Before; +import org.junit.Test; +import org.junit.experimental.categories.Category; + +import java.io.IOException; +import java.util.HashSet; +import java.util.Iterator; +import java.util.Properties; + +import static com.gemstone.gemfire.distributed.SystemConfigurationProperties.MCAST_PORT; +import static org.junit.Assert.*; /** * Test to verify that each bridge sever creates its own client_messages_region @@ -165,7 +163,7 @@ public class ClientMessagesRegionCreationAndDestroyJUnitTest { private Cache createCache() throws CacheException { Properties p = new Properties(); - p.put("mcast-port", "0"); + p.put(MCAST_PORT, "0"); return CacheFactory.create(DistributedSystem.connect(p)); } http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/70612010/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ClientServerGetAllDUnitTest.java ---------------------------------------------------------------------- diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ClientServerGetAllDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ClientServerGetAllDUnitTest.java index e424011..8da507b 100755 --- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ClientServerGetAllDUnitTest.java +++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/ClientServerGetAllDUnitTest.java @@ -16,21 +16,7 @@ */ package com.gemstone.gemfire.internal.cache; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collection; -import java.util.Iterator; -import java.util.Map; -import java.util.Properties; - -import com.gemstone.gemfire.cache.AttributesFactory; -import com.gemstone.gemfire.cache.Cache; -import com.gemstone.gemfire.cache.CacheException; -import com.gemstone.gemfire.cache.DataPolicy; -import com.gemstone.gemfire.cache.LoaderHelper; -import com.gemstone.gemfire.cache.PartitionAttributesFactory; -import com.gemstone.gemfire.cache.Region; -import com.gemstone.gemfire.cache.Scope; +import com.gemstone.gemfire.cache.*; import com.gemstone.gemfire.cache.client.PoolFactory; import com.gemstone.gemfire.cache.client.PoolManager; import com.gemstone.gemfire.cache.server.CacheServer; @@ -40,13 +26,12 @@ import com.gemstone.gemfire.distributed.internal.DistributionConfig; import com.gemstone.gemfire.internal.AvailablePort; import com.gemstone.gemfire.internal.AvailablePortHelper; import com.gemstone.gemfire.internal.offheap.MemoryAllocatorImpl; -import com.gemstone.gemfire.test.dunit.Assert; -import com.gemstone.gemfire.test.dunit.AsyncInvocation; -import com.gemstone.gemfire.test.dunit.DistributedTestUtils; -import com.gemstone.gemfire.test.dunit.Host; -import com.gemstone.gemfire.test.dunit.IgnoredException; -import com.gemstone.gemfire.test.dunit.NetworkUtils; -import com.gemstone.gemfire.test.dunit.VM; +import com.gemstone.gemfire.test.dunit.*; + +import java.util.*; + +import static com.gemstone.gemfire.distributed.SystemConfigurationProperties.LOCATORS; +import static com.gemstone.gemfire.distributed.SystemConfigurationProperties.MCAST_PORT; /** * Class ClientServerGetAllDUnitTest test client/server getAll. @@ -668,7 +653,7 @@ import com.gemstone.gemfire.test.dunit.VM; public void run2() throws CacheException { // Create DS Properties config = new Properties(); - config.setProperty("locators", "localhost["+DistributedTestUtils.getDUnitLocatorPort()+"]"); + config.setProperty(LOCATORS, "localhost[" + DistributedTestUtils.getDUnitLocatorPort() + "]"); if (offheap) { config.setProperty(DistributionConfig.OFF_HEAP_MEMORY_SIZE_NAME, "350m"); } @@ -732,7 +717,7 @@ import com.gemstone.gemfire.test.dunit.VM; public void run2() throws CacheException { // Create DS Properties config = new Properties(); - config.setProperty("locators", "localhost["+DistributedTestUtils.getDUnitLocatorPort()+"]"); + config.setProperty(LOCATORS, "localhost[" + DistributedTestUtils.getDUnitLocatorPort() + "]"); getSystem(config); // Create Region @@ -767,8 +752,8 @@ import com.gemstone.gemfire.test.dunit.VM; public void run2() throws CacheException { // Create DS Properties config = new Properties(); - config.setProperty(DistributionConfig.MCAST_PORT_NAME, "0"); - config.setProperty(DistributionConfig.LOCATORS_NAME, ""); + config.setProperty(MCAST_PORT, "0"); + config.setProperty(LOCATORS, ""); getSystem(config); // Create Region