Declare explicit GemFire/Geode logging configuration for all tests in test resources application.properties.

Remove @EnableLogging annotation and 'logLevel' attriubute (e.g. on @ClientCacheApplication/@CacheServerApplication annotations) logging configuration from all test classes.
This commit is contained in:
John Blum
2020-05-19 16:51:07 -07:00
parent fc80371cfd
commit 22aaead3cb
16 changed files with 77 additions and 109 deletions

View File

@@ -38,7 +38,6 @@ import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;
import org.springframework.data.gemfire.config.annotation.ClientCacheApplication;
import org.springframework.data.gemfire.config.annotation.ClientCacheConfigurer;
import org.springframework.data.gemfire.config.annotation.EnableLogging;
import org.springframework.data.gemfire.config.annotation.EnablePool;
import org.springframework.data.gemfire.config.annotation.PoolConfigurer;
import org.springframework.data.gemfire.tests.integration.SpringBootApplicationIntegrationTestsSupport;
@@ -53,7 +52,7 @@ import org.springframework.data.gemfire.tests.mock.annotation.EnableGemFireMockO
* @see org.apache.geode.cache.client.ClientCache
* @see org.apache.geode.cache.client.Pool
* @see org.apache.geode.cache.client.PoolManager
* @see org.springframework.boot.autoconfigure.SpringBootApplication
* @see org.springframework.boot.autoconfigure.EnableAutoConfiguration
* @see org.springframework.context.ConfigurableApplicationContext
* @see org.springframework.data.gemfire.config.annotation.ClientCacheApplication
* @see org.springframework.data.gemfire.config.annotation.ClientCacheConfigurer
@@ -68,7 +67,6 @@ import org.springframework.data.gemfire.tests.mock.annotation.EnableGemFireMockO
public class ClientCachePoolCustomizationsIntegrationTests extends SpringBootApplicationIntegrationTestsSupport {
private static final String DEFAULT_POOL_NAME = "DEFAULT";
private static final String GEMFIRE_LOG_LEVEL = "off";
private static final String SPRING_DATA_GEMFIRE_PROPERTY_PREFIX = "spring.data.gemfire.";
@BeforeClass @AfterClass
@@ -267,7 +265,6 @@ public class ClientCachePoolCustomizationsIntegrationTests extends SpringBootApp
@Configuration
@EnableAutoConfiguration
@EnableGemFireMockObjects
@EnableLogging(logLevel = GEMFIRE_LOG_LEVEL)
static class WithAutoConfiguredClientCacheConfiguration { }
@ClientCacheApplication(serverGroup = "TestServerGroup", threadLocalConnections = true)

View File

@@ -34,7 +34,6 @@ import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.context.annotation.Bean;
import org.springframework.data.gemfire.GemfireUtils;
import org.springframework.data.gemfire.client.ClientRegionFactoryBean;
import org.springframework.data.gemfire.config.annotation.EnableLogging;
import org.springframework.data.gemfire.tests.integration.IntegrationTestsSupport;
import org.springframework.data.gemfire.util.RegionUtils;
import org.springframework.test.context.junit4.SpringRunner;
@@ -49,6 +48,8 @@ import org.springframework.test.context.junit4.SpringRunner;
* @see org.apache.geode.cache.client.ClientCache
* @see org.springframework.boot.autoconfigure.SpringBootApplication
* @see org.springframework.boot.test.context.SpringBootTest
* @see org.springframework.context.annotation.Bean
* @see org.springframework.data.gemfire.client.ClientRegionFactoryBean
* @see org.springframework.data.gemfire.tests.integration.IntegrationTestsSupport
* @see org.springframework.geode.boot.autoconfigure.ClientCacheAutoConfiguration
* @see org.springframework.test.context.junit4.SpringRunner
@@ -59,8 +60,6 @@ import org.springframework.test.context.junit4.SpringRunner;
@SuppressWarnings("unused")
public class SpringBootApacheGeodeClientCacheApplicationIntegrationTests extends IntegrationTestsSupport {
private static final String GEMFIRE_LOG_LEVEL = "error";
@Autowired
private ClientCache clientCache;
@@ -83,7 +82,6 @@ public class SpringBootApacheGeodeClientCacheApplicationIntegrationTests extends
}
@SpringBootApplication
@EnableLogging(logLevel = GEMFIRE_LOG_LEVEL)
static class TestConfiguration {
@Bean("Example")
@@ -92,7 +90,6 @@ public class SpringBootApacheGeodeClientCacheApplicationIntegrationTests extends
ClientRegionFactoryBean<Object, Object> clientRegion = new ClientRegionFactoryBean<>();
clientRegion.setCache(gemfireCache);
clientRegion.setClose(false);
clientRegion.setShortcut(ClientRegionShortcut.LOCAL);
return clientRegion;

View File

@@ -27,18 +27,17 @@ import org.junit.runners.MethodSorters;
import org.apache.geode.cache.Region;
import org.apache.geode.cache.client.ClientRegionShortcut;
import org.assertj.core.api.Assertions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.data.gemfire.config.annotation.EnableCachingDefinedRegions;
import org.springframework.data.gemfire.config.annotation.EnableLogging;
import org.springframework.data.gemfire.tests.integration.IntegrationTestsSupport;
import org.springframework.data.gemfire.util.RegionUtils;
import org.springframework.test.annotation.DirtiesContext;
import org.springframework.test.context.junit4.SpringRunner;
import org.assertj.core.api.Assertions;
import example.app.books.NonBeanType;
import example.app.books.model.Book;
import example.app.books.service.support.CachingBookService;
@@ -55,6 +54,7 @@ import example.app.books.service.support.CachingBookService;
* @see org.springframework.data.gemfire.config.annotation.EnableCachingDefinedRegions
* @see org.springframework.data.gemfire.tests.integration.IntegrationTestsSupport
* @see org.springframework.geode.boot.autoconfigure.CachingProviderAutoConfiguration
* @see org.springframework.test.annotation.DirtiesContext
* @see org.springframework.test.context.junit4.SpringRunner
* @since 1.0.0
*/
@@ -65,8 +65,6 @@ import example.app.books.service.support.CachingBookService;
@SuppressWarnings("unused")
public class AutoConfiguredCachingIntegrationTests extends IntegrationTestsSupport {
private static final String GEMFIRE_LOG_LEVEL = "error";
@Autowired
private CachingBookService bookService;
@@ -125,7 +123,6 @@ public class AutoConfiguredCachingIntegrationTests extends IntegrationTestsSuppo
}
@SpringBootApplication(scanBasePackageClasses = NonBeanType.class)
@EnableLogging(logLevel = GEMFIRE_LOG_LEVEL)
@EnableCachingDefinedRegions(clientRegionShortcut = ClientRegionShortcut.LOCAL)
static class TestConfiguration { }

View File

@@ -30,6 +30,7 @@ import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.apache.geode.cache.DataPolicy;
import org.apache.geode.cache.GemFireCache;
import org.apache.geode.cache.Region;
@@ -48,7 +49,6 @@ import org.springframework.data.gemfire.GemfireUtils;
import org.springframework.data.gemfire.config.annotation.CacheServerApplication;
import org.springframework.data.gemfire.config.annotation.EnableClusterConfiguration;
import org.springframework.data.gemfire.config.annotation.EnableEntityDefinedRegions;
import org.springframework.data.gemfire.config.annotation.EnableLogging;
import org.springframework.data.gemfire.config.annotation.EnableManager;
import org.springframework.data.gemfire.tests.integration.ForkingClientServerIntegrationTestsSupport;
import org.springframework.geode.security.TestSecurityManager;
@@ -64,14 +64,23 @@ import example.app.books.model.Book;
import example.app.books.model.ISBN;
/**
* Integration tests testing the SDG {@link EnableClusterConfiguration} annotation functionality
* Integration Tests testing the SDG {@link EnableClusterConfiguration} annotation functionality
* when the GemFire/Geode server is configured with Security (Authentication).
*
* @author John Blum
* @see java.io.File
* @see java.net.URI
* @see org.junit.Test
* @see org.apache.geode.cache.GemFireCache
* @see org.apache.geode.cache.Region
* @see org.springframework.boot.autoconfigure.SpringBootApplication
* @see org.springframework.boot.builder.SpringApplicationBuilder
* @see org.springframework.boot.test.context.SpringBootTest
* @see org.springframework.context.annotation.Bean
* @see org.springframework.context.annotation.Profile
* @see org.springframework.data.gemfire.config.annotation.EnableClusterConfiguration
* @see org.springframework.data.gemfire.tests.integration.ForkingClientServerIntegrationTestsSupport
* @see org.springframework.test.context.ActiveProfiles
* @see org.springframework.test.context.junit4.SpringRunner
* @since 1.0.0
*/
@@ -81,7 +90,6 @@ import example.app.books.model.ISBN;
classes = ClusterConfigurationWithAuthenticationIntegrationTests.GeodeClientConfiguration.class,
webEnvironment = SpringBootTest.WebEnvironment.NONE,
properties = {
"spring.data.gemfire.management.require-https=false",
"spring.data.gemfire.security.username=test",
"spring.data.gemfire.security.password=test"
}
@@ -92,8 +100,6 @@ public class ClusterConfigurationWithAuthenticationIntegrationTests extends Fork
private static final AtomicBoolean REDIRECTING_CLIENT_HTTP_REQUEST_INTERCEPTOR_INVOKED =
new AtomicBoolean(false);
private static final String GEMFIRE_LOG_LEVEL = "off";
@BeforeClass
public static void startGemFireServer() throws IOException {
startGemFireServer(GeodeServerConfiguration.class,
@@ -106,7 +112,12 @@ public class ClusterConfigurationWithAuthenticationIntegrationTests extends Fork
@Before
public void setup() {
assertThat(this.booksTemplate).isNotNull();
assertThat(this.booksTemplate.getRegion()).isNotNull();
assertThat(this.booksTemplate.getRegion().getName()).isEqualTo("Books");
assertThat(this.booksTemplate.getRegion().getAttributes()).isNotNull();
assertThat(this.booksTemplate.getRegion().getAttributes().getDataPolicy()).isEqualTo(DataPolicy.EMPTY);
}
@After
@@ -117,23 +128,22 @@ public class ClusterConfigurationWithAuthenticationIntegrationTests extends Fork
@Test
public void clusterConfigurationAndRegionDataAccessOperationsAreSuccessful() {
Book expetedSeriesOfUnfortunateEvents = Book
.newBook("A Serious of Unfortunate Events")
Book expectedSeriesOfUnfortunateEvents = Book
.newBook("A Series of Unfortunate Events")
.identifiedBy(ISBN.autoGenerated());
this.booksTemplate.put(expetedSeriesOfUnfortunateEvents.getIsbn(), expetedSeriesOfUnfortunateEvents);
this.booksTemplate.put(expectedSeriesOfUnfortunateEvents.getIsbn(), expectedSeriesOfUnfortunateEvents);
Book actualSeriesOfUnfortunateEvents = this.booksTemplate.get(expetedSeriesOfUnfortunateEvents.getIsbn());
Book actualSeriesOfUnfortunateEvents = this.booksTemplate.get(expectedSeriesOfUnfortunateEvents.getIsbn());
assertThat(actualSeriesOfUnfortunateEvents).isNotNull();
assertThat(actualSeriesOfUnfortunateEvents).isEqualTo(expetedSeriesOfUnfortunateEvents);
assertThat(actualSeriesOfUnfortunateEvents).isNotSameAs(expetedSeriesOfUnfortunateEvents);
assertThat(actualSeriesOfUnfortunateEvents).isEqualTo(expectedSeriesOfUnfortunateEvents);
assertThat(actualSeriesOfUnfortunateEvents).isNotSameAs(expectedSeriesOfUnfortunateEvents);
}
@SpringBootApplication
@Profile("cluster-configuration-with-auth-client")
@EnableClusterConfiguration(useHttp = true)
@EnableLogging(logLevel = GEMFIRE_LOG_LEVEL)
@EnableClusterConfiguration(useHttp = true, requireHttps = false)
@EnableEntityDefinedRegions(basePackageClasses = Book.class)
static class GeodeClientConfiguration {
@@ -166,7 +176,7 @@ public class ClusterConfigurationWithAuthenticationIntegrationTests extends Fork
@SpringBootApplication
@Profile("cluster-configuration-with-auth-server")
@CacheServerApplication(name = "ClusterConfigurationWithAuthenticationIntegrationTests", logLevel = GEMFIRE_LOG_LEVEL)
@CacheServerApplication(name = "ClusterConfigurationWithAuthenticationIntegrationTests")
@EnableManager(start = true)
static class GeodeServerConfiguration {

View File

@@ -44,7 +44,6 @@ import org.springframework.data.gemfire.GemfireTemplate;
import org.springframework.data.gemfire.PartitionedRegionFactoryBean;
import org.springframework.data.gemfire.client.ClientRegionFactoryBean;
import org.springframework.data.gemfire.config.annotation.CacheServerApplication;
import org.springframework.data.gemfire.config.annotation.EnableLogging;
import org.springframework.data.gemfire.config.annotation.EnablePdx;
import org.springframework.data.gemfire.tests.integration.ForkingClientServerIntegrationTestsSupport;
import org.springframework.data.gemfire.tests.integration.config.ClientServerIntegrationTestsConfiguration;
@@ -66,7 +65,10 @@ import example.geode.query.cq.event.TemperatureReadingsContinuousQueriesHandler;
* @see org.springframework.boot.test.context.SpringBootTest
* @see org.springframework.context.annotation.AnnotationConfigApplicationContext
* @see org.springframework.context.annotation.Bean
* @see org.springframework.context.annotation.Import
* @see org.springframework.data.gemfire.GemfireTemplate
* @see org.springframework.data.gemfire.config.annotation.CacheServerApplication
* @see org.springframework.data.gemfire.config.annotation.EnablePdx
* @see org.springframework.data.gemfire.tests.integration.ForkingClientServerIntegrationTestsSupport
* @see org.springframework.geode.boot.autoconfigure.ContinuousQueryAutoConfiguration
* @see org.springframework.test.context.junit4.SpringRunner
@@ -82,8 +84,6 @@ import example.geode.query.cq.event.TemperatureReadingsContinuousQueriesHandler;
@SuppressWarnings("unused")
public class AutoConfiguredContinuousQueryIntegrationTests extends ForkingClientServerIntegrationTestsSupport {
private static final String GEMFIRE_LOG_LEVEL = "error";
@BeforeClass
public static void startGemFireServer() throws IOException {
@@ -122,7 +122,6 @@ public class AutoConfiguredContinuousQueryIntegrationTests extends ForkingClient
}
@SpringBootApplication
@EnableLogging(logLevel = GEMFIRE_LOG_LEVEL)
@Import(ClientServerIntegrationTestsConfiguration.class)
public static class GemFireClientConfiguration {
@@ -133,7 +132,6 @@ public class AutoConfiguredContinuousQueryIntegrationTests extends ForkingClient
new ClientRegionFactoryBean<>();
temperatureReadingsRegion.setCache(gemfireCache);
temperatureReadingsRegion.setClose(false);
temperatureReadingsRegion.setShortcut(ClientRegionShortcut.PROXY);
return temperatureReadingsRegion;
@@ -153,7 +151,7 @@ public class AutoConfiguredContinuousQueryIntegrationTests extends ForkingClient
}
@EnablePdx
@CacheServerApplication(name = "AutoConfiguredContinuousQueryIntegrationTests", logLevel = GEMFIRE_LOG_LEVEL)
@CacheServerApplication(name = "AutoConfiguredContinuousQueryIntegrationTestsServer")
public static class GemFireServerConfiguration {
public static void main(String[] args) {
@@ -172,7 +170,6 @@ public class AutoConfiguredContinuousQueryIntegrationTests extends ForkingClient
temperatureReadingsRegion.setCache(gemfireCache);
temperatureReadingsRegion.setCacheLoader(temperatureReadingsLoader());
temperatureReadingsRegion.setClose(false);
temperatureReadingsRegion.setPersistent(false);
return temperatureReadingsRegion;
@@ -208,7 +205,6 @@ public class AutoConfiguredContinuousQueryIntegrationTests extends ForkingClient
temperatureReadings.put(key, TemperatureReading.of(temperature));
}
@SuppressWarnings("all")
private void sleep(long milliseconds) {
try {

View File

@@ -35,7 +35,6 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.context.annotation.Bean;
import org.springframework.data.gemfire.config.annotation.EnableGemFireProperties;
import org.springframework.data.gemfire.config.annotation.EnableLogging;
import org.springframework.data.gemfire.function.annotation.GemfireFunction;
import org.springframework.data.gemfire.tests.integration.IntegrationTestsSupport;
import org.springframework.geode.boot.autoconfigure.function.executions.Calculator;
@@ -53,6 +52,7 @@ import org.springframework.util.Assert;
* @see org.springframework.boot.autoconfigure.SpringBootApplication
* @see org.springframework.boot.test.context.SpringBootTest
* @see org.springframework.context.annotation.Bean
* @see org.springframework.data.gemfire.config.annotation.EnableGemFireProperties
* @see org.springframework.data.gemfire.function.annotation.GemfireFunction
* @see org.springframework.data.gemfire.tests.integration.IntegrationTestsSupport
* @see org.springframework.geode.boot.autoconfigure.function.executions.Calculator
@@ -66,8 +66,6 @@ import org.springframework.util.Assert;
@SuppressWarnings("unused")
public class AutoConfiguredFunctionExecutionsIntegrationTests extends IntegrationTestsSupport {
private static final String GEMFIRE_LOG_LEVEL = "error";
@Autowired
private GemFireCache gemfireCache;
@@ -120,7 +118,6 @@ public class AutoConfiguredFunctionExecutionsIntegrationTests extends Integratio
@SpringBootApplication
@EnableGemFireProperties(groups = "test")
@EnableLogging(logLevel = GEMFIRE_LOG_LEVEL)
static class TestConfiguration {
@Bean

View File

@@ -31,7 +31,6 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.data.gemfire.config.annotation.EnableEntityDefinedRegions;
import org.springframework.data.gemfire.config.annotation.EnableLogging;
import org.springframework.data.gemfire.tests.integration.IntegrationTestsSupport;
import org.springframework.data.gemfire.util.RegionUtils;
import org.springframework.geode.boot.autoconfigure.repository.model.Customer;
@@ -59,8 +58,6 @@ import org.springframework.test.context.junit4.SpringRunner;
@SuppressWarnings("unused")
public class AutoConfiguredRepositoriesIntegrationTests extends IntegrationTestsSupport {
private static final String GEMFIRE_LOG_LEVEL = "error";
@Autowired
private CustomerService customerService;
@@ -101,9 +98,7 @@ public class AutoConfiguredRepositoriesIntegrationTests extends IntegrationTests
}
@SpringBootApplication
@EnableLogging(logLevel = GEMFIRE_LOG_LEVEL)
@EnableEntityDefinedRegions(basePackageClasses = Customer.class,
clientRegionShortcut = ClientRegionShortcut.LOCAL)
@EnableEntityDefinedRegions(basePackageClasses = Customer.class, clientRegionShortcut = ClientRegionShortcut.LOCAL)
static class TestConfiguration { }
}

View File

@@ -29,13 +29,12 @@ import org.springframework.boot.test.context.SpringBootTest;
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.geode.boot.autoconfigure.security.auth.AbstractAutoConfiguredSecurityContextIntegrationTests;
import org.springframework.test.annotation.DirtiesContext;
import org.springframework.test.context.junit4.SpringRunner;
/**
* Integration test testing the auto-configuration of Apache Geode/Pivotal GemFire Security
* Integration Tests testing the auto-configuration of Apache Geode/Pivotal GemFire Security
* authentication/authorization in a cloud, managed context (e.g. Pivotal CloudFoundry)
*
* @author John Blum
@@ -43,12 +42,12 @@ import org.springframework.test.context.junit4.SpringRunner;
* @see java.util.Properties
* @see org.junit.Test
* @see org.apache.geode.cache.GemFireCache
* @see org.springframework.boot.SpringApplication
* @see org.springframework.boot.autoconfigure.SpringBootApplication
* @see org.springframework.boot.builder.SpringApplicationBuilder
* @see org.springframework.boot.test.context.SpringBootTest
* @see org.springframework.core.io.ClassPathResource
* @see org.springframework.data.gemfire.config.annotation.CacheServerApplication
* @see org.springframework.data.gemfire.config.annotation.EnableLocator
* @see org.springframework.data.gemfire.config.annotation.EnableSecurity
* @see org.springframework.geode.boot.autoconfigure.ClientSecurityAutoConfiguration
* @see org.springframework.geode.boot.autoconfigure.PeerSecurityAutoConfiguration
* @see org.springframework.geode.boot.autoconfigure.security.auth.AbstractAutoConfiguredSecurityContextIntegrationTests
@@ -66,7 +65,6 @@ import org.springframework.test.context.junit4.SpringRunner;
public class AutoConfiguredCloudSecurityContextIntegrationTests
extends AbstractAutoConfiguredSecurityContextIntegrationTests {
private static final String GEMFIRE_LOG_LEVEL = "error";
private static final String VCAP_APPLICATION_PROPERTIES = "application-vcap.properties";
private static Properties vcapApplicationProperties = new Properties();
@@ -97,12 +95,11 @@ public class AutoConfiguredCloudSecurityContextIntegrationTests
}
@SpringBootApplication
@EnableLogging(logLevel = GEMFIRE_LOG_LEVEL)
static class GemFireClientConfiguration extends BaseGemFireClientConfiguration { }
@SpringBootApplication
@CacheServerApplication(name = "AutoConfiguredCloudSecurityContextIntegrationTests", logLevel = GEMFIRE_LOG_LEVEL)
@EnableLocator(port = 55221)
@CacheServerApplication(name = "AutoConfiguredCloudSecurityContextIntegrationTestsServer")
static class GemFireServerConfiguration extends BaseGemFireServerConfiguration {
public static void main(String[] args) {

View File

@@ -31,7 +31,6 @@ import org.springframework.boot.test.context.SpringBootTest;
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.geode.boot.autoconfigure.ClientSecurityAutoConfiguration;
import org.springframework.geode.boot.autoconfigure.security.auth.AbstractAutoConfiguredSecurityContextIntegrationTests;
import org.springframework.test.annotation.DirtiesContext;
@@ -55,7 +54,6 @@ import org.springframework.test.context.junit4.SpringRunner;
* @see org.springframework.boot.test.context.SpringBootTest
* @see org.springframework.data.gemfire.config.annotation.CacheServerApplication
* @see org.springframework.data.gemfire.config.annotation.EnableLocator
* @see org.springframework.data.gemfire.config.annotation.EnableLogging
* @see org.springframework.geode.boot.autoconfigure.ClientSecurityAutoConfiguration
* @see org.springframework.geode.boot.autoconfigure.security.auth.AbstractAutoConfiguredSecurityContextIntegrationTests
* @see org.springframework.test.annotation.DirtiesContext
@@ -76,7 +74,6 @@ import org.springframework.test.context.junit4.SpringRunner;
public class AutoConfiguredHybridSecurityContextIntegrationTests
extends AbstractAutoConfiguredSecurityContextIntegrationTests {
private static final String GEMFIRE_LOG_LEVEL = "error";
private static final String VCAP_APPLICATION_PROPERTIES = "application-vcap-hybrid.properties";
private static Properties vcapApplicationProperties = new Properties();
@@ -107,12 +104,11 @@ public class AutoConfiguredHybridSecurityContextIntegrationTests
}
@SpringBootApplication
@EnableLogging(logLevel = GEMFIRE_LOG_LEVEL)
static class GemFireClientConfiguration extends BaseGemFireClientConfiguration { }
@SpringBootApplication
@EnableLocator(port = 54441)
@CacheServerApplication(name = "AutoConfiguredHybridSecurityContextIntegrationTests", logLevel = GEMFIRE_LOG_LEVEL)
@CacheServerApplication(name = "AutoConfiguredHybridSecurityContextIntegrationTestsServer")
static class GemFireServerConfiguration extends BaseGemFireServerConfiguration {
public static void main(String[] args) {

View File

@@ -25,27 +25,23 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.data.gemfire.config.annotation.CacheServerApplication;
import org.springframework.data.gemfire.config.annotation.EnableLogging;
import org.springframework.geode.boot.autoconfigure.security.auth.AbstractAutoConfiguredSecurityContextIntegrationTests;
import org.springframework.test.annotation.DirtiesContext;
import org.springframework.test.context.ActiveProfiles;
import org.springframework.test.context.junit4.SpringRunner;
/**
* Integration test testing the auto-configuration of Apache Geode/Pivotal GemFire Security
* Integration Tests testing the auto-configuration of Apache Geode/Pivotal GemFire Security
* authentication/authorization in a local, non-managed context.
*
* @author John Blum
* @see java.security.Principal
* @see org.junit.Test
* @see org.apache.geode.cache.GemFireCache
* @see org.springframework.boot.SpringApplication
* @see org.springframework.boot.autoconfigure.SpringBootApplication
* @see org.springframework.boot.builder.SpringApplicationBuilder
* @see org.springframework.boot.test.context.SpringBootTest
* @see org.springframework.context.annotation.Import
* @see org.springframework.data.gemfire.config.annotation.CacheServerApplication
* @see org.springframework.data.gemfire.config.annotation.EnableSecurity
* @see org.springframework.data.gemfire.tests.integration.config.ClientServerIntegrationTestsConfiguration
* @see org.springframework.geode.boot.autoconfigure.ClientSecurityAutoConfiguration
* @see org.springframework.geode.boot.autoconfigure.PeerSecurityAutoConfiguration
* @see org.springframework.geode.boot.autoconfigure.security.auth.AbstractAutoConfiguredSecurityContextIntegrationTests
@@ -65,8 +61,6 @@ import org.springframework.test.context.junit4.SpringRunner;
public class AutoConfiguredLocalSecurityContextIntegrationTests
extends AbstractAutoConfiguredSecurityContextIntegrationTests {
private static final String GEMFIRE_LOG_LEVEL = "error";
@BeforeClass
public static void startGemFireServer() throws IOException {
startGemFireServer(GemFireServerConfiguration.class,
@@ -74,11 +68,10 @@ public class AutoConfiguredLocalSecurityContextIntegrationTests
}
@SpringBootApplication
@EnableLogging(logLevel = GEMFIRE_LOG_LEVEL)
static class GemFireClientConfiguration extends BaseGemFireClientConfiguration { }
@SpringBootApplication
@CacheServerApplication(name = "AutoConfiguredLocalSecurityContextIntegrationTests", logLevel = GEMFIRE_LOG_LEVEL)
@CacheServerApplication(name = "AutoConfiguredLocalSecurityContextIntegrationTestsServer")
static class GemFireServerConfiguration extends BaseGemFireServerConfiguration {
public static void main(String[] args) {

View File

@@ -29,7 +29,6 @@ import org.springframework.boot.test.context.SpringBootTest;
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.geode.boot.autoconfigure.ClientSecurityAutoConfiguration;
import org.springframework.geode.boot.autoconfigure.security.auth.AbstractAutoConfiguredSecurityContextIntegrationTests;
import org.springframework.test.annotation.DirtiesContext;
@@ -47,7 +46,6 @@ import org.springframework.test.context.junit4.SpringRunner;
* @see org.springframework.boot.test.context.SpringBootTest
* @see org.springframework.data.gemfire.config.annotation.CacheServerApplication
* @see org.springframework.data.gemfire.config.annotation.EnableLocator
* @see org.springframework.data.gemfire.config.annotation.EnableLogging
* @see org.springframework.geode.boot.autoconfigure.ClientSecurityAutoConfiguration
* @see org.springframework.geode.boot.autoconfigure.security.auth.AbstractAutoConfiguredSecurityContextIntegrationTests
* @see org.springframework.test.annotation.DirtiesContext
@@ -64,7 +62,6 @@ import org.springframework.test.context.junit4.SpringRunner;
public class AutoConfiguredMultiCloudCacheServiceInstanceSecurityContextIntegrationTests
extends AbstractAutoConfiguredSecurityContextIntegrationTests {
private static final String GEMFIRE_LOG_LEVEL = "error";
private static final String VCAP_APPLICATION_PROPERTIES = "application-vcap-multi.properties";
private static Properties vcapApplicationProperties = new Properties();
@@ -95,13 +92,11 @@ public class AutoConfiguredMultiCloudCacheServiceInstanceSecurityContextIntegrat
}
@SpringBootApplication
@EnableLogging(logLevel = GEMFIRE_LOG_LEVEL)
static class GemFireClientConfiguration extends BaseGemFireClientConfiguration { }
@SpringBootApplication
@EnableLocator(port = 56421)
@CacheServerApplication(name = "AutoConfiguredMultiCloudCacheServiceInstanceSecurityContextIntegrationTests",
logLevel = GEMFIRE_LOG_LEVEL)
@CacheServerApplication(name = "AutoConfiguredMultiCloudCacheServiceInstanceSecurityContextIntegrationTestsServer")
static class GemFireServerConfiguration extends BaseGemFireServerConfiguration {
public static void main(String[] args) {

View File

@@ -43,7 +43,6 @@ import org.springframework.core.env.ConfigurableEnvironment;
import org.springframework.core.env.Environment;
import org.springframework.data.gemfire.GemfireTemplate;
import org.springframework.data.gemfire.config.annotation.CacheServerApplication;
import org.springframework.data.gemfire.config.annotation.EnableLogging;
import org.springframework.data.gemfire.tests.integration.ForkingClientServerIntegrationTestsSupport;
import org.springframework.data.gemfire.tests.integration.config.ClientServerIntegrationTestsConfiguration;
import org.springframework.test.annotation.DirtiesContext;
@@ -54,20 +53,19 @@ import example.echo.config.EchoClientConfiguration;
import example.echo.config.EchoServerConfiguration;
/**
* Integration tests testing the auto-configuration of Apache Geode/Pivotal GemFire SSL.
* Integration Tests testing the auto-configuration of Apache Geode/Pivotal GemFire SSL.
*
* @author John Blum
* @see org.junit.Test
* @see org.apache.geode.cache.GemFireCache
* @see org.apache.geode.cache.Region
* @see org.springframework.boot.autoconfigure.SpringBootApplication
* @see org.springframework.boot.builder.SpringApplicationBuilder
* @see org.springframework.boot.test.context.SpringBootTest
* @see org.springframework.context.annotation.Import
* @see org.springframework.core.env.ConfigurableEnvironment
* @see org.springframework.data.gemfire.GemfireTemplate
* @see org.springframework.data.gemfire.config.annotation.CacheServerApplication
* @see org.springframework.data.gemfire.config.annotation.EnableSsl
* @see org.springframework.data.gemfire.tests.integration.ForkingClientServerIntegrationTestsSupport
* @see org.springframework.data.gemfire.tests.integration.config.ClientServerIntegrationTestsConfiguration
* @see org.springframework.test.annotation.DirtiesContext
* @see org.springframework.test.context.ActiveProfiles
* @see org.springframework.test.context.junit4.SpringRunner
@@ -77,13 +75,12 @@ import example.echo.config.EchoServerConfiguration;
@DirtiesContext
@RunWith(SpringRunner.class)
@SpringBootTest(
webEnvironment = SpringBootTest.WebEnvironment.NONE,
classes = AutoConfiguredSslIntegrationTests.GemFireClientConfiguration.class
classes = AutoConfiguredSslIntegrationTests.GemFireClientConfiguration.class,
webEnvironment = SpringBootTest.WebEnvironment.NONE
)
@SuppressWarnings("unused")
public class AutoConfiguredSslIntegrationTests extends ForkingClientServerIntegrationTestsSupport {
private static final String GEMFIRE_LOG_LEVEL = "error";
private static final String TRUSTED_KEYSTORE_FILENAME = "test-trusted.keystore";
@BeforeClass
@@ -155,12 +152,11 @@ public class AutoConfiguredSslIntegrationTests extends ForkingClientServerIntegr
}
@SpringBootApplication
@EnableLogging(logLevel = GEMFIRE_LOG_LEVEL)
@Import(EchoClientConfiguration.class)
static class GemFireClientConfiguration extends ClientServerIntegrationTestsConfiguration { }
@SpringBootApplication
@CacheServerApplication(name = "AutoConfiguredSslIntegrationTests", logLevel = GEMFIRE_LOG_LEVEL)
@CacheServerApplication(name = "AutoConfiguredSslIntegrationTestsServer")
@Import(EchoServerConfiguration.class)
static class GemFireServerConfiguration {

View File

@@ -41,7 +41,6 @@ import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.web.server.LocalServerPort;
import org.springframework.context.annotation.Bean;
import org.springframework.data.gemfire.config.annotation.CacheServerApplication;
import org.springframework.data.gemfire.config.annotation.EnableLogging;
import org.springframework.data.gemfire.tests.integration.ForkingClientServerIntegrationTestsSupport;
import org.springframework.http.RequestEntity;
import org.springframework.http.ResponseEntity;
@@ -63,25 +62,25 @@ import org.springframework.web.client.RestTemplate;
*
* @author John Blum
* @see java.net.URI
* @see javax.servlet.http.HttpSession
* @see org.junit.Test
* @see org.apache.geode.cache.Region
* @see org.apache.geode.cache.client.ClientCache
* @see org.springframework.boot.autoconfigure.SpringBootApplication
* @see org.springframework.boot.builder.SpringApplicationBuilder
* @see org.springframework.boot.test.context.SpringBootTest
* @see org.springframework.boot.web.server.LocalServerPort
* @see org.springframework.context.annotation.Bean
* @see org.springframework.data.gemfire.config.annotation.CacheServerApplication
* @see org.springframework.data.gemfire.config.annotation.EnableLogging
* @see org.springframework.data.gemfire.tests.integration.ForkingClientServerIntegrationTestsSupport
* @see org.springframework.geode.boot.autoconfigure.SpringSessionAutoConfiguration
* @see org.springframework.http.RequestEntity
* @see org.springframework.http.ResponseEntity
* @see org.springframework.session.data.gemfire.config.annotation.web.http.EnableGemFireHttpSession
* @see org.springframework.session.data.gemfire.config.annotation.web.http.GemFireHttpSessionConfiguration
* @see org.springframework.session.web.http.HeaderHttpSessionIdResolver
* @see org.springframework.session.web.http.HttpSessionIdResolver
* @see org.springframework.test.context.ActiveProfiles
* @see org.springframework.test.context.junit4.SpringRunner
* @see org.springframework.web.bind.annotation.GetMapping
* @see org.springframework.web.bind.annotation.RequestMapping
* @see org.springframework.web.bind.annotation.RequestParam
* @see org.springframework.web.bind.annotation.RestController
* @see org.springframework.web.client.RestTemplate
* @since 1.0.0
@@ -171,7 +170,6 @@ public class AutoConfiguredSessionRemoteCachingIntegrationTests extends ForkingC
}
@SpringBootApplication
@EnableLogging(logLevel = "error")
static class SessionGemFireClientConfiguration {
@Bean
@@ -214,7 +212,7 @@ public class AutoConfiguredSessionRemoteCachingIntegrationTests extends ForkingC
}
}
@CacheServerApplication(name = "AutoConfiguredSessionRemoteCachingIntegrationTests", logLevel = "error")
@CacheServerApplication(name = "AutoConfiguredSessionRemoteCachingIntegrationTests")
@EnableGemFireHttpSession
static class SessionGemFireServerConfiguration {

View File

@@ -32,7 +32,6 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.context.ApplicationListener;
import org.springframework.context.annotation.Bean;
import org.springframework.data.gemfire.config.annotation.EnableLogging;
import org.springframework.data.gemfire.tests.integration.IntegrationTestsSupport;
import org.springframework.session.Session;
import org.springframework.session.SessionRepository;
@@ -42,7 +41,7 @@ import org.springframework.session.events.AbstractSessionEvent;
import org.springframework.test.context.junit4.SpringRunner;
/**
* Integration tests to assert the property configuration of the Session state management provider
* Integration Tests to assert the property configuration of the Session state management provider
* with respect to Session expiration timeout.
*
* @author John Blum
@@ -50,24 +49,28 @@ import org.springframework.test.context.junit4.SpringRunner;
* @see org.apache.geode.cache.Region
* @see org.springframework.boot.autoconfigure.SpringBootApplication
* @see org.springframework.boot.test.context.SpringBootTest
* @see org.springframework.context.ApplicationListener
* @see org.springframework.context.annotation.Bean
* @see org.springframework.data.gemfire.tests.integration.IntegrationTestsSupport
* @see org.springframework.session.Session
* @see org.springframework.session.SessionRepository
* @see org.springframework.session.data.gemfire.GemFireOperationsSessionRepository
* @see org.springframework.session.data.gemfire.config.annotation.web.http.GemFireHttpSessionConfiguration
* @see org.springframework.session.events.AbstractSessionEvent
* @see org.springframework.test.context.junit4.SpringRunner
* @since 1.0.0
*/
@RunWith(SpringRunner.class)
@SpringBootTest(properties = {
"spring.session.data.gemfire.cache.client.region.shortcut=LOCAL",
"spring.session.timeout=1",
}, webEnvironment = SpringBootTest.WebEnvironment.MOCK)
@SpringBootTest(
properties = {
"spring.session.data.gemfire.cache.client.region.shortcut=LOCAL",
"spring.session.timeout=1",
},
webEnvironment = SpringBootTest.WebEnvironment.MOCK
)
@SuppressWarnings("unused")
public class SessionExpirationIntegrationTests extends IntegrationTestsSupport {
private static final String GEMFIRE_LOG_LEVEL = "error";
@Resource(name = GemFireHttpSessionConfiguration.DEFAULT_SESSION_REGION_NAME)
private Region<Object, Session> sessionRegion;
@@ -140,7 +143,6 @@ public class SessionExpirationIntegrationTests extends IntegrationTestsSupport {
}
@SpringBootApplication
@EnableLogging(logLevel = GEMFIRE_LOG_LEVEL)
static class TestConfiguration {
@Bean

View File

@@ -40,7 +40,6 @@ import org.springframework.data.gemfire.GemfireTemplate;
import org.springframework.data.gemfire.LocalRegionFactoryBean;
import org.springframework.data.gemfire.config.annotation.CacheServerApplication;
import org.springframework.data.gemfire.config.annotation.EnableClusterDefinedRegions;
import org.springframework.data.gemfire.config.annotation.EnableLogging;
import org.springframework.data.gemfire.tests.integration.ForkingClientServerIntegrationTestsSupport;
import org.springframework.data.gemfire.util.CollectionUtils;
import org.springframework.geode.boot.autoconfigure.RegionTemplateAutoConfiguration;
@@ -54,9 +53,11 @@ import org.springframework.test.context.junit4.SpringRunner;
* @see org.junit.Test
* @see org.apache.geode.cache.GemFireCache
* @see org.apache.geode.cache.Region
* @see org.apache.geode.cache.client.ClientCache
* @see org.springframework.boot.autoconfigure.SpringBootApplication
* @see org.springframework.boot.test.context.SpringBootTest
* @see org.springframework.context.ApplicationContext
* @see org.springframework.context.annotation.AnnotationConfigApplicationContext
* @see org.springframework.context.annotation.Bean
* @see org.springframework.data.gemfire.GemfireTemplate
* @see org.springframework.data.gemfire.LocalRegionFactoryBean
@@ -68,14 +69,14 @@ import org.springframework.test.context.junit4.SpringRunner;
* @since 1.1.0
*/
@RunWith(SpringRunner.class)
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.NONE,
classes = ServerDefinedRegionTemplateAutoConfigurationIntegrationTests.GemFireClientConfiguration.class)
@SpringBootTest(
classes = ServerDefinedRegionTemplateAutoConfigurationIntegrationTests.GemFireClientConfiguration.class,
webEnvironment = SpringBootTest.WebEnvironment.NONE
)
@SuppressWarnings("unused")
public class ServerDefinedRegionTemplateAutoConfigurationIntegrationTests
extends ForkingClientServerIntegrationTestsSupport {
private static final String GEMFIRE_LOG_LEVEL = "off";
@BeforeClass
public static void startGemFireServer() throws IOException {
startGemFireServer(GemFireServerConfiguration.class);
@@ -121,7 +122,6 @@ public class ServerDefinedRegionTemplateAutoConfigurationIntegrationTests
@SpringBootApplication
@EnableClusterDefinedRegions
@EnableLogging(logLevel = GEMFIRE_LOG_LEVEL)
static class GemFireClientConfiguration {
@Bean("TestBean")
@@ -130,7 +130,7 @@ public class ServerDefinedRegionTemplateAutoConfigurationIntegrationTests
}
}
@CacheServerApplication(logLevel = GEMFIRE_LOG_LEVEL)
@CacheServerApplication(name = "ServerDefinedRegionTemplateAutoConfigurationIntegrationTestsServer")
static class GemFireServerConfiguration {
public static void main(String[] args) {

View File

@@ -2,4 +2,6 @@
spring.boot.data.gemfire.cache.data.import.active-profiles=IMPORT
spring.boot.data.gemfire.security.ssl.keystore.name=non-existing-trusted.keystore
spring.data.gemfire.logging.level=error
spring.data.gemfire.cache.log-level=${spring.data.gemfire.logging.level}
spring.main.allow-bean-definition-overriding=true