Extend STDG's IntegrationTestsSupport abstract base class for any Unit/Integration Tests forking a Spring ApplicationContext and bootstrapping/configuring Apache Geode live or mock objects.
Resolves gh-296.
This commit is contained in:
@@ -13,7 +13,6 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.data.gemfire;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
@@ -39,9 +38,10 @@ import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.context.annotation.DependsOn;
|
||||
import org.springframework.context.annotation.Import;
|
||||
import org.springframework.data.gemfire.tests.integration.IntegrationTestsSupport;
|
||||
|
||||
/**
|
||||
* Integration tests with test cases testing the numerous conflicting {@link Index} configurations.
|
||||
* Integration Tests for numerous conflicting {@link Index} configurations.
|
||||
*
|
||||
* An {@link IndexExistsException} is thrown when 2 or more {@link Index Indexes} share the same definition
|
||||
* but have different names.
|
||||
@@ -61,7 +61,7 @@ import org.springframework.context.annotation.Import;
|
||||
* @see <a href="https://jira.spring.io/browse/SGF-637">Improve IndexFactoryBean's resilience and options for handling GemFire IndexExistsExceptions and IndexNameConflictExceptions</a>
|
||||
* @since 1.6.3
|
||||
*/
|
||||
public class IndexConflictsIntegrationTest {
|
||||
public class IndexConflictsIntegrationTests extends IntegrationTestsSupport {
|
||||
|
||||
private static final AtomicBoolean IGNORE = new AtomicBoolean(false);
|
||||
private static final AtomicBoolean OVERRIDE = new AtomicBoolean(false);
|
||||
@@ -174,6 +174,7 @@ public class IndexConflictsIntegrationTest {
|
||||
|
||||
@Test(expected = IndexExistsException.class)
|
||||
public void indexDefinitionConflictThrowsIndexExistsException() throws Throwable {
|
||||
|
||||
try {
|
||||
this.applicationContext = newApplicationContext(IndexDefinitionConflictConfiguration.class);
|
||||
}
|
||||
@@ -239,6 +240,7 @@ public class IndexConflictsIntegrationTest {
|
||||
|
||||
@Test(expected = IndexNameConflictException.class)
|
||||
public void indexNameConflictThrowsIndexNameConflictException() throws Throwable {
|
||||
|
||||
try {
|
||||
this.applicationContext = newApplicationContext(IndexNameConflictConfiguration.class);
|
||||
}
|
||||
@@ -271,7 +273,7 @@ public class IndexConflictsIntegrationTest {
|
||||
|
||||
Properties gemfireProperties = new Properties();
|
||||
|
||||
gemfireProperties.setProperty("name", IndexConflictsIntegrationTest.class.getSimpleName());
|
||||
gemfireProperties.setProperty("name", IndexConflictsIntegrationTests.class.getSimpleName());
|
||||
gemfireProperties.setProperty("log-level", "error");
|
||||
|
||||
return gemfireProperties;
|
||||
@@ -289,12 +291,11 @@ public class IndexConflictsIntegrationTest {
|
||||
}
|
||||
|
||||
@Bean(name = "Customers")
|
||||
public ReplicatedRegionFactoryBean customersRegion(GemFireCache gemfireCache) {
|
||||
public ReplicatedRegionFactoryBean<?, ?> customersRegion(GemFireCache gemfireCache) {
|
||||
|
||||
ReplicatedRegionFactoryBean customersRegionFactory = new ReplicatedRegionFactoryBean();
|
||||
ReplicatedRegionFactoryBean<?, ?> customersRegionFactory = new ReplicatedRegionFactoryBean<>();
|
||||
|
||||
customersRegionFactory.setCache(gemfireCache);
|
||||
customersRegionFactory.setClose(false);
|
||||
customersRegionFactory.setPersistent(false);
|
||||
|
||||
return customersRegionFactory;
|
||||
@@ -60,6 +60,7 @@ import org.springframework.data.gemfire.repository.config.EnableGemfireRepositor
|
||||
import org.springframework.data.gemfire.repository.support.GemfireRepositoryFactoryBean;
|
||||
import org.springframework.data.gemfire.test.model.Person;
|
||||
import org.springframework.data.gemfire.test.repo.PersonRepository;
|
||||
import org.springframework.data.gemfire.tests.integration.IntegrationTestsSupport;
|
||||
import org.springframework.data.gemfire.tests.mock.GemFireMockObjectsSupport;
|
||||
import org.springframework.data.gemfire.tests.mock.annotation.EnableGemFireMockObjects;
|
||||
import org.springframework.data.gemfire.tests.util.IOUtils;
|
||||
@@ -87,9 +88,10 @@ import lombok.Data;
|
||||
* @see org.springframework.data.gemfire.config.annotation.ContinuousQueryConfiguration
|
||||
* @see org.springframework.data.gemfire.config.annotation.EnableContinuousQueries
|
||||
* @see org.springframework.data.gemfire.listener.annotation.ContinuousQuery
|
||||
* @see org.springframework.data.gemfire.tests.integration.IntegrationTestsSupport
|
||||
* @since 2.0.1
|
||||
*/
|
||||
public class EnableContinuousQueriesConfigurationUnitTests {
|
||||
public class EnableContinuousQueriesConfigurationUnitTests extends IntegrationTestsSupport {
|
||||
|
||||
private ConfigurableApplicationContext newApplicationContext(Class<?>... annotatedClasses) {
|
||||
return new AnnotationConfigApplicationContext(annotatedClasses);
|
||||
|
||||
@@ -64,6 +64,7 @@ import org.springframework.data.gemfire.mapping.annotation.ClientRegion;
|
||||
import org.springframework.data.gemfire.mapping.annotation.LocalRegion;
|
||||
import org.springframework.data.gemfire.mapping.annotation.PartitionRegion;
|
||||
import org.springframework.data.gemfire.mapping.annotation.ReplicateRegion;
|
||||
import org.springframework.data.gemfire.tests.integration.IntegrationTestsSupport;
|
||||
import org.springframework.data.gemfire.tests.mock.MockObjectsSupport;
|
||||
import org.springframework.data.gemfire.tests.mock.annotation.EnableGemFireMockObjects;
|
||||
|
||||
@@ -85,11 +86,12 @@ import org.springframework.data.gemfire.tests.mock.annotation.EnableGemFireMockO
|
||||
* @see org.springframework.data.gemfire.mapping.annotation.ReplicateRegion
|
||||
* @see org.springframework.data.gemfire.mapping.annotation.ReplicateRegion
|
||||
* @see org.springframework.data.gemfire.tests.mock.MockObjectsSupport
|
||||
* @see org.springframework.data.gemfire.tests.integration.IntegrationTestsSupport
|
||||
* @see org.springframework.data.gemfire.tests.mock.annotation.EnableGemFireMockObjects
|
||||
* @since 1.9.0
|
||||
*/
|
||||
@SuppressWarnings({ "unchecked", "unused" })
|
||||
public class EnableEntityDefinedRegionsUnitTests {
|
||||
public class EnableEntityDefinedRegionsUnitTests extends IntegrationTestsSupport {
|
||||
|
||||
private ConfigurableApplicationContext applicationContext;
|
||||
|
||||
@@ -98,21 +100,21 @@ public class EnableEntityDefinedRegionsUnitTests {
|
||||
Optional.ofNullable(this.applicationContext).ifPresent(ConfigurableApplicationContext::close);
|
||||
}
|
||||
|
||||
protected <K, V> void assertRegion(Region<K, V> region, String name) {
|
||||
private <K, V> void assertRegion(Region<K, V> region, String name) {
|
||||
assertRegion(region, name, toRegionPath(name), null, null);
|
||||
}
|
||||
|
||||
protected <K, V> void assertRegion(Region<K, V> region, String name,
|
||||
private <K, V> void assertRegion(Region<K, V> region, String name,
|
||||
Class<K> keyConstraint, Class<V> valueConstraint) {
|
||||
|
||||
assertRegion(region, name, toRegionPath(name), keyConstraint, valueConstraint);
|
||||
}
|
||||
|
||||
protected <K, V> void assertRegion(Region<K, V> region, String name, String fullPath) {
|
||||
private <K, V> void assertRegion(Region<K, V> region, String name, String fullPath) {
|
||||
assertRegion(region, name, fullPath, null, null);
|
||||
}
|
||||
|
||||
protected <K, V> void assertRegion(Region<K, V> region, String name, String fullPath,
|
||||
private <K, V> void assertRegion(Region<K, V> region, String name, String fullPath,
|
||||
Class<K> keyConstraint, Class<V> valueConstraint) {
|
||||
|
||||
assertThat(region).isNotNull();
|
||||
@@ -123,7 +125,7 @@ public class EnableEntityDefinedRegionsUnitTests {
|
||||
assertThat(region.getAttributes().getValueConstraint()).isEqualTo(valueConstraint);
|
||||
}
|
||||
|
||||
protected <K, V> void assertRegionWithAttributes(Region<K, V> region, String name, DataPolicy dataPolicy,
|
||||
private <K, V> void assertRegionWithAttributes(Region<K, V> region, String name, DataPolicy dataPolicy,
|
||||
String diskStoreName, Boolean diskSynchronous, Boolean ignoreJta, String poolName, Scope scope) {
|
||||
|
||||
assertRegion(region, name);
|
||||
@@ -132,7 +134,7 @@ public class EnableEntityDefinedRegionsUnitTests {
|
||||
poolName, scope);
|
||||
}
|
||||
|
||||
protected <K, V> void assertRegionAttributes(RegionAttributes<K, V> regionAttributes, DataPolicy dataPolicy,
|
||||
private <K, V> void assertRegionAttributes(RegionAttributes<K, V> regionAttributes, DataPolicy dataPolicy,
|
||||
String diskStoreName, Boolean diskSynchronous, Boolean ignoreJta, String poolName, Scope scope) {
|
||||
|
||||
assertThat(regionAttributes).isNotNull();
|
||||
@@ -144,7 +146,7 @@ public class EnableEntityDefinedRegionsUnitTests {
|
||||
assertThat(regionAttributes.getScope()).isEqualTo(scope);
|
||||
}
|
||||
|
||||
protected <K, V> void assertPartitionAttributes(PartitionAttributes<K, V> partitionAttributes,
|
||||
private <K, V> void assertPartitionAttributes(PartitionAttributes<K, V> partitionAttributes,
|
||||
String collocatedWith, PartitionResolver<?, ?> partitionResolver, Integer redundantCopies) {
|
||||
|
||||
assertThat(partitionAttributes).isNotNull();
|
||||
@@ -153,7 +155,7 @@ public class EnableEntityDefinedRegionsUnitTests {
|
||||
assertThat(partitionAttributes.getRedundantCopies()).isEqualTo(redundantCopies);
|
||||
}
|
||||
|
||||
protected void assertFixedPartitionAttributes(FixedPartitionAttributes fixedPartitionAttributes,
|
||||
private void assertFixedPartitionAttributes(FixedPartitionAttributes fixedPartitionAttributes,
|
||||
String partitionName, boolean primary, int numBuckets) {
|
||||
|
||||
assertThat(fixedPartitionAttributes).isNotNull();
|
||||
@@ -162,7 +164,7 @@ public class EnableEntityDefinedRegionsUnitTests {
|
||||
assertThat(fixedPartitionAttributes.getNumBuckets()).isEqualTo(numBuckets);
|
||||
}
|
||||
|
||||
protected void assertUndefinedRegions(String... regionBeanNames) {
|
||||
private void assertUndefinedRegions(String... regionBeanNames) {
|
||||
|
||||
stream(nullSafeArray(regionBeanNames, String.class)).forEach(regionBeanName ->
|
||||
assertThat(this.applicationContext.containsBean(regionBeanName)).isFalse());
|
||||
@@ -170,7 +172,7 @@ public class EnableEntityDefinedRegionsUnitTests {
|
||||
assertThat(this.applicationContext.getBeansOfType(Region.class)).hasSize(11 - length(regionBeanNames));
|
||||
}
|
||||
|
||||
protected FixedPartitionAttributes findFixedPartitionAttributes(PartitionAttributes<?, ?> partitionAttributes,
|
||||
private FixedPartitionAttributes findFixedPartitionAttributes(PartitionAttributes<?, ?> partitionAttributes,
|
||||
String partitionName) {
|
||||
|
||||
assertThat(partitionAttributes).isNotNull();
|
||||
@@ -187,9 +189,12 @@ public class EnableEntityDefinedRegionsUnitTests {
|
||||
return null;
|
||||
}
|
||||
|
||||
protected ConfigurableApplicationContext newApplicationContext(Class<?>... annotatedClasses) {
|
||||
private ConfigurableApplicationContext newApplicationContext(Class<?>... annotatedClasses) {
|
||||
|
||||
ConfigurableApplicationContext applicationContext = new AnnotationConfigApplicationContext(annotatedClasses);
|
||||
|
||||
applicationContext.registerShutdownHook();
|
||||
|
||||
return applicationContext;
|
||||
}
|
||||
|
||||
|
||||
@@ -14,12 +14,12 @@
|
||||
* limitations under the License.
|
||||
*
|
||||
*/
|
||||
|
||||
package org.springframework.data.gemfire.config.annotation;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
import static org.mockito.Matchers.any;
|
||||
import static org.mockito.Matchers.anyString;
|
||||
import static org.mockito.ArgumentMatchers.any;
|
||||
import static org.mockito.ArgumentMatchers.anyString;
|
||||
import static org.mockito.Mockito.doReturn;
|
||||
import static org.mockito.Mockito.mock;
|
||||
import static org.mockito.Mockito.when;
|
||||
import static org.springframework.data.gemfire.config.annotation.EnableEviction.EvictionPolicy;
|
||||
@@ -46,22 +46,24 @@ import org.springframework.data.gemfire.ReplicatedRegionFactoryBean;
|
||||
import org.springframework.data.gemfire.eviction.EvictionActionType;
|
||||
import org.springframework.data.gemfire.eviction.EvictionAttributesFactoryBean;
|
||||
import org.springframework.data.gemfire.eviction.EvictionPolicyType;
|
||||
import org.springframework.data.gemfire.tests.integration.IntegrationTestsSupport;
|
||||
import org.springframework.data.gemfire.util.ArrayUtils;
|
||||
|
||||
/**
|
||||
* Unit tests for the {@link EnableEviction} annotation and {@link EvictionConfiguration} class.
|
||||
* Unit Tests for the {@link EnableEviction} annotation and {@link EvictionConfiguration} class.
|
||||
*
|
||||
* @author John Blum
|
||||
* @see org.junit.Test
|
||||
* @see org.mockito.Mockito
|
||||
* @see org.apache.geode.cache.EvictionAttributes
|
||||
* @see org.apache.geode.cache.Region
|
||||
* @see org.springframework.data.gemfire.config.annotation.EnableEviction
|
||||
* @see org.springframework.data.gemfire.config.annotation.EvictionConfiguration
|
||||
* @see EvictionAttributesFactoryBean
|
||||
* @see org.apache.geode.cache.Region
|
||||
* @see org.apache.geode.cache.EvictionAttributes
|
||||
* @see org.springframework.data.gemfire.eviction.EvictionAttributesFactoryBean
|
||||
* @see org.springframework.data.gemfire.tests.integration.IntegrationTestsSupport
|
||||
* @since 1.9.0
|
||||
*/
|
||||
public class EnableEvictionConfigurationUnitTests {
|
||||
public class EnableEvictionConfigurationUnitTests extends IntegrationTestsSupport {
|
||||
|
||||
private ConfigurableApplicationContext applicationContext;
|
||||
|
||||
@@ -72,14 +74,15 @@ public class EnableEvictionConfigurationUnitTests {
|
||||
}
|
||||
}
|
||||
|
||||
protected void assertEvictionAttributes(Region region, EvictionAttributes expectedEvictionAttributes) {
|
||||
private void assertEvictionAttributes(Region<?, ?> region, EvictionAttributes expectedEvictionAttributes) {
|
||||
|
||||
assertThat(region).isNotNull();
|
||||
assertThat(region.getAttributes()).isNotNull();
|
||||
assertEvictionAttributes(region.getAttributes().getEvictionAttributes(), expectedEvictionAttributes);
|
||||
}
|
||||
|
||||
protected void assertEvictionAttributes(EvictionAttributes actualEvictionAttributes,
|
||||
EvictionAttributes expectedEvictionAttributes) {
|
||||
private void assertEvictionAttributes(EvictionAttributes actualEvictionAttributes,
|
||||
EvictionAttributes expectedEvictionAttributes) {
|
||||
|
||||
assertThat(actualEvictionAttributes).isNotNull();
|
||||
assertThat(actualEvictionAttributes.getAction()).isEqualTo(expectedEvictionAttributes.getAction());
|
||||
@@ -97,11 +100,11 @@ public class EnableEvictionConfigurationUnitTests {
|
||||
return applicationContext.getBean(beanName, Region.class);
|
||||
}
|
||||
|
||||
protected AnnotationConfigApplicationContext newApplicationContext(Class<?>... annotatedClasses) {
|
||||
private AnnotationConfigApplicationContext newApplicationContext(Class<?>... annotatedClasses) {
|
||||
return new AnnotationConfigApplicationContext(annotatedClasses);
|
||||
}
|
||||
|
||||
protected EvictionAttributes newEvictionAttributes(Integer maximum, EvictionPolicyType type, EvictionActionType action,
|
||||
private EvictionAttributes newEvictionAttributes(Integer maximum, EvictionPolicyType type, EvictionActionType action,
|
||||
ObjectSizer... objectSizer) {
|
||||
|
||||
EvictionAttributesFactoryBean evictionAttributesFactory = new EvictionAttributesFactoryBean();
|
||||
@@ -117,6 +120,7 @@ public class EnableEvictionConfigurationUnitTests {
|
||||
|
||||
@Test
|
||||
public void usesDefaultEvictionPolicyConfiguration() {
|
||||
|
||||
applicationContext = newApplicationContext(DefaultEvictionPolicyConfiguration.class);
|
||||
|
||||
EvictionAttributes defaultEvictionAttributes = EvictionAttributes.createLRUEntryAttributes();
|
||||
@@ -127,12 +131,14 @@ public class EnableEvictionConfigurationUnitTests {
|
||||
|
||||
@Test
|
||||
public void usesCustomEvictionPolicyConfiguration() {
|
||||
|
||||
applicationContext = newApplicationContext(CustomEvictionPolicyConfiguration.class);
|
||||
|
||||
ObjectSizer mockObjectSizer = applicationContext.getBean("mockObjectSizer", ObjectSizer.class);
|
||||
|
||||
EvictionAttributes customEvictionAttributes = newEvictionAttributes(65536, EvictionPolicyType.MEMORY_SIZE,
|
||||
EvictionActionType.OVERFLOW_TO_DISK, mockObjectSizer);
|
||||
EvictionAttributes customEvictionAttributes =
|
||||
newEvictionAttributes(65536, EvictionPolicyType.MEMORY_SIZE, EvictionActionType.OVERFLOW_TO_DISK,
|
||||
mockObjectSizer);
|
||||
|
||||
assertEvictionAttributes(applicationContext.getBean("PartitionRegion", Region.class), customEvictionAttributes);
|
||||
assertEvictionAttributes(applicationContext.getBean("ReplicateRegion", Region.class), customEvictionAttributes);
|
||||
@@ -140,12 +146,14 @@ public class EnableEvictionConfigurationUnitTests {
|
||||
|
||||
@Test
|
||||
public void usesRegionSpecificEvictionPolicyConfiguration() {
|
||||
|
||||
applicationContext = newApplicationContext(RegionSpecificEvictionPolicyConfiguration.class);
|
||||
|
||||
ObjectSizer mockObjectSizer = applicationContext.getBean("mockObjectSizer", ObjectSizer.class);
|
||||
|
||||
EvictionAttributes partitionRegionEvictionAttributes = newEvictionAttributes(null,
|
||||
EvictionPolicyType.HEAP_PERCENTAGE, EvictionActionType.OVERFLOW_TO_DISK, mockObjectSizer);
|
||||
EvictionAttributes partitionRegionEvictionAttributes =
|
||||
newEvictionAttributes(null, EvictionPolicyType.HEAP_PERCENTAGE, EvictionActionType.OVERFLOW_TO_DISK,
|
||||
mockObjectSizer);
|
||||
|
||||
EvictionAttributes replicateRegionEvictionAttributes = newEvictionAttributes(10000,
|
||||
EvictionPolicyType.ENTRY_COUNT, EvictionActionType.LOCAL_DESTROY);
|
||||
@@ -159,10 +167,11 @@ public class EnableEvictionConfigurationUnitTests {
|
||||
|
||||
@Test
|
||||
public void usesLastMatchingEvictionPolicyConfiguration() {
|
||||
|
||||
applicationContext = newApplicationContext(LastMatchingWinsEvictionPolicyConfiguration.class);
|
||||
|
||||
EvictionAttributes lastMatchingEvictionAttributes = newEvictionAttributes(99, EvictionPolicyType.ENTRY_COUNT,
|
||||
EvictionActionType.OVERFLOW_TO_DISK);
|
||||
EvictionAttributes lastMatchingEvictionAttributes =
|
||||
newEvictionAttributes(99, EvictionPolicyType.ENTRY_COUNT, EvictionActionType.OVERFLOW_TO_DISK);
|
||||
|
||||
assertEvictionAttributes(applicationContext.getBean("PartitionRegion", Region.class),
|
||||
lastMatchingEvictionAttributes);
|
||||
@@ -181,33 +190,33 @@ public class EnableEvictionConfigurationUnitTests {
|
||||
|
||||
Cache mockCache = mock(Cache.class);
|
||||
|
||||
RegionFactory mockRegionFactory = mock(RegionFactory.class);
|
||||
RegionFactory<Object, Object> mockRegionFactory = mock(RegionFactory.class);
|
||||
|
||||
AtomicReference<EvictionAttributes> evictionAttributes = new AtomicReference<>(null);
|
||||
|
||||
when(mockCache.createRegionFactory()).thenReturn(mockRegionFactory);
|
||||
|
||||
when(mockRegionFactory.setEvictionAttributes(any(EvictionAttributes.class)))
|
||||
.thenAnswer((Answer<RegionFactory>) invocation -> {
|
||||
.thenAnswer((Answer<RegionFactory<?, ?>>) invocation -> {
|
||||
evictionAttributes.set(invocation.getArgument(0));
|
||||
return (RegionFactory) invocation.getMock();
|
||||
return (RegionFactory<?, ?>) invocation.getMock();
|
||||
}
|
||||
);
|
||||
|
||||
when(mockRegionFactory.create(anyString()))
|
||||
.thenAnswer((Answer<Region>) invocation -> {
|
||||
.thenAnswer(invocation -> {
|
||||
|
||||
String regionName = invocation.getArgument(0);
|
||||
|
||||
Region mockRegion = mock(Region.class, regionName);
|
||||
Region<?, ?> mockRegion = mock(Region.class, regionName);
|
||||
|
||||
RegionAttributes mockRegionAttributes =
|
||||
RegionAttributes<?, ?> mockRegionAttributes =
|
||||
mock(RegionAttributes.class, regionName.concat("Attributes"));
|
||||
|
||||
when(mockRegion.getName()).thenReturn(regionName);
|
||||
when(mockRegion.getFullPath()).thenReturn(String.format("%1$s%2$s", Region.SEPARATOR, regionName));
|
||||
when(mockRegion.getAttributes()).thenReturn(mockRegionAttributes);
|
||||
when(mockRegionAttributes.getEvictionAttributes()).thenReturn(evictionAttributes.get());
|
||||
doReturn(regionName).when(mockRegion).getName();
|
||||
doReturn(String.format("%1$s%2$s", Region.SEPARATOR, regionName)).when(mockRegion).getFullPath();
|
||||
doReturn(mockRegion).when(mockRegion).getAttributes();
|
||||
doReturn(evictionAttributes.get()).when(mockRegionAttributes).getEvictionAttributes();
|
||||
|
||||
return mockRegion;
|
||||
});
|
||||
@@ -222,7 +231,6 @@ public class EnableEvictionConfigurationUnitTests {
|
||||
new PartitionedRegionFactoryBean<>();
|
||||
|
||||
partitionRegion.setCache(gemfireCache);
|
||||
partitionRegion.setClose(false);
|
||||
partitionRegion.setPersistent(false);
|
||||
|
||||
return partitionRegion;
|
||||
@@ -235,7 +243,6 @@ public class EnableEvictionConfigurationUnitTests {
|
||||
new ReplicatedRegionFactoryBean<>();
|
||||
|
||||
replicateRegion.setCache(gemfireCache);
|
||||
replicateRegion.setClose(false);
|
||||
replicateRegion.setPersistent(false);
|
||||
|
||||
return replicateRegion;
|
||||
|
||||
@@ -32,6 +32,7 @@ import org.springframework.context.ConfigurableApplicationContext;
|
||||
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.data.gemfire.expiration.AnnotationBasedExpiration;
|
||||
import org.springframework.data.gemfire.tests.integration.IntegrationTestsSupport;
|
||||
import org.springframework.data.gemfire.tests.mock.annotation.EnableGemFireMockObjects;
|
||||
import org.springframework.data.gemfire.test.model.Person;
|
||||
import org.springframework.stereotype.Service;
|
||||
@@ -47,11 +48,12 @@ import org.springframework.stereotype.Service;
|
||||
* @see org.springframework.data.gemfire.config.annotation.EnableExpiration
|
||||
* @see org.springframework.data.gemfire.config.annotation.ExpirationConfiguration
|
||||
* @see org.springframework.data.gemfire.expiration.AnnotationBasedExpiration
|
||||
* @see org.springframework.data.gemfire.tests.integration.IntegrationTestsSupport
|
||||
* @see org.springframework.data.gemfire.tests.mock.annotation.EnableGemFireMockObjects
|
||||
* @since 1.9.0
|
||||
*/
|
||||
@SuppressWarnings("unused")
|
||||
public class EnableExpirationConfigurationIntegrationTests {
|
||||
public class EnableExpirationConfigurationIntegrationTests extends IntegrationTestsSupport {
|
||||
|
||||
private static final String GEMFIRE_LOG_LEVEL = "error";
|
||||
|
||||
|
||||
@@ -38,6 +38,7 @@ import org.springframework.context.annotation.AnnotationConfigApplicationContext
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.data.gemfire.LocalRegionFactoryBean;
|
||||
import org.springframework.data.gemfire.expiration.ExpirationActionType;
|
||||
import org.springframework.data.gemfire.tests.integration.IntegrationTestsSupport;
|
||||
import org.springframework.data.gemfire.tests.mock.annotation.EnableGemFireMockObjects;
|
||||
import org.springframework.data.gemfire.util.ArrayUtils;
|
||||
|
||||
@@ -55,10 +56,11 @@ import org.springframework.data.gemfire.util.ArrayUtils;
|
||||
* @see org.springframework.context.annotation.AnnotationConfigApplicationContext
|
||||
* @see org.springframework.data.gemfire.config.annotation.EnableExpiration
|
||||
* @see org.springframework.data.gemfire.config.annotation.ExpirationConfiguration
|
||||
* @see org.springframework.data.gemfire.tests.integration.IntegrationTestsSupport
|
||||
* @see org.springframework.data.gemfire.tests.mock.annotation.EnableGemFireMockObjects
|
||||
* @since 1.9.0
|
||||
*/
|
||||
public class EnableExpirationConfigurationUnitTests {
|
||||
public class EnableExpirationConfigurationUnitTests extends IntegrationTestsSupport {
|
||||
|
||||
private ConfigurableApplicationContext applicationContext;
|
||||
|
||||
|
||||
@@ -20,17 +20,18 @@ import static org.assertj.core.api.Assertions.assertThat;
|
||||
import java.util.Optional;
|
||||
import java.util.Properties;
|
||||
|
||||
import org.junit.After;
|
||||
import org.junit.Test;
|
||||
|
||||
import org.apache.geode.cache.Cache;
|
||||
import org.apache.geode.cache.GemFireCache;
|
||||
import org.apache.geode.cache.client.ClientCache;
|
||||
|
||||
import org.junit.After;
|
||||
import org.junit.Test;
|
||||
|
||||
import org.springframework.context.ConfigurableApplicationContext;
|
||||
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
|
||||
import org.springframework.core.env.MutablePropertySources;
|
||||
import org.springframework.core.env.PropertySource;
|
||||
import org.springframework.data.gemfire.tests.integration.IntegrationTestsSupport;
|
||||
import org.springframework.data.gemfire.util.ArrayUtils;
|
||||
import org.springframework.mock.env.MockPropertySource;
|
||||
import org.springframework.util.StringUtils;
|
||||
@@ -52,9 +53,10 @@ import org.springframework.util.StringUtils;
|
||||
* @see org.springframework.core.env.PropertySource
|
||||
* @see org.springframework.data.gemfire.config.annotation.EnableSsl
|
||||
* @see org.springframework.data.gemfire.config.annotation.SslConfiguration
|
||||
* @see org.springframework.data.gemfire.tests.integration.IntegrationTestsSupport
|
||||
* @since 2.2.0
|
||||
*/
|
||||
public class EnableSslConfigurationDefaultContextIntegrationTests {
|
||||
public class EnableSslConfigurationDefaultContextIntegrationTests extends IntegrationTestsSupport {
|
||||
|
||||
private static final String GEMFIRE_LOG_LEVEL = "error";
|
||||
|
||||
|
||||
@@ -36,6 +36,7 @@ import org.springframework.context.annotation.AnnotationConfigApplicationContext
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.core.env.MutablePropertySources;
|
||||
import org.springframework.core.env.PropertySource;
|
||||
import org.springframework.data.gemfire.tests.integration.IntegrationTestsSupport;
|
||||
import org.springframework.data.gemfire.wan.GatewayReceiverFactoryBean;
|
||||
import org.springframework.mock.env.MockPropertySource;
|
||||
|
||||
@@ -47,14 +48,15 @@ import org.springframework.mock.env.MockPropertySource;
|
||||
* @see org.mockito.Mockito
|
||||
* @see org.apache.geode.cache.server.CacheServer
|
||||
* @see org.springframework.context.annotation.Configuration
|
||||
* @see org.springframework.data.gemfire.config.annotation.GatewayReceiverConfigurer
|
||||
* @see org.springframework.data.gemfire.config.annotation.GatewayReceiverConfiguration
|
||||
* @see org.springframework.data.gemfire.tests.integration.IntegrationTestsSupport
|
||||
* @see org.springframework.data.gemfire.wan.GatewayReceiverFactoryBean
|
||||
* @see org.springframework.test.context.ContextConfiguration
|
||||
* @see org.springframework.test.context.junit4.SpringRunner
|
||||
* @see org.springframework.data.gemfire.wan.GatewayReceiverFactoryBean
|
||||
* @see GatewayReceiverConfigurer
|
||||
* @see GatewayReceiverConfiguration
|
||||
* @since 2.2.0
|
||||
*/
|
||||
public class GatewayReceiverPropertiesTests {
|
||||
public class GatewayReceiverPropertiesTests extends IntegrationTestsSupport {
|
||||
|
||||
private ConfigurableApplicationContext applicationContext;
|
||||
|
||||
|
||||
@@ -34,6 +34,7 @@ import org.springframework.context.ConfigurableApplicationContext;
|
||||
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
|
||||
import org.springframework.core.env.PropertiesPropertySource;
|
||||
import org.springframework.data.gemfire.GemFireProperties;
|
||||
import org.springframework.data.gemfire.tests.integration.IntegrationTestsSupport;
|
||||
import org.springframework.data.gemfire.util.ArrayUtils;
|
||||
import org.springframework.data.gemfire.util.PropertiesBuilder;
|
||||
import org.springframework.util.StringUtils;
|
||||
@@ -50,12 +51,13 @@ import org.springframework.util.StringUtils;
|
||||
* @see org.springframework.core.env.PropertiesPropertySource
|
||||
* @see org.springframework.data.gemfire.config.annotation.ClientCacheApplication
|
||||
* @see org.springframework.data.gemfire.config.annotation.EnableLogging
|
||||
* @see org.springframework.data.gemfire.tests.integration.IntegrationTestsSupport
|
||||
* @see org.springframework.data.gemfire.util.PropertiesBuilder
|
||||
* @since 1.9.0
|
||||
*/
|
||||
public class LoggingConfigurationIntegrationTests {
|
||||
public class LoggingConfigurationIntegrationTests extends IntegrationTestsSupport {
|
||||
|
||||
private AtomicReference<Properties> propertiesReference = new AtomicReference<>(null);
|
||||
private final AtomicReference<Properties> propertiesReference = new AtomicReference<>(null);
|
||||
|
||||
private ConfigurableApplicationContext applicationContext;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user