Remove the 'geode.home' System property configuration in Integration Tests.

The 'geode.home' System property configuration was used to resolve the Apache Geode Management (Admin) REST API interface WAR file, which is not resolved the application / test runtime classpath.
This commit is contained in:
John Blum
2022-01-31 14:37:00 -08:00
parent 75b37bbf59
commit 4c399330b5
2 changed files with 3 additions and 32 deletions

View File

@@ -17,7 +17,6 @@ package org.springframework.geode.boot.autoconfigure.cluster.aware;
import static org.assertj.core.api.Assertions.assertThat;
import java.io.File;
import java.io.IOException;
import java.security.KeyStore;
import java.util.List;
@@ -64,7 +63,6 @@ import org.springframework.data.gemfire.tests.integration.ForkingClientServerInt
import org.springframework.geode.config.annotation.ClusterAwareConfiguration;
import org.springframework.geode.config.annotation.EnableClusterAware;
import org.springframework.geode.security.TestSecurityManager;
import org.springframework.geode.util.GeodeConstants;
import org.springframework.http.client.HttpComponentsClientHttpRequestFactory;
import org.springframework.lang.NonNull;
import org.springframework.test.annotation.DirtiesContext;
@@ -119,8 +117,9 @@ public class SecureClusterAwareConfigurationIntegrationTests extends ForkingClie
@BeforeClass
public static void startGeodeServer() throws IOException {
startGemFireServer(TestGeodeServerConfiguration.class,
"-Dspring.profiles.active=cluster-aware-with-secure-server,ssl");
//startGemFireServer(TestGeodeServerConfiguration.class,
// "-Dspring.profiles.active=cluster-aware-with-secure-server,ssl",
// "-Dapache-geode.logback.log.level=INFO");
}
@BeforeClass @AfterClass
@@ -215,27 +214,14 @@ public class SecureClusterAwareConfigurationIntegrationTests extends ForkingClie
@Profile("cluster-aware-with-secure-server")
static class TestGeodeServerConfiguration {
private static final String GEODE_HOME_PROPERTY = GeodeConstants.GEMFIRE_PROPERTY_PREFIX + "home";
public static void main(String[] args) throws IOException {
resolveAndConfigureGeodeHome();
new SpringApplicationBuilder(TestGeodeServerConfiguration.class)
.web(WebApplicationType.NONE)
.build()
.run(args);
}
private static void resolveAndConfigureGeodeHome() throws IOException {
ClassPathResource resource = new ClassPathResource("/geode-home");
File resourceFile = resource.getFile();
System.setProperty(GEODE_HOME_PROPERTY, resourceFile.getAbsolutePath());
}
@Bean
TestSecurityManager securityManager() {
return new TestSecurityManager();

View File

@@ -17,7 +17,6 @@ package org.springframework.geode.boot.autoconfigure.cluster.config;
import static org.assertj.core.api.Assertions.assertThat;
import java.io.File;
import java.io.IOException;
import java.net.URI;
import java.util.List;
@@ -43,7 +42,6 @@ import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Profile;
import org.springframework.core.io.ClassPathResource;
import org.springframework.data.gemfire.GemfireTemplate;
import org.springframework.data.gemfire.GemfireUtils;
import org.springframework.data.gemfire.config.annotation.CacheServerApplication;
@@ -186,25 +184,12 @@ public class ClusterConfigurationWithAuthenticationIntegrationTests extends Fork
public static void main(String[] args) throws IOException {
resolveAndConfigureGeodeHome();
//System.err.printf("%s [%s]%n", GEODE_HOME_PROPERTY, System.getProperty(GEODE_HOME_PROPERTY));
new SpringApplicationBuilder(GeodeServerConfiguration.class)
.web(WebApplicationType.NONE)
.build()
.run(args);
}
private static void resolveAndConfigureGeodeHome() throws IOException {
ClassPathResource resource = new ClassPathResource("/geode-home");
File resourceFile = resource.getFile();
System.setProperty(GEODE_HOME_PROPERTY, resourceFile.getAbsolutePath());
}
@Bean
org.apache.geode.security.SecurityManager testSecurityManager() {
return new TestSecurityManager();