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 7B2E2200B92 for ; Tue, 13 Sep 2016 21:11:58 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 7A000160AAA; Tue, 13 Sep 2016 19:11:58 +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 31715160AD3 for ; Tue, 13 Sep 2016 21:11:57 +0200 (CEST) Received: (qmail 10698 invoked by uid 500); 13 Sep 2016 19:11:56 -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 10689 invoked by uid 99); 13 Sep 2016 19:11:56 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 13 Sep 2016 19:11:56 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id C9D93180672 for ; Tue, 13 Sep 2016 19:11:55 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-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 mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id HGHkAyU53z91 for ; Tue, 13 Sep 2016 19:11:54 +0000 (UTC) Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with SMTP id 0824E60E46 for ; Tue, 13 Sep 2016 19:11:49 +0000 (UTC) Received: (qmail 8502 invoked by uid 99); 13 Sep 2016 19:11:48 -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; Tue, 13 Sep 2016 19:11:48 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id CA586E1075; Tue, 13 Sep 2016 19:11:48 +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: Tue, 13 Sep 2016 19:12:13 -0000 Message-Id: In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [26/50] [abbrv] incubator-geode git commit: GEODE-420: Fixing locators property configuration archived-at: Tue, 13 Sep 2016 19:11:58 -0000 GEODE-420: Fixing locators property configuration Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/a455526b Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/a455526b Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/a455526b Branch: refs/heads/develop Commit: a455526b858dc949d056feedf6ca18d4db000e3c Parents: 1cc8d4e Author: Udo Kohlmeyer Authored: Fri Aug 26 05:09:41 2016 +1000 Committer: Udo Kohlmeyer Committed: Fri Aug 26 05:09:41 2016 +1000 ---------------------------------------------------------------------- .../gemfire/management/JMXMBeanDUnitTest.java | 8 ++-- .../rules/LocatorServerConfigurationRule.java | 42 ++++++++------------ 2 files changed, 22 insertions(+), 28 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/a455526b/geode-core/src/test/java/com/gemstone/gemfire/management/JMXMBeanDUnitTest.java ---------------------------------------------------------------------- diff --git a/geode-core/src/test/java/com/gemstone/gemfire/management/JMXMBeanDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/management/JMXMBeanDUnitTest.java index 022bfee..bc90ee0 100644 --- a/geode-core/src/test/java/com/gemstone/gemfire/management/JMXMBeanDUnitTest.java +++ b/geode-core/src/test/java/com/gemstone/gemfire/management/JMXMBeanDUnitTest.java @@ -37,7 +37,6 @@ import javax.management.remote.JMXServiceURL; import javax.rmi.ssl.SslRMIClientSocketFactory; import org.junit.Before; -import org.junit.Ignore; import org.junit.Rule; import org.junit.Test; import org.junit.experimental.categories.Category; @@ -133,10 +132,10 @@ public class JMXMBeanDUnitTest extends DistributedTestCase { // To be fixed in GEODE-1716 public void testJMXOverLegacySSL() throws Exception { Properties properties = configureLocatorProperties(new Properties(), jmxPort, serverHostName, true, true, false); -// locator.invoke("Configure and start Locator", () -> { + locator.invoke("Configure and start Locator", () -> { System.setProperty("javax.ssl.debug", "true"); configureAndStartLocator(locatorPort, jmxPort, serverHostName, properties); -// }); + }); jmxClient.invoke("Configure and start JMX Client", () -> { System.setProperty("javax.ssl.debug", "true"); @@ -177,6 +176,9 @@ public class JMXMBeanDUnitTest extends DistributedTestCase { System.setProperty("javax.net.ssl.trustStore", useMulti ? getMultiKeyTruststore() : getSimpleSingleKeyKeystore()); System.setProperty("javax.net.ssl.trustStoreType", "JKS"); System.setProperty("javax.net.ssl.trustStorePassword", "password"); +// System.setProperty("com.sun.management.jmxremote.ssl.need.client.auth", "true"); +// System.setProperty("com.sun.management.jmxremote.ssl", "true"); +// System.setProperty("com.sun.management.jmxremote.registry.ssl", "true"); environment.put("com.sun.jndi.rmi.factory.socket", new SslRMIClientSocketFactory()); } http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/a455526b/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/rules/LocatorServerConfigurationRule.java ---------------------------------------------------------------------- diff --git a/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/rules/LocatorServerConfigurationRule.java b/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/rules/LocatorServerConfigurationRule.java index 3855412..d6a14a4 100644 --- a/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/rules/LocatorServerConfigurationRule.java +++ b/geode-core/src/test/java/com/gemstone/gemfire/test/dunit/rules/LocatorServerConfigurationRule.java @@ -17,15 +17,11 @@ package com.gemstone.gemfire.test.dunit.rules; -import static com.gemstone.gemfire.distributed.ConfigurationProperties.ENABLE_CLUSTER_CONFIGURATION; -import static com.gemstone.gemfire.distributed.ConfigurationProperties.LOCATORS; -import static com.gemstone.gemfire.distributed.ConfigurationProperties.MCAST_PORT; -import static com.gemstone.gemfire.internal.AvailablePortHelper.getRandomAvailableTCPPorts; -import static com.gemstone.gemfire.test.dunit.Host.getHost; -import static com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase.disconnectAllFromDS; -import static com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase.disconnectFromDS; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertTrue; +import static com.gemstone.gemfire.distributed.ConfigurationProperties.*; +import static com.gemstone.gemfire.internal.AvailablePortHelper.*; +import static com.gemstone.gemfire.test.dunit.Host.*; +import static com.gemstone.gemfire.test.dunit.internal.JUnit4DistributedTestCase.*; +import static org.junit.Assert.*; import java.io.IOException; import java.io.Serializable; @@ -34,6 +30,7 @@ import java.net.UnknownHostException; import java.util.Properties; import java.util.concurrent.TimeUnit; +import com.jayway.awaitility.Awaitility; import org.junit.rules.ExternalResource; import com.gemstone.gemfire.distributed.Locator; @@ -41,16 +38,14 @@ import com.gemstone.gemfire.distributed.internal.InternalLocator; import com.gemstone.gemfire.test.dunit.Host; import com.gemstone.gemfire.test.dunit.VM; import com.gemstone.gemfire.test.dunit.cache.internal.JUnit4CacheTestCase; -import com.jayway.awaitility.Awaitility; -public class LocatorServerConfigurationRule extends ExternalResource implements - Serializable { +public class LocatorServerConfigurationRule extends ExternalResource implements Serializable { private int locatorPort = 0; - + private boolean locatorInitialized = false; - + private JUnit4CacheTestCase testCase; public LocatorServerConfigurationRule(JUnit4CacheTestCase testCase) { @@ -75,9 +70,10 @@ public class LocatorServerConfigurationRule extends ExternalResource implements /** * Returns getHost(0).getVM(0) as a locator instance with the given * configuration properties. - * * @param locatorProperties + * * @return VM locator vm + * * @throws IOException */ public VM getLocatorVM(Properties locatorProperties) throws IOException { @@ -88,10 +84,9 @@ public class LocatorServerConfigurationRule extends ExternalResource implements /** * Returns a node VM with given configuration properties. - * - * @param index - * valid 1 to 3 (returns getHist(0).getVM(index) + * @param index valid 1 to 3 (returns getHist(0).getVM(index) * @param nodeProperties + * * @return VM node vm */ public VM getNodeVM(int index, Properties nodeProperties) { @@ -111,14 +106,12 @@ public class LocatorServerConfigurationRule extends ExternalResource implements } locatorPort = locator.invoke(() -> { - InternalLocator locator = (InternalLocator)Locator.startLocatorAndDS(0, - null, locatorProperties); + InternalLocator locator = (InternalLocator) Locator.startLocatorAndDS(0, null, locatorProperties); locatorPort = locator.getPort(); locator.resetInternalLocatorFileNamesWithCorrectPortNumber(locatorPort); if (locatorProperties.containsKey(ENABLE_CLUSTER_CONFIGURATION)) { - Awaitility.await().atMost(65, TimeUnit.SECONDS) - .until(() -> assertTrue(locator.isSharedConfigurationRunning())); + Awaitility.await().atMost(65, TimeUnit.SECONDS).until(() -> assertTrue(locator.isSharedConfigurationRunning())); } return locatorPort; }); @@ -129,7 +122,7 @@ public class LocatorServerConfigurationRule extends ExternalResource implements props.setProperty(MCAST_PORT, "0"); } - props.setProperty(LOCATORS, getHostName() + ":" + locatorPort); + props.setProperty(LOCATORS, getHostName() + "[" + locatorPort + "]"); nodeVM.invoke(() -> { testCase.getSystem(props); @@ -140,8 +133,7 @@ public class LocatorServerConfigurationRule extends ExternalResource implements private String getHostName() { try { return InetAddress.getLocalHost().getHostName(); - } - catch (UnknownHostException ignore) { + } catch (UnknownHostException ignore) { return "localhost"; } }