Remove o.s.d.g.support.GemfireBeanFactoryLocatorProxy extension class.

Replace references to o.s.d.gemfire.support.GemfireBeanFactoryLocatorProxy with SDG's o.s.d.g.support.GemfireBeanFactoryLocator.
This commit is contained in:
John Blum
2018-06-12 22:32:03 -07:00
parent 0192141d27
commit 9ef2ca4bd4
4 changed files with 6 additions and 55 deletions

View File

@@ -29,7 +29,7 @@ import org.springframework.core.io.ClassPathResource;
import org.springframework.data.gemfire.config.annotation.CacheServerApplication;
import org.springframework.data.gemfire.config.annotation.EnableLocator;
import org.springframework.data.gemfire.config.annotation.EnableLogging;
import org.springframework.data.gemfire.support.GemfireBeanFactoryLocatorProxy;
import org.springframework.data.gemfire.support.GemfireBeanFactoryLocator;
import org.springframework.geode.boot.autoconfigure.security.auth.AbstractAutoConfiguredSecurityContextIntegrationTests;
import org.springframework.test.annotation.DirtiesContext;
import org.springframework.test.context.junit4.SpringRunner;
@@ -76,7 +76,7 @@ public class AutoConfiguredCloudSecurityContextIntegrationTests
loadVcapApplicationProperties();
GemfireBeanFactoryLocatorProxy.clear();
GemfireBeanFactoryLocator.clear();
}
public static void loadVcapApplicationProperties() throws IOException {
@@ -89,10 +89,7 @@ public class AutoConfiguredCloudSecurityContextIntegrationTests
@AfterClass
public static void cleanUpUsedResources() {
vcapApplicationProperties.stringPropertyNames().forEach(System::clearProperty);
GemfireBeanFactoryLocatorProxy.clear();
}
@SpringBootApplication

View File

@@ -18,7 +18,6 @@ package org.springframework.geode.boot.autoconfigure.security.auth.local;
import java.io.IOException;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.runner.RunWith;
import org.springframework.boot.SpringApplication;
@@ -27,7 +26,7 @@ import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.context.annotation.Import;
import org.springframework.data.gemfire.config.annotation.CacheServerApplication;
import org.springframework.data.gemfire.config.annotation.EnableLogging;
import org.springframework.data.gemfire.support.GemfireBeanFactoryLocatorProxy;
import org.springframework.data.gemfire.support.GemfireBeanFactoryLocator;
import org.springframework.data.gemfire.tests.integration.config.ClientServerIntegrationTestsConfiguration;
import org.springframework.geode.boot.autoconfigure.security.auth.AbstractAutoConfiguredSecurityContextIntegrationTests;
import org.springframework.test.annotation.DirtiesContext;
@@ -71,17 +70,12 @@ public class AutoConfiguredLocalSecurityContextIntegrationTests
@BeforeClass
public static void startGemFireServer() throws IOException {
GemfireBeanFactoryLocatorProxy.clear();
GemfireBeanFactoryLocator.clear();
startGemFireServer(GemFireServerConfiguration.class,
"-Dspring.profiles.active=security-local-server");
}
@AfterClass
public static void cleanUpBeanFactoryLocatorReferences() {
GemfireBeanFactoryLocatorProxy.clear();
}
@SpringBootApplication
@EnableLogging(logLevel = GEMFIRE_LOG_LEVEL)
@Import(ClientServerIntegrationTestsConfiguration.class)

View File

@@ -1,40 +0,0 @@
/*
* Copyright 2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
* or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
package org.springframework.data.gemfire.support;
import org.springframework.beans.factory.BeanFactory;
/**
* The {@link GemfireBeanFactoryLocatorProxy} class is an extension of {@link GemfireBeanFactoryLocator}
* used to clean up all Spring {@link BeanFactory} references, which are stored throughout the runtime
* of an application for different purposes, like configuration of non-Spring managed components.
*
* @author John Blum
* @see org.springframework.beans.factory.BeanFactory
* @see org.springframework.data.gemfire.support.GemfireBeanFactoryLocator
* @since 1.0.0
*/
// TODO: remove this class and refactor the SDG GemfireBeanFactoryLocator!
public class GemfireBeanFactoryLocatorProxy extends GemfireBeanFactoryLocator {
/**
* Clear all {@link BeanFactory} references stored during application runtime.
*/
public static void clear() {
BEAN_FACTORIES.clear();
}
}

View File

@@ -28,7 +28,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.data.gemfire.config.annotation.EnableSecurity;
import org.springframework.data.gemfire.config.annotation.PeerCacheApplication;
import org.springframework.data.gemfire.support.GemfireBeanFactoryLocatorProxy;
import org.springframework.data.gemfire.support.GemfireBeanFactoryLocator;
import org.springframework.data.gemfire.tests.integration.IntegrationTestsSupport;
import org.springframework.data.gemfire.tests.mock.annotation.EnableGemFireMockObjects;
import org.springframework.geode.core.util.ObjectUtils;
@@ -64,7 +64,7 @@ public class SecurityManagerProxyIntegrationTests extends IntegrationTestsSuppor
@AfterClass
public static void cleanUpBeanFactoryLocatorReferences() throws Exception {
GemfireBeanFactoryLocatorProxy.clear();
GemfireBeanFactoryLocator.clear();
ObjectUtils.doOperationSafely(() -> {
SecurityManagerProxy.getInstance().destroy();