Reset ClusterAwareCondition.

This commit is contained in:
John Blum
2020-06-09 15:20:08 -07:00
parent 1501d7fac6
commit f83880ea97
5 changed files with 30 additions and 2 deletions

View File

@@ -17,6 +17,7 @@ package org.springframework.geode.boot.autoconfigure.cluster;
import static org.assertj.core.api.Assertions.assertThat;
import org.junit.AfterClass;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -28,6 +29,7 @@ import org.springframework.core.env.Environment;
import org.springframework.data.gemfire.config.annotation.ClusterConfigurationConfiguration;
import org.springframework.data.gemfire.tests.integration.IntegrationTestsSupport;
import org.springframework.data.gemfire.tests.mock.annotation.EnableGemFireMockObjects;
import org.springframework.geode.config.annotation.ClusterAwareConfiguration;
import org.springframework.geode.config.annotation.EnableClusterAware;
import org.springframework.geode.core.util.ObjectUtils;
import org.springframework.test.context.ActiveProfiles;
@@ -59,6 +61,11 @@ import org.springframework.test.context.junit4.SpringRunner;
public class ClusterConfigurationWithClusterAwareWhenNonSecureClusterAvailableIntegrationTests
extends IntegrationTestsSupport {
@AfterClass
public static void resetClusterAwareCondition() {
ClusterAwareConfiguration.ClusterAwareCondition.reset();
}
@Autowired
private Environment environment;

View File

@@ -17,6 +17,7 @@ package org.springframework.geode.boot.autoconfigure.cluster;
import static org.assertj.core.api.Assertions.assertThat;
import org.junit.AfterClass;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -28,6 +29,7 @@ import org.springframework.core.env.Environment;
import org.springframework.data.gemfire.config.annotation.ClusterConfigurationConfiguration;
import org.springframework.data.gemfire.tests.integration.IntegrationTestsSupport;
import org.springframework.data.gemfire.tests.mock.annotation.EnableGemFireMockObjects;
import org.springframework.geode.config.annotation.ClusterAwareConfiguration;
import org.springframework.geode.config.annotation.EnableClusterAware;
import org.springframework.geode.core.util.ObjectUtils;
import org.springframework.test.context.ActiveProfiles;
@@ -63,6 +65,11 @@ import org.springframework.test.context.junit4.SpringRunner;
public class ClusterConfigurationWithClusterAwareWhenSecureClusterAvailableIntegrationTests
extends IntegrationTestsSupport {
@AfterClass
public static void resetClusterAwareCondition() {
ClusterAwareConfiguration.ClusterAwareCondition.reset();
}
@Autowired
private Environment environment;

View File

@@ -46,6 +46,7 @@ import org.springframework.data.gemfire.tests.process.ProcessWrapper;
import org.springframework.data.gemfire.tests.util.FileSystemUtils;
import org.springframework.data.gemfire.tests.util.FileUtils;
import org.springframework.geode.boot.autoconfigure.DataImportExportAutoConfiguration;
import org.springframework.geode.config.annotation.ClusterAwareConfiguration;
import org.springframework.geode.config.annotation.EnableClusterAware;
import example.app.golf.model.Golfer;
@@ -72,6 +73,11 @@ public class CacheDataExportAutoConfigurationIntegrationTests extends ForkingCli
private static final String DATA_GOLFERS_JSON = "data-golfers.json";
@BeforeClass @AfterClass
public static void resetClusterAwareCondition() {
ClusterAwareConfiguration.ClusterAwareCondition.reset();
}
@BeforeClass
public static void runGeodeProcess() throws IOException {

View File

@@ -26,6 +26,7 @@ import java.util.Set;
import java.util.stream.Collectors;
import java.util.stream.StreamSupport;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
@@ -43,6 +44,7 @@ import org.springframework.data.gemfire.config.annotation.CacheServerApplication
import org.springframework.data.gemfire.config.annotation.EnableEntityDefinedRegions;
import org.springframework.data.gemfire.tests.integration.ForkingClientServerIntegrationTestsSupport;
import org.springframework.geode.boot.autoconfigure.DataImportExportAutoConfiguration;
import org.springframework.geode.config.annotation.ClusterAwareConfiguration;
import org.springframework.geode.config.annotation.EnableClusterAware;
import org.springframework.geode.core.util.ObjectUtils;
import org.springframework.geode.util.CacheUtils;
@@ -88,6 +90,11 @@ import example.app.books.model.ISBN;
public class ClientCacheDataImportExportAutoConfigurationIntegrationTests
extends ForkingClientServerIntegrationTestsSupport {
@AfterClass
public static void resetClusterAwareCondition() {
ClusterAwareConfiguration.ClusterAwareCondition.reset();
}
@BeforeClass
public static void startGeodeServer() throws IOException {
startGemFireServer(TestGeodeServerConfiguration.class,"-Dspring.profiles.active=IMPORT-SERVER");

View File

@@ -23,6 +23,7 @@ import java.util.concurrent.atomic.AtomicReference;
import javax.annotation.Resource;
import javax.servlet.http.HttpSession;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
@@ -88,8 +89,8 @@ public class AutoConfiguredSessionLocalCachingIntegrationTests extends Integrati
private static final String HTTP_HEADER_AUTHENTICATION_INFO = "Authentication-Info";
@BeforeClass
public static void cleanClusterAwareState() {
@BeforeClass @AfterClass
public static void resetClusterAwareCondition() {
ClusterAwareConfiguration.ClusterAwareCondition.reset();
}