From c7c593489ec075ac12cde7c6de1e1d242e3b44f7 Mon Sep 17 00:00:00 2001 From: John Blum Date: Wed, 19 Jul 2017 14:38:52 -0700 Subject: [PATCH] SGF-644 - Adapt to API and scoping/visibility changes in org.apache.geode.distributed.internal.SharedConfiguration class. --- .../data/gemfire/fork/LocatorProcess.java | 30 +++++-------------- 1 file changed, 7 insertions(+), 23 deletions(-) diff --git a/src/test/java/org/springframework/data/gemfire/fork/LocatorProcess.java b/src/test/java/org/springframework/data/gemfire/fork/LocatorProcess.java index d1c331b9..47587ca3 100644 --- a/src/test/java/org/springframework/data/gemfire/fork/LocatorProcess.java +++ b/src/test/java/org/springframework/data/gemfire/fork/LocatorProcess.java @@ -25,7 +25,6 @@ import org.apache.geode.distributed.Locator; import org.apache.geode.distributed.LocatorLauncher; import org.apache.geode.distributed.internal.DistributionConfig; import org.apache.geode.distributed.internal.InternalLocator; -import org.apache.geode.distributed.internal.SharedConfiguration; import org.springframework.data.gemfire.GemfireUtils; import org.springframework.data.gemfire.process.support.ProcessUtils; import org.springframework.data.gemfire.test.support.FileSystemUtils; @@ -141,32 +140,12 @@ public class LocatorProcess { Locator locator = GemfireUtils.getLocator(); if (locator != null) { - stopClusterConfigurationService(locator).stop(); + locator.stop(); } })); } - private static boolean isClusterConfigurationEnabled(Locator locator) { - return (locator instanceof InternalLocator && Boolean.valueOf( - locator.getDistributedSystem().getProperties().getProperty( - DistributionConfig.ENABLE_CLUSTER_CONFIGURATION_NAME))); - } - - private static Locator stopClusterConfigurationService(Locator locator) { - if (isClusterConfigurationEnabled(locator)) { - SharedConfiguration sharedConfiguration = ((InternalLocator) locator).getSharedConfiguration(); - - if (sharedConfiguration != null) { - if (Boolean.valueOf(getProperty("spring.data.gemfire.fork.clean", Boolean.TRUE.toString()))) { - sharedConfiguration.destroySharedConfiguration(); - } - } - } - - return locator; - } - - private static void waitForLocatorStart(long milliseconds) { + private static void waitForLocatorStart(final long milliseconds) { InternalLocator locator = InternalLocator.getLocator(); if (isClusterConfigurationEnabled(locator)) { @@ -177,4 +156,9 @@ public class LocatorProcess { milliseconds, Math.min(500L, milliseconds), TimeUnit.MILLISECONDS); } } + + private static boolean isClusterConfigurationEnabled(final InternalLocator locator) { + return (locator != null && Boolean.valueOf(locator.getDistributedSystem().getProperties().getProperty( + DistributionConfig.ENABLE_CLUSTER_CONFIGURATION_NAME))); + } }