diff --git a/spring-data-geode/src/test/java/org/springframework/data/gemfire/AutoRegionLookupDao.java b/spring-data-geode/src/test/java/org/springframework/data/gemfire/AutoRegionLookupDao.java index a5d8948eb..116bece5c 100644 --- a/spring-data-geode/src/test/java/org/springframework/data/gemfire/AutoRegionLookupDao.java +++ b/spring-data-geode/src/test/java/org/springframework/data/gemfire/AutoRegionLookupDao.java @@ -17,11 +17,11 @@ import static org.assertj.core.api.Assertions.assertThat; -import javax.annotation.Resource; - import org.apache.geode.cache.DataPolicy; import org.apache.geode.cache.Region; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.context.annotation.DependsOn; import org.springframework.dao.support.DaoSupport; import org.springframework.stereotype.Repository; @@ -46,16 +46,20 @@ @SuppressWarnings("unused") public class AutoRegionLookupDao extends DaoSupport { - @Resource(name = "NativePartitionedRegion") + @Autowired + @Qualifier("NativePartitionedRegion") private Region nativePartitionedRegion; - @Resource(name = "NativeReplicateParent") + @Autowired + @Qualifier("NativeReplicateParent") private Region nativeReplicateParent; - @Resource(name = "/NativeReplicateParent/NativeReplicateChild") + @Autowired + @Qualifier("/NativeReplicateParent/NativeReplicateChild") private Region nativeReplicateChild; - @Resource(name = "/NativeReplicateParent/NativeReplicateChild/NativeReplicateGrandchild") + @Autowired + @Qualifier("/NativeReplicateParent/NativeReplicateChild/NativeReplicateGrandchild") private Region nativeReplicateGrandchild; protected static void assertRegionMetaData(Region region, String expectedName, DataPolicy expectedDataPolicy) { diff --git a/spring-data-geode/src/test/java/org/springframework/data/gemfire/AutoRegionLookupWithAutowiringIntegrationTests.java b/spring-data-geode/src/test/java/org/springframework/data/gemfire/AutoRegionLookupWithAutowiringIntegrationTests.java index 0c69208e7..01f8ec72e 100644 --- a/spring-data-geode/src/test/java/org/springframework/data/gemfire/AutoRegionLookupWithAutowiringIntegrationTests.java +++ b/spring-data-geode/src/test/java/org/springframework/data/gemfire/AutoRegionLookupWithAutowiringIntegrationTests.java @@ -17,8 +17,6 @@ import static org.assertj.core.api.Assertions.assertThat; -import javax.annotation.Resource; - import org.junit.Test; import org.junit.runner.RunWith; @@ -26,6 +24,7 @@ import org.apache.geode.cache.Region; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.data.gemfire.tests.integration.IntegrationTestsSupport; import org.springframework.stereotype.Component; import org.springframework.test.context.ContextConfiguration; @@ -87,16 +86,20 @@ public void testAutowiredNativeRegions() { @Component public static final class TestComponent { - @Resource(name = "NativePartitionedRegion") + @Autowired + @Qualifier("NativePartitionedRegion") Region nativePartitionedRegion; - @Resource(name = "NativeReplicateParent") + @Autowired + @Qualifier("NativeReplicateParent") Region nativeReplicateParent; - @Resource(name = "/NativeReplicateParent/NativeReplicateChild") + @Autowired + @Qualifier("/NativeReplicateParent/NativeReplicateChild") Region nativeReplicateChild; - @Resource(name = "/NativeReplicateParent/NativeReplicateChild/NativeReplicateGrandchild") + @Autowired + @Qualifier("/NativeReplicateParent/NativeReplicateChild/NativeReplicateGrandchild") Region nativeReplicateGrandchild; } diff --git a/spring-data-geode/src/test/java/org/springframework/data/gemfire/CacheServerIntegrationTests.java b/spring-data-geode/src/test/java/org/springframework/data/gemfire/CacheServerIntegrationTests.java index 4cd4c9f01..3db76b84a 100644 --- a/spring-data-geode/src/test/java/org/springframework/data/gemfire/CacheServerIntegrationTests.java +++ b/spring-data-geode/src/test/java/org/springframework/data/gemfire/CacheServerIntegrationTests.java @@ -19,8 +19,6 @@ import java.io.File; -import javax.annotation.Resource; - import org.junit.AfterClass; import org.junit.BeforeClass; import org.junit.Test; @@ -28,6 +26,7 @@ import org.apache.geode.cache.server.CacheServer; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.gemfire.tests.integration.IntegrationTestsSupport; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringRunner; @@ -64,7 +63,7 @@ private static void deleteRecursive(final File path) { path.delete(); } - @Resource(name = "testCacheServer") + @Autowired private CacheServer cacheServer; @BeforeClass diff --git a/spring-data-geode/src/test/java/org/springframework/data/gemfire/CollocatedRegionIntegrationTests.java b/spring-data-geode/src/test/java/org/springframework/data/gemfire/CollocatedRegionIntegrationTests.java index 180d3d5ff..ee6aee230 100644 --- a/spring-data-geode/src/test/java/org/springframework/data/gemfire/CollocatedRegionIntegrationTests.java +++ b/spring-data-geode/src/test/java/org/springframework/data/gemfire/CollocatedRegionIntegrationTests.java @@ -17,16 +17,15 @@ import static org.assertj.core.api.Assertions.assertThat; -import javax.annotation.Resource; - import org.junit.Test; import org.junit.runner.RunWith; import org.apache.geode.cache.Region; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.data.gemfire.tests.integration.IntegrationTestsSupport; -import org.springframework.data.gemfire.tests.mock.context.GemFireMockObjectsApplicationContextInitializer; -import org.springframework.test.context.ContextConfiguration; +import org.springframework.data.gemfire.tests.unit.annotation.GemFireUnitTest; import org.springframework.test.context.junit4.SpringRunner; /** @@ -43,15 +42,16 @@ * @since 1.3.3 */ @RunWith(SpringRunner.class) -@ContextConfiguration(value = "colocated-region.xml", - initializers = GemFireMockObjectsApplicationContextInitializer.class) +@GemFireUnitTest @SuppressWarnings("unused") public class CollocatedRegionIntegrationTests extends IntegrationTestsSupport { - @Resource(name = "colocatedRegion") + @Autowired + @Qualifier("colocatedRegion") private Region colocatedRegion; - @Resource(name = "sourceRegion") + @Autowired + @Qualifier("sourceRegion") private Region sourceRegion; protected static void assertRegionExists(String expectedRegionName, Region region) { diff --git a/spring-data-geode/src/test/java/org/springframework/data/gemfire/DiskStoreBeanUsingPropertyPlaceholdersIntegrationTests.java b/spring-data-geode/src/test/java/org/springframework/data/gemfire/DiskStoreBeanUsingPropertyPlaceholdersIntegrationTests.java index 95342869a..2a308ef82 100644 --- a/spring-data-geode/src/test/java/org/springframework/data/gemfire/DiskStoreBeanUsingPropertyPlaceholdersIntegrationTests.java +++ b/spring-data-geode/src/test/java/org/springframework/data/gemfire/DiskStoreBeanUsingPropertyPlaceholdersIntegrationTests.java @@ -19,17 +19,16 @@ import java.util.Map; -import javax.annotation.Resource; - +import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; import org.apache.geode.cache.DiskStore; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.data.gemfire.tests.integration.IntegrationTestsSupport; -import org.springframework.data.gemfire.tests.mock.context.GemFireMockObjectsApplicationContextInitializer; -import org.springframework.test.context.ContextConfiguration; +import org.springframework.data.gemfire.tests.unit.annotation.GemFireUnitTest; import org.springframework.test.context.junit4.SpringRunner; /** @@ -48,18 +47,28 @@ * @since 1.3.4 */ @RunWith(SpringRunner.class) -@ContextConfiguration(locations = "diskstore-using-propertyplaceholders-config.xml", - initializers = GemFireMockObjectsApplicationContextInitializer.class) +@GemFireUnitTest @SuppressWarnings("unused") public class DiskStoreBeanUsingPropertyPlaceholdersIntegrationTests extends IntegrationTestsSupport { @Autowired private DiskStore testDataStore; - @Resource(name="diskStoreConfiguration") - private Map diskStoreConfiguration; + @Autowired + @Qualifier("diskStoreConfiguration") + private Map diskStoreConfiguration; + + @Before + public void assertDiskStoreConfiguration() { + + //System.err.printf("Map of Type [%s]%n", ObjectUtils.nullSafeClassName(this.diskStoreConfiguration)); + //System.err.printf("Map with Contents [%s]%n", this.diskStoreConfiguration); + assertThat(this.diskStoreConfiguration).isNotNull(); + assertThat(String.valueOf(this.diskStoreConfiguration.get("allowForceCompaction"))).isEqualTo("false"); + assertThat(String.valueOf(this.diskStoreConfiguration.get("writeBufferSize"))).isEqualTo("65536"); + } - private Object getExpectedValue(final String propertyPlaceholderName) { + private Object getExpectedValue(String propertyPlaceholderName) { return this.diskStoreConfiguration.get(propertyPlaceholderName); } diff --git a/spring-data-geode/src/test/java/org/springframework/data/gemfire/GemfireTemplateIntegrationTests.java b/spring-data-geode/src/test/java/org/springframework/data/gemfire/GemfireTemplateIntegrationTests.java index c67025d46..09746ed99 100644 --- a/spring-data-geode/src/test/java/org/springframework/data/gemfire/GemfireTemplateIntegrationTests.java +++ b/spring-data-geode/src/test/java/org/springframework/data/gemfire/GemfireTemplateIntegrationTests.java @@ -27,8 +27,6 @@ import java.util.Objects; import java.util.Properties; -import javax.annotation.Resource; - import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; @@ -38,6 +36,7 @@ import org.apache.geode.cache.query.SelectResults; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.dao.InvalidDataAccessApiUsageException; @@ -91,7 +90,8 @@ public class GemfireTemplateIntegrationTests extends IntegrationTestsSupport { @Autowired private GemfireTemplate usersTemplate; - @Resource(name = "Users") + @Autowired + @Qualifier("Users") private Region users; private static User newUser(String username) { @@ -453,12 +453,11 @@ CacheFactoryBean gemfireCache() { } @Bean(name = "Users") - LocalRegionFactoryBean usersRegion(GemFireCache gemfireCache) { + LocalRegionFactoryBean usersRegion(GemFireCache gemfireCache) { - LocalRegionFactoryBean usersRegion = new LocalRegionFactoryBean<>(); + LocalRegionFactoryBean usersRegion = new LocalRegionFactoryBean<>(); usersRegion.setCache(gemfireCache); - usersRegion.setClose(false); usersRegion.setPersistent(false); return usersRegion; diff --git a/spring-data-geode/src/test/java/org/springframework/data/gemfire/GemfireTemplateQueriesOnGroupedPooledClientCacheRegionsIntegrationTests.java b/spring-data-geode/src/test/java/org/springframework/data/gemfire/GemfireTemplateQueriesOnGroupedPooledClientCacheRegionsIntegrationTests.java index 9f3d4ef5e..5e21162f0 100644 --- a/spring-data-geode/src/test/java/org/springframework/data/gemfire/GemfireTemplateQueriesOnGroupedPooledClientCacheRegionsIntegrationTests.java +++ b/spring-data-geode/src/test/java/org/springframework/data/gemfire/GemfireTemplateQueriesOnGroupedPooledClientCacheRegionsIntegrationTests.java @@ -23,9 +23,6 @@ import java.util.Properties; import java.util.concurrent.TimeUnit; -import javax.annotation.PostConstruct; -import javax.annotation.Resource; - import org.junit.AfterClass; import org.junit.BeforeClass; import org.junit.Test; @@ -51,6 +48,7 @@ import org.springframework.data.gemfire.support.ConnectionEndpoint; import org.springframework.data.gemfire.support.ConnectionEndpointList; import org.springframework.data.gemfire.tests.integration.ForkingClientServerIntegrationTestsSupport; +import org.springframework.data.gemfire.tests.objects.geode.cache.RegionDataInitializingPostProcessor; import org.springframework.data.gemfire.tests.process.ProcessWrapper; import org.springframework.data.gemfire.util.PropertiesBuilder; import org.springframework.test.context.ContextConfiguration; @@ -331,23 +329,6 @@ public static void main(String[] args) { runSpringApplication(GemFireCacheServerOneConfiguration.class, args); } - @Resource(name = "Cats") - private org.apache.geode.cache.Region cats; - - private Cat save(Cat cat) { - cats.put(cat.getName(), cat); - return cat; - } - - @PostConstruct - public void postConstruct() { - save(Cat.newCat("Grey")); - save(Cat.newCat("Patchit")); - save(Cat.newCat("Tyger")); - save(Cat.newCat("Molly")); - save(Cat.newCat("Sammy")); - } - @Override String groups() { return "serverOne"; @@ -359,15 +340,27 @@ String startLocator(int locatorPort) { } @Bean(name = "Cats") - LocalRegionFactoryBean catsRegion(GemFireCache gemfireCache) { + LocalRegionFactoryBean catsRegion(GemFireCache gemfireCache) { - LocalRegionFactoryBean catsRegion = new LocalRegionFactoryBean(); + LocalRegionFactoryBean catsRegion = new LocalRegionFactoryBean(); catsRegion.setCache(gemfireCache); catsRegion.setPersistent(false); return catsRegion; } + + @Bean + RegionDataInitializingPostProcessor catsRegionDataInitializer() { + + return RegionDataInitializingPostProcessor.withRegion("Cats") + .useAsEntityIdentifier(Cat::getName) + .store(Cat.newCat("Grey")) + .store(Cat.newCat("Patchit")) + .store(Cat.newCat("Tyger")) + .store(Cat.newCat("Molly")) + .store(Cat.newCat("Sammy")); + } } @Configuration @@ -378,20 +371,6 @@ public static void main(String[] args) { runSpringApplication(GemFireCacheServerTwoConfiguration.class, args); } - @Resource(name = "Dogs") - private org.apache.geode.cache.Region dogs; - - private Dog save(Dog dog) { - dogs.put(dog.getName(), dog); - return dog; - } - - @PostConstruct - public void postConstruct() { - save(Dog.newDog("Spuds")); - save(Dog.newDog("Maha")); - } - @Override String groups() { return "serverTwo"; @@ -407,5 +386,14 @@ LocalRegionFactoryBean dogsRegion(GemFireCache gemfireCache) { return dogsRegion; } + + @Bean + RegionDataInitializingPostProcessor dogsRegionDataInitializer() { + + return RegionDataInitializingPostProcessor.withRegion("Dogs") + .useAsEntityIdentifier(Dog::getName) + .store(Dog.newDog("Spuds")) + .store(Dog.newDog("Maha")); + } } } diff --git a/spring-data-geode/src/test/java/org/springframework/data/gemfire/LookupPartitionRegionMutationIntegrationTests.java b/spring-data-geode/src/test/java/org/springframework/data/gemfire/LookupPartitionRegionMutationIntegrationTests.java index 77a9a9796..67c3b5189 100644 --- a/spring-data-geode/src/test/java/org/springframework/data/gemfire/LookupPartitionRegionMutationIntegrationTests.java +++ b/spring-data-geode/src/test/java/org/springframework/data/gemfire/LookupPartitionRegionMutationIntegrationTests.java @@ -25,8 +25,6 @@ import java.util.Collections; import java.util.List; -import javax.annotation.Resource; - import org.junit.Test; import org.junit.runner.RunWith; @@ -51,6 +49,8 @@ import org.apache.geode.cache.util.CacheListenerAdapter; import org.springframework.beans.factory.BeanNameAware; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.data.gemfire.tests.integration.IntegrationTestsSupport; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringRunner; @@ -74,7 +74,8 @@ @SuppressWarnings("unused") public class LookupPartitionRegionMutationIntegrationTests extends IntegrationTestsSupport { - @Resource(name = "Example") + @Autowired + @Qualifier("Example") private Region example; private void assertCacheListeners(CacheListener[] cacheListeners, diff --git a/spring-data-geode/src/test/java/org/springframework/data/gemfire/LookupRegionMutationIntegrationTests.java b/spring-data-geode/src/test/java/org/springframework/data/gemfire/LookupRegionMutationIntegrationTests.java index 58148721e..4c16a2f8d 100644 --- a/spring-data-geode/src/test/java/org/springframework/data/gemfire/LookupRegionMutationIntegrationTests.java +++ b/spring-data-geode/src/test/java/org/springframework/data/gemfire/LookupRegionMutationIntegrationTests.java @@ -24,8 +24,6 @@ import java.util.Collections; import java.util.List; -import javax.annotation.Resource; - import org.junit.Test; import org.junit.runner.RunWith; @@ -50,6 +48,8 @@ import org.apache.geode.cache.util.CacheListenerAdapter; import org.springframework.beans.factory.BeanNameAware; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.data.gemfire.tests.integration.IntegrationTestsSupport; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringRunner; @@ -73,7 +73,8 @@ @SuppressWarnings("unused") public class LookupRegionMutationIntegrationTests extends IntegrationTestsSupport { - @Resource(name = "Example") + @Autowired + @Qualifier("Example") private Region example; private void assertCacheListeners(CacheListener[] cacheListeners, diff --git a/spring-data-geode/src/test/java/org/springframework/data/gemfire/PdxDiskStoreIntegrationTests.java b/spring-data-geode/src/test/java/org/springframework/data/gemfire/PdxDiskStoreIntegrationTests.java index f8c4d68d9..f9d7eecfe 100644 --- a/spring-data-geode/src/test/java/org/springframework/data/gemfire/PdxDiskStoreIntegrationTests.java +++ b/spring-data-geode/src/test/java/org/springframework/data/gemfire/PdxDiskStoreIntegrationTests.java @@ -20,8 +20,6 @@ import java.io.File; import java.io.Serializable; -import javax.annotation.Resource; - import org.junit.AfterClass; import org.junit.Before; import org.junit.BeforeClass; @@ -31,6 +29,8 @@ import org.apache.geode.cache.DiskStore; import org.apache.geode.cache.Region; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.data.gemfire.tests.integration.IntegrationTestsSupport; import org.springframework.test.annotation.DirtiesContext; import org.springframework.test.context.ContextConfiguration; @@ -62,7 +62,8 @@ public class PdxDiskStoreIntegrationTests extends IntegrationTestsSupport { protected static final int NUMBER_OF_REGION_ENTRIES = 1000; - @Resource(name = "pdxDataRegion") + @Autowired + @Qualifier("pdxDataRegion") private Region, ValueHolder> pdxDataRegion; protected static void assertRegionExists(String expectedRegionName, String expectedRegionPath, Region region) { diff --git a/spring-data-geode/src/test/java/org/springframework/data/gemfire/RegionDataPolicyShortcutsIntegrationTests.java b/spring-data-geode/src/test/java/org/springframework/data/gemfire/RegionDataPolicyShortcutsIntegrationTests.java index 70cc15be9..2aabb1c5c 100644 --- a/spring-data-geode/src/test/java/org/springframework/data/gemfire/RegionDataPolicyShortcutsIntegrationTests.java +++ b/spring-data-geode/src/test/java/org/springframework/data/gemfire/RegionDataPolicyShortcutsIntegrationTests.java @@ -17,8 +17,6 @@ import static org.assertj.core.api.Assertions.assertThat; -import javax.annotation.Resource; - import org.junit.Test; import org.junit.runner.RunWith; @@ -28,6 +26,8 @@ import org.apache.geode.cache.Region; import org.apache.geode.cache.RegionShortcut; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.data.gemfire.tests.integration.IntegrationTestsSupport; import org.springframework.data.gemfire.tests.unit.annotation.GemFireUnitTest; import org.springframework.data.gemfire.util.RegionUtils; @@ -52,28 +52,36 @@ @SuppressWarnings("unused") public class RegionDataPolicyShortcutsIntegrationTests extends IntegrationTestsSupport { - @Resource(name = "LocalWithDataPolicy") + @Autowired + @Qualifier("LocalWithDataPolicy") private Region localWithDataPolicy; - @Resource(name = "LocalWithShortcut") + @Autowired + @Qualifier("LocalWithShortcut") private Region localWithShortcut; - @Resource(name = "PartitionWithDataPolicy") + @Autowired + @Qualifier("PartitionWithDataPolicy") private Region partitionWithDataPolicy; - @Resource(name = "PartitionWithShortcut") + @Autowired + @Qualifier("PartitionWithShortcut") private Region partitionWithShortcut; - @Resource(name = "ReplicateWithDataPolicy") + @Autowired + @Qualifier("ReplicateWithDataPolicy") private Region replicateWithDataPolicy; - @Resource(name = "ReplicateWithShortcut") + @Autowired + @Qualifier("ReplicateWithShortcut") private Region replicateWithShortcut; - @Resource(name = "ShortcutDefaults") + @Autowired + @Qualifier("ShortcutDefaults") private Region shortcutDefaults; - @Resource(name = "ShortcutOverrides") + @Autowired + @Qualifier("ShortcutOverrides") private Region shortcutOverrides; @Test diff --git a/spring-data-geode/src/test/java/org/springframework/data/gemfire/SubRegionIntegrationTests.java b/spring-data-geode/src/test/java/org/springframework/data/gemfire/SubRegionIntegrationTests.java index d3cdd742f..f9520caaf 100644 --- a/spring-data-geode/src/test/java/org/springframework/data/gemfire/SubRegionIntegrationTests.java +++ b/spring-data-geode/src/test/java/org/springframework/data/gemfire/SubRegionIntegrationTests.java @@ -17,8 +17,6 @@ import static org.assertj.core.api.Assertions.assertThat; -import javax.annotation.Resource; - import org.junit.Test; import org.junit.runner.RunWith; @@ -33,6 +31,7 @@ import org.apache.geode.cache.SubscriptionAttributes; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.data.gemfire.tests.integration.IntegrationTestsSupport; import org.springframework.data.gemfire.tests.unit.annotation.GemFireUnitTest; import org.springframework.test.context.junit4.SpringRunner; @@ -58,10 +57,12 @@ public class SubRegionIntegrationTests extends IntegrationTestsSupport { @Autowired private Cache cache; - @Resource(name = "Customers") + @Autowired + @Qualifier("Customers") private Region customers; - @Resource(name = "/Customers/Accounts") + @Autowired + @Qualifier("/Customers/Accounts") private Region accounts; @Test diff --git a/spring-data-geode/src/test/java/org/springframework/data/gemfire/TxIntegrationTests.java b/spring-data-geode/src/test/java/org/springframework/data/gemfire/TxIntegrationTests.java index 5e17ca2f3..e63ad52b2 100644 --- a/spring-data-geode/src/test/java/org/springframework/data/gemfire/TxIntegrationTests.java +++ b/spring-data-geode/src/test/java/org/springframework/data/gemfire/TxIntegrationTests.java @@ -19,11 +19,11 @@ import java.util.Map; -import javax.annotation.Resource; - import org.junit.Test; import org.junit.runner.RunWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.data.gemfire.tests.integration.IntegrationTestsSupport; import org.springframework.test.annotation.Rollback; import org.springframework.test.context.ContextConfiguration; @@ -49,10 +49,12 @@ @SuppressWarnings("unused") public class TxIntegrationTests extends IntegrationTestsSupport { - @Resource(name = "rollback-region") + @Autowired + @Qualifier("rollback-region") private Map rollbackRegion; - @Resource(name = "commit-region") + @Autowired + @Qualifier("commit-region") private Map commitRegion; private boolean txCommit = false; diff --git a/spring-data-geode/src/test/java/org/springframework/data/gemfire/cache/CompoundCachePutCacheEvictIntegrationTests.java b/spring-data-geode/src/test/java/org/springframework/data/gemfire/cache/CompoundCachePutCacheEvictIntegrationTests.java index 76f17fcb8..c8a4b0376 100644 --- a/spring-data-geode/src/test/java/org/springframework/data/gemfire/cache/CompoundCachePutCacheEvictIntegrationTests.java +++ b/spring-data-geode/src/test/java/org/springframework/data/gemfire/cache/CompoundCachePutCacheEvictIntegrationTests.java @@ -22,8 +22,6 @@ import java.util.List; import java.util.concurrent.atomic.AtomicBoolean; -import javax.annotation.Resource; - import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; @@ -32,6 +30,7 @@ import org.apache.geode.cache.client.ClientRegionShortcut; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.cache.annotation.CacheEvict; import org.springframework.cache.annotation.CachePut; import org.springframework.cache.annotation.Cacheable; @@ -92,7 +91,8 @@ public class CompoundCachePutCacheEvictIntegrationTests extends IntegrationTests @Autowired private EmployeeService employeeService; - @Resource(name = "Employees") + @Autowired + @Qualifier("Employees") private org.apache.geode.cache.Region employeesRegion; private void assertNoEmployeeInDepartment(Department department) { diff --git a/spring-data-geode/src/test/java/org/springframework/data/gemfire/client/ClientCachePoolIntegrationTests.java b/spring-data-geode/src/test/java/org/springframework/data/gemfire/client/ClientCachePoolIntegrationTests.java index 7cd139a18..653fd1093 100644 --- a/spring-data-geode/src/test/java/org/springframework/data/gemfire/client/ClientCachePoolIntegrationTests.java +++ b/spring-data-geode/src/test/java/org/springframework/data/gemfire/client/ClientCachePoolIntegrationTests.java @@ -18,8 +18,6 @@ import static org.assertj.core.api.Assertions.assertThat; -import javax.annotation.Resource; - import org.junit.BeforeClass; import org.junit.Test; import org.junit.runner.RunWith; @@ -30,6 +28,8 @@ import org.apache.geode.cache.Region; import org.apache.geode.cache.client.ClientCache; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.data.gemfire.fork.ServerProcess; import org.springframework.data.gemfire.tests.integration.ForkingClientServerIntegrationTestsSupport; import org.springframework.test.context.ContextConfiguration; @@ -60,7 +60,8 @@ public static void startGeodeServer() throws Exception { getServerContextXmlFileLocation(ClientCachePoolIntegrationTests.class)); } - @Resource(name = "Factorials") + @Autowired + @Qualifier("Factorials") private Region factorials; @Test diff --git a/spring-data-geode/src/test/java/org/springframework/data/gemfire/client/ClientCacheSecurityIntegrationTests.java b/spring-data-geode/src/test/java/org/springframework/data/gemfire/client/ClientCacheSecurityIntegrationTests.java index 08c9efd00..555fbd358 100644 --- a/spring-data-geode/src/test/java/org/springframework/data/gemfire/client/ClientCacheSecurityIntegrationTests.java +++ b/spring-data-geode/src/test/java/org/springframework/data/gemfire/client/ClientCacheSecurityIntegrationTests.java @@ -21,8 +21,6 @@ import java.util.ArrayList; import java.util.List; -import javax.annotation.Resource; - import org.junit.BeforeClass; import org.junit.Test; import org.junit.runner.RunWith; @@ -32,6 +30,8 @@ import org.apache.geode.cache.LoaderHelper; import org.apache.geode.cache.Region; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.core.io.ClassPathResource; import org.springframework.data.gemfire.fork.ServerProcess; import org.springframework.data.gemfire.tests.integration.ForkingClientServerIntegrationTestsSupport; @@ -74,7 +74,8 @@ public static void startGeodeServer() throws IOException { System.setProperty("javax.net.ssl.keyStore", trustedKeystore.getFile().getAbsolutePath()); } - @Resource(name = "Example") + @Autowired + @Qualifier("Example") private Region example; @Test diff --git a/spring-data-geode/src/test/java/org/springframework/data/gemfire/client/ClientCacheVariableLocatorsIntegrationTests.java b/spring-data-geode/src/test/java/org/springframework/data/gemfire/client/ClientCacheVariableLocatorsIntegrationTests.java index d217a8e28..1a2121ec6 100644 --- a/spring-data-geode/src/test/java/org/springframework/data/gemfire/client/ClientCacheVariableLocatorsIntegrationTests.java +++ b/spring-data-geode/src/test/java/org/springframework/data/gemfire/client/ClientCacheVariableLocatorsIntegrationTests.java @@ -20,8 +20,6 @@ import java.io.IOException; import java.util.concurrent.atomic.AtomicInteger; -import javax.annotation.Resource; - import org.junit.Before; import org.junit.BeforeClass; import org.junit.Test; @@ -34,6 +32,8 @@ import org.apache.geode.cache.client.Pool; import org.apache.geode.cache.client.PoolManager; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.data.gemfire.fork.ServerProcess; import org.springframework.data.gemfire.tests.integration.ForkingClientServerIntegrationTestsSupport; import org.springframework.test.context.ContextConfiguration; @@ -68,7 +68,8 @@ public static void startGeodeServer() throws IOException { getServerContextXmlFileLocation(ClientCacheVariableLocatorsIntegrationTests.class)); } - @Resource(name = "Example") + @Autowired + @Qualifier("Example") private Region example; @Before diff --git a/spring-data-geode/src/test/java/org/springframework/data/gemfire/client/ClientCacheVariableServersIntegrationTests.java b/spring-data-geode/src/test/java/org/springframework/data/gemfire/client/ClientCacheVariableServersIntegrationTests.java index 8cc948cd5..3a7ba3c1a 100644 --- a/spring-data-geode/src/test/java/org/springframework/data/gemfire/client/ClientCacheVariableServersIntegrationTests.java +++ b/spring-data-geode/src/test/java/org/springframework/data/gemfire/client/ClientCacheVariableServersIntegrationTests.java @@ -24,8 +24,6 @@ import java.util.Map; import java.util.concurrent.atomic.AtomicInteger; -import javax.annotation.Resource; - import org.junit.AfterClass; import org.junit.Before; import org.junit.BeforeClass; @@ -40,6 +38,7 @@ import org.apache.geode.cache.server.CacheServer; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.context.ApplicationContext; import org.springframework.context.ApplicationListener; import org.springframework.context.event.ContextRefreshedEvent; @@ -98,7 +97,8 @@ public static void cleanup() { @Autowired private Pool serverPool; - @Resource(name = "Example") + @Autowired + @Qualifier("Example") private Region example; @Before diff --git a/spring-data-geode/src/test/java/org/springframework/data/gemfire/client/ClientRegionIntegrationTests.java b/spring-data-geode/src/test/java/org/springframework/data/gemfire/client/ClientRegionIntegrationTests.java index 84572e330..3f97d5c41 100644 --- a/spring-data-geode/src/test/java/org/springframework/data/gemfire/client/ClientRegionIntegrationTests.java +++ b/spring-data-geode/src/test/java/org/springframework/data/gemfire/client/ClientRegionIntegrationTests.java @@ -17,8 +17,6 @@ import static org.assertj.core.api.Assertions.assertThat; -import javax.annotation.Resource; - import org.junit.Test; import org.junit.runner.RunWith; @@ -27,6 +25,8 @@ import org.apache.geode.cache.Region; import org.apache.geode.cache.client.ClientRegionShortcut; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.context.annotation.Bean; import org.springframework.data.gemfire.GemfireUtils; import org.springframework.data.gemfire.config.annotation.ClientCacheApplication; @@ -53,7 +53,8 @@ @SuppressWarnings("unused") public class ClientRegionIntegrationTests extends IntegrationTestsSupport { - @Resource(name = "Example") + @Autowired + @Qualifier("Example") private Region example; @Test diff --git a/spring-data-geode/src/test/java/org/springframework/data/gemfire/client/ClientRegionWithCacheLoaderCacheWriterIntegrationTests.java b/spring-data-geode/src/test/java/org/springframework/data/gemfire/client/ClientRegionWithCacheLoaderCacheWriterIntegrationTests.java index c28cb0b8f..15e40c0b8 100644 --- a/spring-data-geode/src/test/java/org/springframework/data/gemfire/client/ClientRegionWithCacheLoaderCacheWriterIntegrationTests.java +++ b/spring-data-geode/src/test/java/org/springframework/data/gemfire/client/ClientRegionWithCacheLoaderCacheWriterIntegrationTests.java @@ -21,8 +21,6 @@ import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.atomic.AtomicInteger; -import javax.annotation.Resource; - import org.junit.Test; import org.junit.runner.RunWith; @@ -36,6 +34,7 @@ import org.apache.geode.cache.util.CacheWriterAdapter; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.context.ApplicationContext; import org.springframework.data.gemfire.tests.integration.IntegrationTestsSupport; import org.springframework.test.context.ContextConfiguration; @@ -66,7 +65,8 @@ public class ClientRegionWithCacheLoaderCacheWriterIntegrationTests extends Inte @Autowired private ApplicationContext applicationContext; - @Resource(name = "localAppDataRegion") + @Autowired + @Qualifier("localAppDataRegion") private Region localAppData; @Test diff --git a/spring-data-geode/src/test/java/org/springframework/data/gemfire/client/ClientSubRegionIntegrationTests.java b/spring-data-geode/src/test/java/org/springframework/data/gemfire/client/ClientSubRegionIntegrationTests.java index b8ca34586..6c8b53709 100644 --- a/spring-data-geode/src/test/java/org/springframework/data/gemfire/client/ClientSubRegionIntegrationTests.java +++ b/spring-data-geode/src/test/java/org/springframework/data/gemfire/client/ClientSubRegionIntegrationTests.java @@ -17,8 +17,6 @@ import static org.assertj.core.api.Assertions.assertThat; -import javax.annotation.Resource; - import org.junit.BeforeClass; import org.junit.Test; import org.junit.runner.RunWith; @@ -27,6 +25,7 @@ import org.apache.geode.cache.client.ClientCache; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.data.gemfire.GemfireTemplate; import org.springframework.data.gemfire.fork.ServerProcess; import org.springframework.data.gemfire.tests.integration.ForkingClientServerIntegrationTestsSupport; @@ -59,16 +58,20 @@ public static void startGeodeServer() throws Exception { @Autowired private ClientCache clientCache; - @Resource(name = "parentTemplate") + @Autowired + @Qualifier("parentTemplate") private GemfireTemplate parentTemplate; - @Resource(name = "childTemplate") + @Autowired + @Qualifier("childTemplate") private GemfireTemplate childTemplate; - @Resource(name = "Parent") + @Autowired + @Qualifier("Parent") private Region parent; - @Resource(name = "/Parent/Child") + @Autowired + @Qualifier("/Parent/Child") private Region child; private void assertRegion(Region region, String name) { diff --git a/spring-data-geode/src/test/java/org/springframework/data/gemfire/client/DurableClientCacheIntegrationTests.java b/spring-data-geode/src/test/java/org/springframework/data/gemfire/client/DurableClientCacheIntegrationTests.java index 7d4c5b1d0..074347439 100644 --- a/spring-data-geode/src/test/java/org/springframework/data/gemfire/client/DurableClientCacheIntegrationTests.java +++ b/spring-data-geode/src/test/java/org/springframework/data/gemfire/client/DurableClientCacheIntegrationTests.java @@ -30,8 +30,6 @@ import java.util.concurrent.atomic.AtomicInteger; import java.util.function.Function; -import javax.annotation.Resource; - import org.junit.After; import org.junit.Before; import org.junit.BeforeClass; @@ -52,6 +50,7 @@ import org.springframework.beans.BeansException; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.beans.factory.config.BeanPostProcessor; import org.springframework.data.gemfire.fork.ServerProcess; import org.springframework.data.gemfire.tests.integration.ForkingClientServerIntegrationTestsSupport; @@ -122,7 +121,8 @@ private T valueBeforeAndAfterDirtiesContext(T valueBefore, T valueAfter) { @Autowired private ClientCache clientCache; - @Resource(name = "Example") + @Autowired + @Qualifier("Example") private Region example; @Before diff --git a/spring-data-geode/src/test/java/org/springframework/data/gemfire/client/GemFireDataSourceIntegrationTest.java b/spring-data-geode/src/test/java/org/springframework/data/gemfire/client/GemFireDataSourceIntegrationTest.java index 73cc1cf0d..eaafd7236 100644 --- a/spring-data-geode/src/test/java/org/springframework/data/gemfire/client/GemFireDataSourceIntegrationTest.java +++ b/spring-data-geode/src/test/java/org/springframework/data/gemfire/client/GemFireDataSourceIntegrationTest.java @@ -21,8 +21,6 @@ import java.util.ArrayList; import java.util.List; -import javax.annotation.Resource; - import org.junit.AfterClass; import org.junit.BeforeClass; import org.junit.Test; @@ -32,6 +30,7 @@ import org.apache.geode.cache.client.ClientCache; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.context.ApplicationContext; import org.springframework.data.gemfire.GemfireUtils; import org.springframework.data.gemfire.fork.ServerProcess; @@ -91,13 +90,16 @@ public static void stopGemFireServer() { @Autowired private ClientCache gemfireClientCache; - @Resource(name = "ClientOnlyRegion") + @Autowired + @Qualifier("ClientOnlyRegion") private Region clientOnlyRegion; - @Resource(name = "ClientServerRegion") + @Autowired + @Qualifier("ClientServerRegion") private Region clientServerRegion; - @Resource(name = "ServerOnlyRegion") + @Autowired + @Qualifier("ServerOnlyRegion") private Region serverOnlyRegion; @SuppressWarnings("unchecked") diff --git a/spring-data-geode/src/test/java/org/springframework/data/gemfire/client/GemFireDataSourceUsingNonSpringConfiguredGemFireServerIntegrationTests.java b/spring-data-geode/src/test/java/org/springframework/data/gemfire/client/GemFireDataSourceUsingNonSpringConfiguredGemFireServerIntegrationTests.java index 61bf2ff1f..8ba08269a 100644 --- a/spring-data-geode/src/test/java/org/springframework/data/gemfire/client/GemFireDataSourceUsingNonSpringConfiguredGemFireServerIntegrationTests.java +++ b/spring-data-geode/src/test/java/org/springframework/data/gemfire/client/GemFireDataSourceUsingNonSpringConfiguredGemFireServerIntegrationTests.java @@ -23,7 +23,6 @@ import java.util.ArrayList; import java.util.List; -import javax.annotation.Resource; import javax.sql.DataSource; import org.junit.AfterClass; @@ -36,6 +35,7 @@ import org.apache.geode.distributed.ServerLauncher; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.context.ApplicationContext; import org.springframework.core.io.ClassPathResource; import org.springframework.data.gemfire.GemfireUtils; @@ -147,13 +147,16 @@ public static void stopGemFireServer() { @Autowired private ClientCache gemfireClientCache; - @Resource(name = "LocalRegion") + @Autowired + @Qualifier("LocalRegion") private Region localRegion; - @Resource(name = "ServerRegion") + @Autowired + @Qualifier("ServerRegion") private Region serverRegion; - @Resource(name = "AnotherServerRegion") + @Autowired + @Qualifier("AnotherServerRegion") private Region anotherServerRegion; @SuppressWarnings("unchecked") diff --git a/spring-data-geode/src/test/java/org/springframework/data/gemfire/client/LocalOnlyClientCacheIntegrationTests.java b/spring-data-geode/src/test/java/org/springframework/data/gemfire/client/LocalOnlyClientCacheIntegrationTests.java index b9e12251a..0c98396d3 100644 --- a/spring-data-geode/src/test/java/org/springframework/data/gemfire/client/LocalOnlyClientCacheIntegrationTests.java +++ b/spring-data-geode/src/test/java/org/springframework/data/gemfire/client/LocalOnlyClientCacheIntegrationTests.java @@ -20,8 +20,6 @@ import java.time.Month; -import javax.annotation.Resource; - import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; @@ -31,6 +29,8 @@ import org.apache.geode.cache.client.ClientCache; import org.apache.geode.cache.client.ClientRegionShortcut; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.data.gemfire.GemfireUtils; import org.springframework.data.gemfire.config.annotation.ClientCacheApplication; import org.springframework.data.gemfire.config.annotation.EnableEntityDefinedRegions; @@ -58,7 +58,8 @@ @SuppressWarnings("unused") public class LocalOnlyClientCacheIntegrationTests extends IntegrationTestsSupport { - @Resource(name = "People") + @Autowired + @Qualifier("People") private Region people; @Before diff --git a/spring-data-geode/src/test/java/org/springframework/data/gemfire/client/SpringJavaConfiguredClientCacheIntegrationTests.java b/spring-data-geode/src/test/java/org/springframework/data/gemfire/client/SpringJavaConfiguredClientCacheIntegrationTests.java index 77219d3f0..cc17d1495 100644 --- a/spring-data-geode/src/test/java/org/springframework/data/gemfire/client/SpringJavaConfiguredClientCacheIntegrationTests.java +++ b/spring-data-geode/src/test/java/org/springframework/data/gemfire/client/SpringJavaConfiguredClientCacheIntegrationTests.java @@ -19,14 +19,13 @@ import java.util.Properties; -import javax.annotation.Resource; - import org.junit.Test; import org.junit.runner.RunWith; import org.apache.geode.cache.client.ClientCache; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.data.gemfire.tests.integration.IntegrationTestsSupport; @@ -54,7 +53,8 @@ @SuppressWarnings("unused") public class SpringJavaConfiguredClientCacheIntegrationTests extends IntegrationTestsSupport { - @Resource(name = "&clientCache") + @Autowired + @Qualifier("&clientCache") private ClientCacheFactoryBean clientCacheFactoryBean; @Autowired diff --git a/spring-data-geode/src/test/java/org/springframework/data/gemfire/client/support/PoolManagerPoolResolverIntegrationTests.java b/spring-data-geode/src/test/java/org/springframework/data/gemfire/client/support/PoolManagerPoolResolverIntegrationTests.java index e73579882..384efc499 100644 --- a/spring-data-geode/src/test/java/org/springframework/data/gemfire/client/support/PoolManagerPoolResolverIntegrationTests.java +++ b/spring-data-geode/src/test/java/org/springframework/data/gemfire/client/support/PoolManagerPoolResolverIntegrationTests.java @@ -17,8 +17,6 @@ import static org.assertj.core.api.Assertions.assertThat; -import javax.annotation.Resource; - import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; @@ -76,10 +74,12 @@ public class PoolManagerPoolResolverIntegrationTests extends IntegrationTestsSup private final PoolResolver poolResolver = new PoolManagerPoolResolver(); - @Resource(name = "RegionWithDefaultPool") + @Autowired + @Qualifier("RegionWithDefaultPool") private Region regionWithDefaultPool; - @Resource(name = "RegionWithSwimmingPool") + @Autowired + @Qualifier("RegionWithSwimmingPool") private Region regionWithSwimmingPool; @Before diff --git a/spring-data-geode/src/test/java/org/springframework/data/gemfire/config/annotation/AbstractGeodeSecurityIntegrationTests.java b/spring-data-geode/src/test/java/org/springframework/data/gemfire/config/annotation/AbstractGeodeSecurityIntegrationTests.java index 1bf0ee406..1e3a834cb 100644 --- a/spring-data-geode/src/test/java/org/springframework/data/gemfire/config/annotation/AbstractGeodeSecurityIntegrationTests.java +++ b/spring-data-geode/src/test/java/org/springframework/data/gemfire/config/annotation/AbstractGeodeSecurityIntegrationTests.java @@ -29,7 +29,6 @@ import java.util.concurrent.atomic.AtomicInteger; import javax.annotation.PostConstruct; -import javax.annotation.Resource; import org.junit.AfterClass; import org.junit.BeforeClass; @@ -48,6 +47,7 @@ import org.apache.geode.security.ResourcePermission; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Import; import org.springframework.context.annotation.Profile; @@ -124,7 +124,8 @@ public static void stopGeodeServer() { System.clearProperty(GEODE_SECURITY_PROFILE_PROPERTY); } - @Resource(name = "Echo") + @Autowired + @Qualifier("Echo") private Region echo; @Test diff --git a/spring-data-geode/src/test/java/org/springframework/data/gemfire/config/annotation/CachingDefinedRegionsRegistersInterestsIntegrationTests.java b/spring-data-geode/src/test/java/org/springframework/data/gemfire/config/annotation/CachingDefinedRegionsRegistersInterestsIntegrationTests.java index b189248f4..e9477839a 100644 --- a/spring-data-geode/src/test/java/org/springframework/data/gemfire/config/annotation/CachingDefinedRegionsRegistersInterestsIntegrationTests.java +++ b/spring-data-geode/src/test/java/org/springframework/data/gemfire/config/annotation/CachingDefinedRegionsRegistersInterestsIntegrationTests.java @@ -22,14 +22,14 @@ import java.util.Arrays; -import javax.annotation.Resource; - import org.junit.Test; import org.junit.runner.RunWith; import org.apache.geode.cache.InterestResultPolicy; import org.apache.geode.cache.Region; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.cache.annotation.Cacheable; import org.springframework.context.Lifecycle; import org.springframework.context.annotation.Bean; @@ -67,10 +67,12 @@ public class CachingDefinedRegionsRegistersInterestsIntegrationTests extends Int private static final Interest testInterest = new Interest<>("TestKey", InterestResultPolicy.KEYS_VALUES, false, true); - @Resource(name = "CacheOne") + @Autowired + @Qualifier("CacheOne") private Region cacheOne; - @Resource(name = "CacheTwo") + @Autowired + @Qualifier("CacheTwo") private Region cacheTwo; @Test diff --git a/spring-data-geode/src/test/java/org/springframework/data/gemfire/config/annotation/CachingDefinedRegionsUsesCacheConfigCacheNamesIntegrationTests.java b/spring-data-geode/src/test/java/org/springframework/data/gemfire/config/annotation/CachingDefinedRegionsUsesCacheConfigCacheNamesIntegrationTests.java index 5eb3d79d7..d64edf592 100644 --- a/spring-data-geode/src/test/java/org/springframework/data/gemfire/config/annotation/CachingDefinedRegionsUsesCacheConfigCacheNamesIntegrationTests.java +++ b/spring-data-geode/src/test/java/org/springframework/data/gemfire/config/annotation/CachingDefinedRegionsUsesCacheConfigCacheNamesIntegrationTests.java @@ -22,8 +22,6 @@ import java.util.Objects; import java.util.stream.Collectors; -import javax.annotation.Resource; - import org.junit.After; import org.junit.Before; import org.junit.Test; @@ -34,6 +32,7 @@ import org.apache.geode.cache.client.ClientRegionShortcut; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.cache.annotation.CacheConfig; import org.springframework.cache.annotation.Cacheable; import org.springframework.context.annotation.Bean; @@ -74,16 +73,20 @@ public class CachingDefinedRegionsUsesCacheConfigCacheNamesIntegrationTests exte @Autowired private TestCacheableService service; - @Resource(name = "A") + @Autowired + @Qualifier("A") private Region a; - @Resource(name = "B") + @Autowired + @Qualifier("B") private Region b; - @Resource(name = "C") + @Autowired + @Qualifier("C") private Region c; - @Resource(name = "D") + @Autowired + @Qualifier("D") private Region d; @Before diff --git a/spring-data-geode/src/test/java/org/springframework/data/gemfire/config/annotation/ClientCacheApplicationIntegrationTests.java b/spring-data-geode/src/test/java/org/springframework/data/gemfire/config/annotation/ClientCacheApplicationIntegrationTests.java index 5a13f96e1..0feaa06d4 100644 --- a/spring-data-geode/src/test/java/org/springframework/data/gemfire/config/annotation/ClientCacheApplicationIntegrationTests.java +++ b/spring-data-geode/src/test/java/org/springframework/data/gemfire/config/annotation/ClientCacheApplicationIntegrationTests.java @@ -17,8 +17,6 @@ import static org.assertj.core.api.Assertions.assertThat; -import javax.annotation.Resource; - import org.junit.Test; import org.junit.runner.RunWith; @@ -29,6 +27,8 @@ import org.apache.geode.cache.Region; import org.apache.geode.cache.client.ClientRegionShortcut; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.context.annotation.Bean; import org.springframework.data.gemfire.client.ClientRegionFactoryBean; import org.springframework.data.gemfire.tests.integration.IntegrationTestsSupport; @@ -55,7 +55,8 @@ @SuppressWarnings("unused") public class ClientCacheApplicationIntegrationTests extends IntegrationTestsSupport { - @Resource(name = "Echo") + @Autowired + @Qualifier("Echo") private Region echo; @Test diff --git a/spring-data-geode/src/test/java/org/springframework/data/gemfire/config/annotation/ClientServerCacheApplicationIntegrationTests.java b/spring-data-geode/src/test/java/org/springframework/data/gemfire/config/annotation/ClientServerCacheApplicationIntegrationTests.java index 366f80875..95fb42d1f 100644 --- a/spring-data-geode/src/test/java/org/springframework/data/gemfire/config/annotation/ClientServerCacheApplicationIntegrationTests.java +++ b/spring-data-geode/src/test/java/org/springframework/data/gemfire/config/annotation/ClientServerCacheApplicationIntegrationTests.java @@ -18,8 +18,6 @@ import static org.assertj.core.api.Assertions.assertThat; -import javax.annotation.Resource; - import org.junit.BeforeClass; import org.junit.Test; import org.junit.runner.RunWith; @@ -33,6 +31,7 @@ import org.apache.geode.cache.client.ClientRegionShortcut; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.context.annotation.Bean; import org.springframework.data.gemfire.PartitionedRegionFactoryBean; import org.springframework.data.gemfire.client.ClientRegionFactoryBean; @@ -70,7 +69,8 @@ public static void startGeodeServer() throws Exception { @Autowired private ClientCache clientCache; - @Resource(name = "Echo") + @Autowired + @Qualifier("Echo") private Region echo; @Test diff --git a/spring-data-geode/src/test/java/org/springframework/data/gemfire/config/annotation/EnableClusterDefinedRegionsIntegrationTests.java b/spring-data-geode/src/test/java/org/springframework/data/gemfire/config/annotation/EnableClusterDefinedRegionsIntegrationTests.java index 6a98f34ad..ab504b024 100644 --- a/spring-data-geode/src/test/java/org/springframework/data/gemfire/config/annotation/EnableClusterDefinedRegionsIntegrationTests.java +++ b/spring-data-geode/src/test/java/org/springframework/data/gemfire/config/annotation/EnableClusterDefinedRegionsIntegrationTests.java @@ -19,8 +19,6 @@ import java.util.Collections; -import javax.annotation.Resource; - import org.junit.Before; import org.junit.BeforeClass; import org.junit.Test; @@ -74,13 +72,16 @@ public static void startGeodeServer() throws Exception { @Autowired private ClientCache cache; - @Resource(name = "LocalRegion") + @Autowired + @Qualifier("LocalRegion") private Region localClientProxyRegion; - @Resource(name = "PartitionRegion") + @Autowired + @Qualifier("PartitionRegion") private Region partitionClientProxyRegion; - @Resource(name = "ReplicateRegion") + @Autowired + @Qualifier("ReplicateRegion") private Region replicateClientProxyRegion; private void assertRegion(Region region, String expectedName) { diff --git a/spring-data-geode/src/test/java/org/springframework/data/gemfire/config/annotation/EnableContinuousQueriesConfigurationIntegrationTests.java b/spring-data-geode/src/test/java/org/springframework/data/gemfire/config/annotation/EnableContinuousQueriesConfigurationIntegrationTests.java index 4c64d29b7..0751c92b8 100644 --- a/spring-data-geode/src/test/java/org/springframework/data/gemfire/config/annotation/EnableContinuousQueriesConfigurationIntegrationTests.java +++ b/spring-data-geode/src/test/java/org/springframework/data/gemfire/config/annotation/EnableContinuousQueriesConfigurationIntegrationTests.java @@ -22,8 +22,6 @@ import java.util.Collections; import java.util.concurrent.atomic.AtomicInteger; -import javax.annotation.Resource; - import org.junit.Before; import org.junit.BeforeClass; import org.junit.Test; @@ -41,6 +39,8 @@ import org.apache.geode.cache.query.CqEvent; import org.apache.geode.cache.util.CacheListenerAdapter; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.beans.factory.annotation.Value; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; @@ -89,7 +89,8 @@ public static void startGeodeServer() throws Exception { startGemFireServer(GeodeServerTestConfiguration.class); } - @Resource(name = "TemperatureReadings") + @Autowired + @Qualifier("TemperatureReadings") private Region temperatureReadings; @Before diff --git a/spring-data-geode/src/test/java/org/springframework/data/gemfire/config/annotation/EnableLuceneIndexingConfigurationIntegrationTests.java b/spring-data-geode/src/test/java/org/springframework/data/gemfire/config/annotation/EnableLuceneIndexingConfigurationIntegrationTests.java index 30439e793..81aead788 100644 --- a/spring-data-geode/src/test/java/org/springframework/data/gemfire/config/annotation/EnableLuceneIndexingConfigurationIntegrationTests.java +++ b/spring-data-geode/src/test/java/org/springframework/data/gemfire/config/annotation/EnableLuceneIndexingConfigurationIntegrationTests.java @@ -20,8 +20,6 @@ import java.util.Collection; import java.util.stream.Collectors; -import javax.annotation.Resource; - import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; @@ -29,6 +27,7 @@ import org.apache.geode.cache.Region; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.DependsOn; import org.springframework.data.gemfire.search.lucene.ProjectingLuceneOperations; @@ -59,7 +58,8 @@ public class EnableLuceneIndexingConfigurationIntegrationTests extends Integrati @Autowired private ProjectingLuceneOperations luceneTemplate; - @Resource(name = "Books") + @Autowired + @Qualifier("Books") private Region books; @Before diff --git a/spring-data-geode/src/test/java/org/springframework/data/gemfire/config/annotation/EnableOqlIndexingConfigurationIntegrationTests.java b/spring-data-geode/src/test/java/org/springframework/data/gemfire/config/annotation/EnableOqlIndexingConfigurationIntegrationTests.java index 2d20a12de..d121cf818 100644 --- a/spring-data-geode/src/test/java/org/springframework/data/gemfire/config/annotation/EnableOqlIndexingConfigurationIntegrationTests.java +++ b/spring-data-geode/src/test/java/org/springframework/data/gemfire/config/annotation/EnableOqlIndexingConfigurationIntegrationTests.java @@ -17,8 +17,6 @@ import static org.assertj.core.api.Assertions.assertThat; -import javax.annotation.Resource; - import org.junit.Test; import org.junit.runner.RunWith; @@ -27,6 +25,8 @@ import org.apache.geode.cache.client.ClientRegionShortcut; import org.apache.geode.cache.query.Index; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.FilterType; import org.springframework.data.gemfire.GemfireUtils; @@ -58,13 +58,16 @@ @SuppressWarnings("unused") public class EnableOqlIndexingConfigurationIntegrationTests extends IntegrationTestsSupport { - @Resource(name = "People") + @Autowired + @Qualifier("People") private Region people; - @Resource(name = "PeopleIdKeyIdx") + @Autowired + @Qualifier("PeopleIdKeyIdx") private Index personIdKeyIndex; - @Resource(name = "PeopleLastNameFunctionalIdx") + @Autowired + @Qualifier("PeopleLastNameFunctionalIdx") private Index personLastNameHashIndex; @Test diff --git a/spring-data-geode/src/test/java/org/springframework/data/gemfire/config/annotation/EnableSslConfigurationIntegrationTests.java b/spring-data-geode/src/test/java/org/springframework/data/gemfire/config/annotation/EnableSslConfigurationIntegrationTests.java index deb25eb13..ae978c146 100644 --- a/spring-data-geode/src/test/java/org/springframework/data/gemfire/config/annotation/EnableSslConfigurationIntegrationTests.java +++ b/spring-data-geode/src/test/java/org/springframework/data/gemfire/config/annotation/EnableSslConfigurationIntegrationTests.java @@ -17,8 +17,6 @@ import static org.assertj.core.api.Assertions.assertThat; -import javax.annotation.Resource; - import org.junit.BeforeClass; import org.junit.Test; import org.junit.runner.RunWith; @@ -30,6 +28,8 @@ import org.apache.geode.cache.Region; import org.apache.geode.cache.client.ClientRegionShortcut; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.beans.factory.annotation.Value; import org.springframework.context.annotation.Bean; import org.springframework.core.io.ClassPathResource; @@ -64,7 +64,8 @@ public class EnableSslConfigurationIntegrationTests extends ForkingClientServerI private static ProcessWrapper gemfireServer; - @Resource(name = "Echo") + @Autowired + @Qualifier("Echo") private Region echo; @BeforeClass diff --git a/spring-data-geode/src/test/java/org/springframework/data/gemfire/config/annotation/PeerCacheApplicationIntegrationTests.java b/spring-data-geode/src/test/java/org/springframework/data/gemfire/config/annotation/PeerCacheApplicationIntegrationTests.java index 2c63b7bc1..54c4f3a02 100644 --- a/spring-data-geode/src/test/java/org/springframework/data/gemfire/config/annotation/PeerCacheApplicationIntegrationTests.java +++ b/spring-data-geode/src/test/java/org/springframework/data/gemfire/config/annotation/PeerCacheApplicationIntegrationTests.java @@ -18,8 +18,6 @@ import static org.assertj.core.api.Assertions.assertThat; -import javax.annotation.Resource; - import org.junit.Test; import org.junit.runner.RunWith; @@ -29,6 +27,8 @@ import org.apache.geode.cache.LoaderHelper; import org.apache.geode.cache.Region; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.context.annotation.Bean; import org.springframework.data.gemfire.PartitionedRegionFactoryBean; import org.springframework.data.gemfire.tests.integration.IntegrationTestsSupport; @@ -52,7 +52,8 @@ @SuppressWarnings("all") public class PeerCacheApplicationIntegrationTests extends IntegrationTestsSupport { - @Resource(name = "Echo") + @Autowired + @Qualifier("Echo") private Region echo; @Test diff --git a/spring-data-geode/src/test/java/org/springframework/data/gemfire/config/annotation/RegionDataAccessTracingAspectUnitTests.java b/spring-data-geode/src/test/java/org/springframework/data/gemfire/config/annotation/RegionDataAccessTracingAspectUnitTests.java index 0c9a4a71e..9b6aedc5b 100644 --- a/spring-data-geode/src/test/java/org/springframework/data/gemfire/config/annotation/RegionDataAccessTracingAspectUnitTests.java +++ b/spring-data-geode/src/test/java/org/springframework/data/gemfire/config/annotation/RegionDataAccessTracingAspectUnitTests.java @@ -21,8 +21,6 @@ import java.util.Collections; import java.util.concurrent.atomic.AtomicBoolean; -import javax.annotation.Resource; - import org.junit.After; import org.junit.Assume; import org.junit.BeforeClass; @@ -33,6 +31,8 @@ import org.apache.geode.cache.Region; import org.apache.geode.cache.client.ClientRegionShortcut; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.context.annotation.Bean; import org.springframework.data.gemfire.client.ClientRegionFactoryBean; import org.springframework.data.gemfire.config.annotation.support.RegionDataAccessTracingAspect; @@ -82,7 +82,8 @@ public void tearDown() { TestAppender.getInstance().clear(); } - @Resource(name = "ClientRegion") + @Autowired + @Qualifier("ClientRegion") private Region region; private Runnable regionCallbackArgument(AtomicBoolean called) { diff --git a/spring-data-geode/src/test/java/org/springframework/data/gemfire/config/support/DefinedIndexesIntegrationTests.java b/spring-data-geode/src/test/java/org/springframework/data/gemfire/config/support/DefinedIndexesIntegrationTests.java index 3ebdc4a86..505619672 100644 --- a/spring-data-geode/src/test/java/org/springframework/data/gemfire/config/support/DefinedIndexesIntegrationTests.java +++ b/spring-data-geode/src/test/java/org/springframework/data/gemfire/config/support/DefinedIndexesIntegrationTests.java @@ -24,8 +24,6 @@ import java.util.Arrays; import java.util.List; -import javax.annotation.Resource; - import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; @@ -94,7 +92,8 @@ public class DefinedIndexesIntegrationTests extends IntegrationTestsSupport { @Qualifier("NameIdx") private Index name; - @Resource(name = "People") + @Autowired + @Qualifier("People") private Region people; protected static Person put(Region people, Person person) { diff --git a/spring-data-geode/src/test/java/org/springframework/data/gemfire/config/xml/AsyncEventQueueNamespaceIntegrationTests.java b/spring-data-geode/src/test/java/org/springframework/data/gemfire/config/xml/AsyncEventQueueNamespaceIntegrationTests.java index 3a5848eab..bd58ec108 100644 --- a/spring-data-geode/src/test/java/org/springframework/data/gemfire/config/xml/AsyncEventQueueNamespaceIntegrationTests.java +++ b/spring-data-geode/src/test/java/org/springframework/data/gemfire/config/xml/AsyncEventQueueNamespaceIntegrationTests.java @@ -21,8 +21,6 @@ import java.util.List; import java.util.stream.Collectors; -import javax.annotation.Resource; - import org.junit.Test; import org.junit.runner.RunWith; @@ -35,6 +33,8 @@ import org.apache.geode.cache.wan.GatewayQueueEvent; import org.apache.geode.cache.wan.GatewaySender; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.data.gemfire.tests.integration.IntegrationTestsSupport; import org.springframework.data.gemfire.tests.unit.annotation.GemFireUnitTest; import org.springframework.test.context.junit4.SpringRunner; @@ -59,13 +59,16 @@ @SuppressWarnings("all") public class AsyncEventQueueNamespaceIntegrationTests extends IntegrationTestsSupport { - @Resource(name = "TestAsyncEventQueue") + @Autowired + @Qualifier("TestAsyncEventQueue") private AsyncEventQueue asyncEventQueue; - @Resource(name = "TestAsyncEventQueueWithFilters") + @Autowired + @Qualifier("TestAsyncEventQueueWithFilters") private AsyncEventQueue asyncEventQueueWithFilters; - @Resource(name = "TestPausedAsyncEventQueue") + @Autowired + @Qualifier("TestPausedAsyncEventQueue") private AsyncEventQueue pausedAsyncEventQueue; @Test diff --git a/spring-data-geode/src/test/java/org/springframework/data/gemfire/config/xml/ContinuousQueryListenerContainerNamespaceIntegrationTests.java b/spring-data-geode/src/test/java/org/springframework/data/gemfire/config/xml/ContinuousQueryListenerContainerNamespaceIntegrationTests.java index 5bebc776b..07385f764 100644 --- a/spring-data-geode/src/test/java/org/springframework/data/gemfire/config/xml/ContinuousQueryListenerContainerNamespaceIntegrationTests.java +++ b/spring-data-geode/src/test/java/org/springframework/data/gemfire/config/xml/ContinuousQueryListenerContainerNamespaceIntegrationTests.java @@ -22,8 +22,6 @@ import java.util.List; import java.util.concurrent.Executor; -import javax.annotation.Resource; - import org.junit.BeforeClass; import org.junit.Test; import org.junit.runner.RunWith; @@ -33,6 +31,7 @@ import org.apache.geode.cache.query.CqQuery; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.data.gemfire.TestUtils; import org.springframework.data.gemfire.fork.CqCacheServerProcess; import org.springframework.data.gemfire.listener.ContinuousQueryListener; @@ -76,10 +75,12 @@ public static void startGemFireServer() throws Exception { @Autowired private ContinuousQueryListenerContainer container; - @Resource(name = "testErrorHandler") + @Autowired + @Qualifier("testErrorHandler") private ErrorHandler testErrorHandler; - @Resource(name = "testTaskExecutor") + @Autowired + @Qualifier("testTaskExecutor") private Executor testTaskExecutor; @Test diff --git a/spring-data-geode/src/test/java/org/springframework/data/gemfire/config/xml/GatewayReceiverAutoStartNamespaceIntegrationTests.java b/spring-data-geode/src/test/java/org/springframework/data/gemfire/config/xml/GatewayReceiverAutoStartNamespaceIntegrationTests.java index 08265e320..6c20718c9 100644 --- a/spring-data-geode/src/test/java/org/springframework/data/gemfire/config/xml/GatewayReceiverAutoStartNamespaceIntegrationTests.java +++ b/spring-data-geode/src/test/java/org/springframework/data/gemfire/config/xml/GatewayReceiverAutoStartNamespaceIntegrationTests.java @@ -17,13 +17,13 @@ import static org.assertj.core.api.Assertions.assertThat; -import javax.annotation.Resource; - import org.junit.Test; import org.junit.runner.RunWith; import org.apache.geode.cache.wan.GatewayReceiver; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.data.gemfire.tests.integration.IntegrationTestsSupport; import org.springframework.data.gemfire.tests.mock.context.GemFireMockObjectsApplicationContextInitializer; import org.springframework.data.gemfire.wan.GatewayReceiverFactoryBean; @@ -50,13 +50,14 @@ * @since 1.5.0 */ @RunWith(SpringRunner.class) -@ContextConfiguration(locations = "GatewayReceiverNamespaceTest-context.xml", +@ContextConfiguration(locations = "GatewayReceiverNamespaceIntegrationTests-context.xml", initializers = GemFireMockObjectsApplicationContextInitializer.class) @ActiveProfiles("autoStart") @SuppressWarnings("unused") public class GatewayReceiverAutoStartNamespaceIntegrationTests extends IntegrationTestsSupport { - @Resource(name = "&Auto") + @Autowired + @Qualifier("&Auto") private GatewayReceiverFactoryBean autoGatewayReceiverFactory; @Test diff --git a/spring-data-geode/src/test/java/org/springframework/data/gemfire/config/xml/GatewayReceiverDefaultStartNamespaceIntegrationTests.java b/spring-data-geode/src/test/java/org/springframework/data/gemfire/config/xml/GatewayReceiverDefaultStartNamespaceIntegrationTests.java index 032761cc2..4ef828ef3 100644 --- a/spring-data-geode/src/test/java/org/springframework/data/gemfire/config/xml/GatewayReceiverDefaultStartNamespaceIntegrationTests.java +++ b/spring-data-geode/src/test/java/org/springframework/data/gemfire/config/xml/GatewayReceiverDefaultStartNamespaceIntegrationTests.java @@ -17,13 +17,13 @@ import static org.assertj.core.api.Assertions.assertThat; -import javax.annotation.Resource; - import org.junit.Test; import org.junit.runner.RunWith; import org.apache.geode.cache.wan.GatewayReceiver; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.data.gemfire.tests.integration.IntegrationTestsSupport; import org.springframework.data.gemfire.tests.mock.context.GemFireMockObjectsApplicationContextInitializer; import org.springframework.data.gemfire.wan.GatewayReceiverFactoryBean; @@ -51,12 +51,13 @@ */ @ActiveProfiles("defaultStart") @RunWith(SpringRunner.class) -@ContextConfiguration(locations = "GatewayReceiverNamespaceTest-context.xml", +@ContextConfiguration(locations = "GatewayReceiverNamespaceIntegrationTests-context.xml", initializers = GemFireMockObjectsApplicationContextInitializer.class) @SuppressWarnings("unused") public class GatewayReceiverDefaultStartNamespaceIntegrationTests extends IntegrationTestsSupport { - @Resource(name = "&Default") + @Autowired + @Qualifier("&Default") private GatewayReceiverFactoryBean defaultGatewayReceiverFactory; @Test diff --git a/spring-data-geode/src/test/java/org/springframework/data/gemfire/config/xml/GatewayReceiverManualStartNamespaceIntegrationTests.java b/spring-data-geode/src/test/java/org/springframework/data/gemfire/config/xml/GatewayReceiverManualStartNamespaceIntegrationTests.java index 135998c9c..f0bf4f334 100644 --- a/spring-data-geode/src/test/java/org/springframework/data/gemfire/config/xml/GatewayReceiverManualStartNamespaceIntegrationTests.java +++ b/spring-data-geode/src/test/java/org/springframework/data/gemfire/config/xml/GatewayReceiverManualStartNamespaceIntegrationTests.java @@ -17,13 +17,13 @@ import static org.assertj.core.api.Assertions.assertThat; -import javax.annotation.Resource; - import org.junit.Test; import org.junit.runner.RunWith; import org.apache.geode.cache.wan.GatewayReceiver; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.data.gemfire.tests.integration.IntegrationTestsSupport; import org.springframework.data.gemfire.tests.mock.context.GemFireMockObjectsApplicationContextInitializer; import org.springframework.data.gemfire.wan.GatewayReceiverFactoryBean; @@ -49,20 +49,22 @@ * @since 1.5.0 */ @RunWith(SpringRunner.class) -@ContextConfiguration(locations = "GatewayReceiverNamespaceTest-context.xml", +@ContextConfiguration(locations = "GatewayReceiverNamespaceIntegrationTests-context.xml", initializers = GemFireMockObjectsApplicationContextInitializer.class) @ActiveProfiles("manualStart") @SuppressWarnings("unused") public class GatewayReceiverManualStartNamespaceIntegrationTests extends IntegrationTestsSupport { - @Resource(name = "&Manual") + @Autowired + @Qualifier("&Manual") private GatewayReceiverFactoryBean manualGatewayReceiverFactory; @Test public void testManual() throws Exception { assertThat(this.manualGatewayReceiverFactory) - .as("The 'Manual' GatewayReceiverFactoryBean was not properly configured and initialized!").isNotNull(); + .describedAs("The 'Manual' GatewayReceiverFactoryBean was not properly configured and initialized!") + .isNotNull(); GatewayReceiver manualGatewayReceiver = this.manualGatewayReceiverFactory.getObject(); diff --git a/spring-data-geode/src/test/java/org/springframework/data/gemfire/config/xml/IndexNamespaceIntegrationTests.java b/spring-data-geode/src/test/java/org/springframework/data/gemfire/config/xml/IndexNamespaceIntegrationTests.java index 32204355b..4f6c4d64e 100644 --- a/spring-data-geode/src/test/java/org/springframework/data/gemfire/config/xml/IndexNamespaceIntegrationTests.java +++ b/spring-data-geode/src/test/java/org/springframework/data/gemfire/config/xml/IndexNamespaceIntegrationTests.java @@ -17,8 +17,6 @@ import static org.assertj.core.api.Assertions.assertThat; -import javax.annotation.Resource; - import org.junit.Test; import org.junit.runner.RunWith; @@ -26,6 +24,7 @@ import org.apache.geode.cache.query.Index; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.context.ApplicationContext; import org.springframework.data.gemfire.IndexFactoryBean; import org.springframework.data.gemfire.tests.integration.IntegrationTestsSupport; @@ -42,10 +41,12 @@ public class IndexNamespaceIntegrationTests extends IntegrationTestsSupport { @Autowired private ApplicationContext applicationContext; - @Resource(name = "basic") + @Autowired + @Qualifier("basic") private Index basic; - @Resource(name = "complex") + @Autowired + @Qualifier("complex") private Index complex; @Test diff --git a/spring-data-geode/src/test/java/org/springframework/data/gemfire/config/xml/LocalRegionWithEvictionPolicyActionNamespaceIntegrationTests.java b/spring-data-geode/src/test/java/org/springframework/data/gemfire/config/xml/LocalRegionWithEvictionPolicyActionNamespaceIntegrationTests.java index a7b98da7c..004273af4 100644 --- a/spring-data-geode/src/test/java/org/springframework/data/gemfire/config/xml/LocalRegionWithEvictionPolicyActionNamespaceIntegrationTests.java +++ b/spring-data-geode/src/test/java/org/springframework/data/gemfire/config/xml/LocalRegionWithEvictionPolicyActionNamespaceIntegrationTests.java @@ -17,8 +17,6 @@ import static org.assertj.core.api.Assertions.assertThat; -import javax.annotation.Resource; - import org.junit.Test; import org.junit.runner.RunWith; @@ -27,6 +25,8 @@ import org.apache.geode.cache.Region; import org.apache.geode.cache.Scope; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.data.gemfire.tests.integration.IntegrationTestsSupport; import org.springframework.data.gemfire.tests.unit.annotation.GemFireUnitTest; import org.springframework.test.context.junit4.SpringRunner; @@ -50,13 +50,16 @@ @SuppressWarnings("unused") public class LocalRegionWithEvictionPolicyActionNamespaceIntegrationTests extends IntegrationTestsSupport { - @Resource(name = "LocalDestroy") + @Autowired + @Qualifier("LocalDestroy") private Region localDestroyRegion; - @Resource(name = "None") + @Autowired + @Qualifier("None") private Region noneRegion; - @Resource(name = "Overflow") + @Autowired + @Qualifier("Overflow") private Region overflowRegion; @Test diff --git a/spring-data-geode/src/test/java/org/springframework/data/gemfire/config/xml/LookupRegionWithAsyncEventQueuesAndGatewaySendersIntegrationTests.java b/spring-data-geode/src/test/java/org/springframework/data/gemfire/config/xml/LookupRegionWithAsyncEventQueuesAndGatewaySendersIntegrationTests.java index 093cd05c4..2119d71ae 100644 --- a/spring-data-geode/src/test/java/org/springframework/data/gemfire/config/xml/LookupRegionWithAsyncEventQueuesAndGatewaySendersIntegrationTests.java +++ b/spring-data-geode/src/test/java/org/springframework/data/gemfire/config/xml/LookupRegionWithAsyncEventQueuesAndGatewaySendersIntegrationTests.java @@ -18,8 +18,6 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.Mockito.mock; -import javax.annotation.Resource; - import org.junit.Test; import org.junit.runner.RunWith; @@ -30,6 +28,8 @@ import org.apache.geode.cache.asyncqueue.AsyncEventQueue; import org.apache.geode.cache.wan.GatewaySender; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.data.gemfire.support.AbstractFactoryBeanSupport; import org.springframework.data.gemfire.tests.integration.IntegrationTestsSupport; import org.springframework.lang.Nullable; @@ -54,7 +54,8 @@ @SuppressWarnings("unused") public class LookupRegionWithAsyncEventQueuesAndGatewaySendersIntegrationTests extends IntegrationTestsSupport { - @Resource(name = "Example") + @Autowired + @Qualifier("Example") private Region example; @Test diff --git a/spring-data-geode/src/test/java/org/springframework/data/gemfire/config/xml/MembershipAttributesIntegrationTests.java b/spring-data-geode/src/test/java/org/springframework/data/gemfire/config/xml/MembershipAttributesIntegrationTests.java index f812123f1..b95406c14 100644 --- a/spring-data-geode/src/test/java/org/springframework/data/gemfire/config/xml/MembershipAttributesIntegrationTests.java +++ b/spring-data-geode/src/test/java/org/springframework/data/gemfire/config/xml/MembershipAttributesIntegrationTests.java @@ -17,8 +17,6 @@ import static org.assertj.core.api.Assertions.assertThat; -import javax.annotation.Resource; - import org.junit.Test; import org.junit.runner.RunWith; @@ -28,6 +26,8 @@ import org.apache.geode.cache.ResumptionAction; import org.apache.geode.distributed.Role; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.data.gemfire.tests.integration.IntegrationTestsSupport; import org.springframework.data.gemfire.tests.unit.annotation.GemFireUnitTest; import org.springframework.test.context.junit4.SpringRunner; @@ -50,10 +50,12 @@ @SuppressWarnings({ "deprecation", "unused" }) public class MembershipAttributesIntegrationTests extends IntegrationTestsSupport { - @Resource(name = "secure") + @Autowired + @Qualifier("secure") private Region secure; - @Resource(name = "simple") + @Autowired + @Qualifier("simple") private Region simple; @Test diff --git a/spring-data-geode/src/test/java/org/springframework/data/gemfire/config/xml/RegionDefinitionUsingBeansNamespaceIntegrationTests.java b/spring-data-geode/src/test/java/org/springframework/data/gemfire/config/xml/RegionDefinitionUsingBeansNamespaceIntegrationTests.java index 2385d7f91..ec81de84a 100644 --- a/spring-data-geode/src/test/java/org/springframework/data/gemfire/config/xml/RegionDefinitionUsingBeansNamespaceIntegrationTests.java +++ b/spring-data-geode/src/test/java/org/springframework/data/gemfire/config/xml/RegionDefinitionUsingBeansNamespaceIntegrationTests.java @@ -17,8 +17,6 @@ import static org.assertj.core.api.Assertions.assertThat; -import javax.annotation.Resource; - import org.junit.Test; import org.junit.runner.RunWith; @@ -28,6 +26,7 @@ import org.apache.geode.cache.RegionAttributes; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.context.ApplicationContext; import org.springframework.data.gemfire.PeerRegionFactoryBean; import org.springframework.data.gemfire.TestUtils; @@ -61,10 +60,12 @@ public class RegionDefinitionUsingBeansNamespaceIntegrationTests extends Integra @Autowired private ApplicationContext applicationContext; - @Resource(name = "Example") + @Autowired + @Qualifier("Example") private Region example; - @Resource(name = "AnotherExample") + @Autowired + @Qualifier("AnotherExample") private Region anotherExample; @Test diff --git a/spring-data-geode/src/test/java/org/springframework/data/gemfire/config/xml/RegionEvictionAttributesNamespaceIntegrationTests.java b/spring-data-geode/src/test/java/org/springframework/data/gemfire/config/xml/RegionEvictionAttributesNamespaceIntegrationTests.java index 6611f6115..e80f6fb79 100644 --- a/spring-data-geode/src/test/java/org/springframework/data/gemfire/config/xml/RegionEvictionAttributesNamespaceIntegrationTests.java +++ b/spring-data-geode/src/test/java/org/springframework/data/gemfire/config/xml/RegionEvictionAttributesNamespaceIntegrationTests.java @@ -17,8 +17,6 @@ import static org.assertj.core.api.Assertions.assertThat; -import javax.annotation.Resource; - import org.junit.Test; import org.junit.runner.RunWith; @@ -28,6 +26,8 @@ import org.apache.geode.cache.EvictionAttributes; import org.apache.geode.cache.Region; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.data.gemfire.tests.integration.IntegrationTestsSupport; import org.springframework.data.gemfire.tests.unit.annotation.GemFireUnitTest; import org.springframework.test.context.junit4.SpringRunner; @@ -51,22 +51,28 @@ @SuppressWarnings("unused") public class RegionEvictionAttributesNamespaceIntegrationTests extends IntegrationTestsSupport { - @Resource(name = "One") + @Autowired + @Qualifier("One") private Region one; - @Resource(name = "Two") + @Autowired + @Qualifier("Two") private Region two; - @Resource(name = "Three") + @Autowired + @Qualifier("Three") private Region three; - @Resource(name = "Four") + @Autowired + @Qualifier("Four") private Region four; - @Resource(name = "Five") + @Autowired + @Qualifier("Five") private Region five; - @Resource(name = "Six") + @Autowired + @Qualifier("Six") private Region six; @Test diff --git a/spring-data-geode/src/test/java/org/springframework/data/gemfire/config/xml/RegionExpirationAttributesNamespaceIntegrationTests.java b/spring-data-geode/src/test/java/org/springframework/data/gemfire/config/xml/RegionExpirationAttributesNamespaceIntegrationTests.java index 5e796e417..f17e72c96 100644 --- a/spring-data-geode/src/test/java/org/springframework/data/gemfire/config/xml/RegionExpirationAttributesNamespaceIntegrationTests.java +++ b/spring-data-geode/src/test/java/org/springframework/data/gemfire/config/xml/RegionExpirationAttributesNamespaceIntegrationTests.java @@ -18,8 +18,6 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.Mockito.mock; -import javax.annotation.Resource; - import org.junit.Test; import org.junit.runner.RunWith; @@ -29,6 +27,8 @@ import org.apache.geode.cache.ExpirationAttributes; import org.apache.geode.cache.Region; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.data.gemfire.tests.integration.IntegrationTestsSupport; import org.springframework.data.gemfire.tests.unit.annotation.GemFireUnitTest; import org.springframework.test.context.junit4.SpringRunner; @@ -53,16 +53,20 @@ @SuppressWarnings("unused") public class RegionExpirationAttributesNamespaceIntegrationTests extends IntegrationTestsSupport { - @Resource(name = "ReplicateExample") + @Autowired + @Qualifier("ReplicateExample") private Region replicateExample; - @Resource(name = "PreloadedExample") + @Autowired + @Qualifier("PreloadedExample") private Region preloadedExample; - @Resource(name = "PartitionExample") + @Autowired + @Qualifier("PartitionExample") private Region partitionExample; - @Resource(name = "LocalExample") + @Autowired + @Qualifier("LocalExample") private Region localExample; private void assertRegionMetaData(final Region region, final String regionName, final DataPolicy dataPolicy) { diff --git a/spring-data-geode/src/test/java/org/springframework/data/gemfire/config/xml/RegionSubscriptionAttributesNamespaceIntegrationTests.java b/spring-data-geode/src/test/java/org/springframework/data/gemfire/config/xml/RegionSubscriptionAttributesNamespaceIntegrationTests.java index e9c3cbb39..9fad79e1e 100644 --- a/spring-data-geode/src/test/java/org/springframework/data/gemfire/config/xml/RegionSubscriptionAttributesNamespaceIntegrationTests.java +++ b/spring-data-geode/src/test/java/org/springframework/data/gemfire/config/xml/RegionSubscriptionAttributesNamespaceIntegrationTests.java @@ -17,8 +17,6 @@ import static org.assertj.core.api.Assertions.assertThat; -import javax.annotation.Resource; - import org.junit.Test; import org.junit.runner.RunWith; @@ -27,6 +25,8 @@ import org.apache.geode.cache.Region; import org.apache.geode.cache.SubscriptionAttributes; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.data.gemfire.tests.integration.IntegrationTestsSupport; import org.springframework.data.gemfire.tests.unit.annotation.GemFireUnitTest; import org.springframework.test.context.junit4.SpringRunner; @@ -52,16 +52,20 @@ @SuppressWarnings("unused") public class RegionSubscriptionAttributesNamespaceIntegrationTests extends IntegrationTestsSupport { - @Resource(name = "NoSubscriptionRegion") + @Autowired + @Qualifier("NoSubscriptionRegion") private Region noSubscriptionRegion; - @Resource(name = "AllSubscriptionRegion") + @Autowired + @Qualifier("AllSubscriptionRegion") private Region allSubscriptionRegion; - @Resource(name = "CacheContentSubscriptionRegion") + @Autowired + @Qualifier("CacheContentSubscriptionRegion") private Region cacheContentSubscriptionRegion; - @Resource(name = "DefaultSubscriptionRegion") + @Autowired + @Qualifier("DefaultSubscriptionRegion") private Region defaultSubscriptionRegion; private void assertSubscription(Region region, String expectedRegionName, diff --git a/spring-data-geode/src/test/java/org/springframework/data/gemfire/config/xml/RegionsWithDiskStoreAndPersistenceEvictionSettingsIntegrationTests.java b/spring-data-geode/src/test/java/org/springframework/data/gemfire/config/xml/RegionsWithDiskStoreAndPersistenceEvictionSettingsIntegrationTests.java index c54fc8563..631117591 100644 --- a/spring-data-geode/src/test/java/org/springframework/data/gemfire/config/xml/RegionsWithDiskStoreAndPersistenceEvictionSettingsIntegrationTests.java +++ b/spring-data-geode/src/test/java/org/springframework/data/gemfire/config/xml/RegionsWithDiskStoreAndPersistenceEvictionSettingsIntegrationTests.java @@ -17,8 +17,6 @@ import static org.assertj.core.api.Assertions.assertThat; -import javax.annotation.Resource; - import org.junit.Test; import org.junit.runner.RunWith; @@ -27,6 +25,8 @@ import org.apache.geode.cache.EvictionAction; import org.apache.geode.cache.Region; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.data.gemfire.tests.integration.IntegrationTestsSupport; import org.springframework.data.gemfire.tests.unit.annotation.GemFireUnitTest; import org.springframework.test.context.junit4.SpringRunner; @@ -49,16 +49,20 @@ @SuppressWarnings("unused") public class RegionsWithDiskStoreAndPersistenceEvictionSettingsIntegrationTests extends IntegrationTestsSupport { - @Resource(name = "NotPersistentNoOverflowRegion") + @Autowired + @Qualifier("NotPersistentNoOverflowRegion") private Region notPersistentNoOverflowRegion; - @Resource(name = "NotPersistentOverflowRegion") + @Autowired + @Qualifier("NotPersistentOverflowRegion") private Region notPersistentOverflowRegion; - @Resource(name = "PersistentNoOverflowRegion") + @Autowired + @Qualifier("PersistentNoOverflowRegion") private Region persistentNoOverflowRegion; - @Resource(name = "PersistentOverflowRegion") + @Autowired + @Qualifier("PersistentOverflowRegion") private Region persistentOverflowRegion; @Test diff --git a/spring-data-geode/src/test/java/org/springframework/data/gemfire/config/xml/SubRegionSubElementNamespaceIntegrationTests.java b/spring-data-geode/src/test/java/org/springframework/data/gemfire/config/xml/SubRegionSubElementNamespaceIntegrationTests.java index a69e95345..12ed12907 100644 --- a/spring-data-geode/src/test/java/org/springframework/data/gemfire/config/xml/SubRegionSubElementNamespaceIntegrationTests.java +++ b/spring-data-geode/src/test/java/org/springframework/data/gemfire/config/xml/SubRegionSubElementNamespaceIntegrationTests.java @@ -19,8 +19,6 @@ import java.util.List; -import javax.annotation.Resource; - import org.junit.Test; import org.junit.runner.RunWith; @@ -30,6 +28,8 @@ import org.apache.geode.cache.asyncqueue.AsyncEventListener; import org.apache.geode.cache.util.CacheListenerAdapter; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.data.gemfire.tests.integration.IntegrationTestsSupport; import org.springframework.data.gemfire.tests.unit.annotation.GemFireUnitTest; import org.springframework.test.context.junit4.SpringRunner; @@ -54,10 +54,12 @@ @SuppressWarnings("unused") public class SubRegionSubElementNamespaceIntegrationTests extends IntegrationTestsSupport { - @Resource(name = "/Customers/Accounts") + @Autowired + @Qualifier("/Customers/Accounts") private Region customersAccountsRegion; - @Resource(name = "/Parent/Child") + @Autowired + @Qualifier("/Parent/Child") private Region parentChildRegion; @Test diff --git a/spring-data-geode/src/test/java/org/springframework/data/gemfire/config/xml/TemplateClientRegionNamespaceIntegrationTests.java b/spring-data-geode/src/test/java/org/springframework/data/gemfire/config/xml/TemplateClientRegionNamespaceIntegrationTests.java index 24fe6aa23..62347a5fd 100644 --- a/spring-data-geode/src/test/java/org/springframework/data/gemfire/config/xml/TemplateClientRegionNamespaceIntegrationTests.java +++ b/spring-data-geode/src/test/java/org/springframework/data/gemfire/config/xml/TemplateClientRegionNamespaceIntegrationTests.java @@ -20,8 +20,6 @@ import java.util.Arrays; -import javax.annotation.Resource; - import org.junit.Test; import org.junit.runner.RunWith; @@ -40,6 +38,8 @@ import org.apache.geode.cache.util.CacheWriterAdapter; import org.apache.geode.cache.util.ObjectSizer; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.data.gemfire.tests.integration.IntegrationTestsSupport; import org.springframework.data.gemfire.tests.unit.annotation.GemFireUnitTest; import org.springframework.test.context.junit4.SpringRunner; @@ -63,7 +63,8 @@ @SuppressWarnings("unused") public class TemplateClientRegionNamespaceIntegrationTests extends IntegrationTestsSupport { - @Resource(name = "TemplateBasedClientRegion") + @Autowired + @Qualifier("TemplateBasedClientRegion") private Region templateBasedClientRegion; private void assertCacheListeners(Region region, String... expectedNames) { diff --git a/spring-data-geode/src/test/java/org/springframework/data/gemfire/config/xml/TemplatePersistentPartitionRegionNamespaceIntegrationTests.java b/spring-data-geode/src/test/java/org/springframework/data/gemfire/config/xml/TemplatePersistentPartitionRegionNamespaceIntegrationTests.java index e048c6233..db2ddc49e 100644 --- a/spring-data-geode/src/test/java/org/springframework/data/gemfire/config/xml/TemplatePersistentPartitionRegionNamespaceIntegrationTests.java +++ b/spring-data-geode/src/test/java/org/springframework/data/gemfire/config/xml/TemplatePersistentPartitionRegionNamespaceIntegrationTests.java @@ -19,8 +19,6 @@ import java.io.File; -import javax.annotation.Resource; - import org.junit.After; import org.junit.Test; import org.junit.runner.RunWith; @@ -34,6 +32,7 @@ import org.apache.geode.cache.Region; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.data.gemfire.tests.integration.IntegrationTestsSupport; import org.springframework.data.gemfire.tests.unit.annotation.GemFireUnitTest; import org.springframework.data.gemfire.tests.util.FileSystemUtils; @@ -62,7 +61,8 @@ public class TemplatePersistentPartitionRegionNamespaceIntegrationTests extends @Autowired private DiskStore exampleDataStore; - @Resource(name = "Example") + @Autowired + @Qualifier("Example") private Region example; @After diff --git a/spring-data-geode/src/test/java/org/springframework/data/gemfire/config/xml/TemplateRegionsNamespaceIntegrationTests.java b/spring-data-geode/src/test/java/org/springframework/data/gemfire/config/xml/TemplateRegionsNamespaceIntegrationTests.java index ac290a28e..ab22d49f1 100644 --- a/spring-data-geode/src/test/java/org/springframework/data/gemfire/config/xml/TemplateRegionsNamespaceIntegrationTests.java +++ b/spring-data-geode/src/test/java/org/springframework/data/gemfire/config/xml/TemplateRegionsNamespaceIntegrationTests.java @@ -24,8 +24,6 @@ import java.util.Date; import java.util.List; -import javax.annotation.Resource; - import org.junit.Test; import org.junit.runner.RunWith; @@ -56,6 +54,7 @@ import org.springframework.beans.BeansException; import org.springframework.beans.factory.BeanIsAbstractException; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.context.ApplicationContext; import org.springframework.data.gemfire.tests.integration.IntegrationTestsSupport; import org.springframework.data.gemfire.tests.unit.annotation.GemFireUnitTest; @@ -83,22 +82,28 @@ public class TemplateRegionsNamespaceIntegrationTests extends IntegrationTestsSu @Autowired private ApplicationContext applicationContext; - @Resource(name = "NonTemplateBasedReplicateRegion") + @Autowired + @Qualifier("NonTemplateBasedReplicateRegion") private Region nonTemplateBasedReplicateRegion; - @Resource(name = "TemplateBasedReplicateRegion") + @Autowired + @Qualifier("TemplateBasedReplicateRegion") private Region templateBasedReplicateRegion; - @Resource(name = "/TemplateBasedReplicateRegion/TemplateBasedReplicateSubRegion") + @Autowired + @Qualifier("/TemplateBasedReplicateRegion/TemplateBasedReplicateSubRegion") private Region templateBasedReplicateSubRegion; - @Resource(name = "TemplateBasedReplicateRegionNoOverrides") + @Autowired + @Qualifier("TemplateBasedReplicateRegionNoOverrides") private Region templateBasedReplicateRegionNoOverrides; - @Resource(name = "TemplateBasedPartitionRegion") + @Autowired + @Qualifier("TemplateBasedPartitionRegion") private Region templateBasedPartitionRegion; - @Resource(name = "TemplateBasedLocalRegion") + @Autowired + @Qualifier("TemplateBasedLocalRegion") private Region templateBasedLocalRegion; private void assertAsyncEventQueues(Region region, String... expectedNames) { diff --git a/spring-data-geode/src/test/java/org/springframework/data/gemfire/expiration/AnnotationBasedExpirationConfigurationIntegrationTest.java b/spring-data-geode/src/test/java/org/springframework/data/gemfire/expiration/AnnotationBasedExpirationConfigurationIntegrationTest.java index c20ac0498..568ec1cd8 100644 --- a/spring-data-geode/src/test/java/org/springframework/data/gemfire/expiration/AnnotationBasedExpirationConfigurationIntegrationTest.java +++ b/spring-data-geode/src/test/java/org/springframework/data/gemfire/expiration/AnnotationBasedExpirationConfigurationIntegrationTest.java @@ -20,8 +20,6 @@ import static org.mockito.Mockito.doReturn; import static org.mockito.Mockito.mock; -import javax.annotation.Resource; - import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; @@ -76,7 +74,8 @@ public class AnnotationBasedExpirationConfigurationIntegrationTest extends Integ @Autowired private ExpirationAttributes defaultExpirationAttributes; - @Resource(name = "Example") + @Autowired + @Qualifier("Example") private Region example; @Before diff --git a/spring-data-geode/src/test/java/org/springframework/data/gemfire/function/execution/FunctionIntegrationTests.java b/spring-data-geode/src/test/java/org/springframework/data/gemfire/function/execution/FunctionIntegrationTests.java index 1fd2e8487..f7f72ca36 100644 --- a/spring-data-geode/src/test/java/org/springframework/data/gemfire/function/execution/FunctionIntegrationTests.java +++ b/spring-data-geode/src/test/java/org/springframework/data/gemfire/function/execution/FunctionIntegrationTests.java @@ -20,8 +20,6 @@ import java.util.List; import java.util.Map; -import javax.annotation.Resource; - import org.junit.Before; import org.junit.BeforeClass; import org.junit.Test; @@ -30,6 +28,8 @@ import org.apache.geode.cache.Region; import org.apache.geode.cache.execute.Function; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.data.gemfire.fork.ServerProcess; import org.springframework.data.gemfire.function.annotation.GemfireFunction; import org.springframework.data.gemfire.function.annotation.RegionData; @@ -62,7 +62,8 @@ public static void startGemFireServer() throws Exception { getServerContextXmlFileLocation(FunctionIntegrationTests.class)); } - @Resource(name = "TestRegion") + @Autowired + @Qualifier("TestRegion") private Region region; @Before diff --git a/spring-data-geode/src/test/java/org/springframework/data/gemfire/repository/sample/AlgorithmRepositoryIntegrationTests.java b/spring-data-geode/src/test/java/org/springframework/data/gemfire/repository/sample/AlgorithmRepositoryIntegrationTests.java index 59d7b6196..efbfb6d21 100644 --- a/spring-data-geode/src/test/java/org/springframework/data/gemfire/repository/sample/AlgorithmRepositoryIntegrationTests.java +++ b/spring-data-geode/src/test/java/org/springframework/data/gemfire/repository/sample/AlgorithmRepositoryIntegrationTests.java @@ -17,14 +17,13 @@ import static org.assertj.core.api.Assertions.assertThat; -import javax.annotation.Resource; - import org.junit.Test; import org.junit.runner.RunWith; import org.apache.geode.cache.Region; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.data.gemfire.tests.integration.IntegrationTestsSupport; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringRunner; @@ -51,7 +50,8 @@ public class AlgorithmRepositoryIntegrationTests extends IntegrationTestsSupport @Autowired private AlgorithmRepository algorithmRepo; - @Resource(name = "Algorithms") + @Autowired + @Qualifier("Algorithms") private Region algorithmsRegion; @Test diff --git a/spring-data-geode/src/test/java/org/springframework/data/gemfire/repository/sample/RepositoryDataAccessOnRegionUsingCacheLoaderIntegrationTests.java b/spring-data-geode/src/test/java/org/springframework/data/gemfire/repository/sample/RepositoryDataAccessOnRegionUsingCacheLoaderIntegrationTests.java index 2dd42a291..436087c7c 100644 --- a/spring-data-geode/src/test/java/org/springframework/data/gemfire/repository/sample/RepositoryDataAccessOnRegionUsingCacheLoaderIntegrationTests.java +++ b/spring-data-geode/src/test/java/org/springframework/data/gemfire/repository/sample/RepositoryDataAccessOnRegionUsingCacheLoaderIntegrationTests.java @@ -20,8 +20,6 @@ import java.util.Collection; import java.util.Optional; -import javax.annotation.Resource; - import org.junit.After; import org.junit.Before; import org.junit.Test; @@ -35,6 +33,7 @@ import org.apache.geode.cache.client.ClientRegionShortcut; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.context.annotation.Bean; import org.springframework.data.gemfire.client.ClientRegionFactoryBean; import org.springframework.data.gemfire.config.annotation.ClientCacheApplication; @@ -70,7 +69,8 @@ public class RepositoryDataAccessOnRegionUsingCacheLoaderIntegrationTests extend @Autowired private PersonRepository personRepository; - @Resource(name = "simple") + @Autowired + @Qualifier("simple") private Region people; @Before diff --git a/spring-data-geode/src/test/java/org/springframework/data/gemfire/repository/sample/SubRegionRepositoryIntegrationTest.java b/spring-data-geode/src/test/java/org/springframework/data/gemfire/repository/sample/SubRegionRepositoryIntegrationTests.java similarity index 96% rename from spring-data-geode/src/test/java/org/springframework/data/gemfire/repository/sample/SubRegionRepositoryIntegrationTest.java rename to spring-data-geode/src/test/java/org/springframework/data/gemfire/repository/sample/SubRegionRepositoryIntegrationTests.java index 23f203788..b61098a88 100644 --- a/spring-data-geode/src/test/java/org/springframework/data/gemfire/repository/sample/SubRegionRepositoryIntegrationTest.java +++ b/spring-data-geode/src/test/java/org/springframework/data/gemfire/repository/sample/SubRegionRepositoryIntegrationTests.java @@ -23,8 +23,6 @@ import java.util.List; import java.util.Map; -import javax.annotation.Resource; - import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; @@ -32,6 +30,7 @@ import org.apache.geode.cache.Region; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.data.gemfire.repository.Wrapper; import org.springframework.data.gemfire.tests.integration.IntegrationTestsSupport; import org.springframework.test.context.ContextConfiguration; @@ -55,9 +54,9 @@ * @since 1.4.0 */ @RunWith(SpringRunner.class) -@ContextConfiguration("subregionRepository.xml") +@ContextConfiguration @SuppressWarnings("unused") -public class SubRegionRepositoryIntegrationTest extends IntegrationTestsSupport { +public class SubRegionRepositoryIntegrationTests extends IntegrationTestsSupport { private static final Map ADMIN_USER_DATA = new HashMap<>(5, 0.90f); @@ -94,13 +93,16 @@ public class SubRegionRepositoryIntegrationTest extends IntegrationTestsSupport @Autowired private ProgrammerRepository programmersRepo; - @Resource(name = "/Users/Programmers") + @Autowired + @Qualifier("/Users/Programmers") private Region programmers; - @Resource(name = "/Local/Admin/Users") + @Autowired + @Qualifier("/Local/Admin/Users") private Region adminUsers; - @Resource(name = "/Local/Guest/Users") + @Autowired + @Qualifier("/Local/Guest/Users") private Region guestUsers; @Autowired diff --git a/spring-data-geode/src/test/java/org/springframework/data/gemfire/repository/sample/UserRepositoryQueriesIntegrationTests.java b/spring-data-geode/src/test/java/org/springframework/data/gemfire/repository/sample/UserRepositoryQueriesIntegrationTests.java index 0e9b8ed16..cba52d90e 100644 --- a/spring-data-geode/src/test/java/org/springframework/data/gemfire/repository/sample/UserRepositoryQueriesIntegrationTests.java +++ b/spring-data-geode/src/test/java/org/springframework/data/gemfire/repository/sample/UserRepositoryQueriesIntegrationTests.java @@ -22,8 +22,6 @@ import java.util.Arrays; import java.util.List; -import javax.annotation.Resource; - import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; @@ -31,6 +29,7 @@ import org.apache.geode.cache.Region; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.data.gemfire.tests.integration.IntegrationTestsSupport; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringRunner; @@ -47,11 +46,12 @@ * @since 1.3.3 */ @RunWith(SpringRunner.class) -@ContextConfiguration("userRepositoryQueriesIntegrationTest.xml") +@ContextConfiguration @SuppressWarnings("unused") public class UserRepositoryQueriesIntegrationTests extends IntegrationTestsSupport { - @Resource(name = "Users") + @Autowired + @Qualifier("Users") @SuppressWarnings("rawtypes") private Region users; diff --git a/spring-data-geode/src/test/java/org/springframework/data/gemfire/repository/sample/UsingQueryAnnotationExtensionsInUserRepositoryIntegrationTests.java b/spring-data-geode/src/test/java/org/springframework/data/gemfire/repository/sample/UsingQueryAnnotationExtensionsInUserRepositoryIntegrationTests.java index c5559be93..f93a82508 100644 --- a/spring-data-geode/src/test/java/org/springframework/data/gemfire/repository/sample/UsingQueryAnnotationExtensionsInUserRepositoryIntegrationTests.java +++ b/spring-data-geode/src/test/java/org/springframework/data/gemfire/repository/sample/UsingQueryAnnotationExtensionsInUserRepositoryIntegrationTests.java @@ -20,8 +20,6 @@ import java.util.ArrayList; import java.util.List; -import javax.annotation.Resource; - import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; @@ -29,6 +27,7 @@ import org.apache.geode.cache.Region; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.data.gemfire.repository.Query; import org.springframework.data.gemfire.tests.integration.IntegrationTestsSupport; import org.springframework.test.context.ContextConfiguration; @@ -67,7 +66,8 @@ private static List users(String... usernames) { return users; } - @Resource(name = "Users") + @Autowired + @Qualifier("Users") private Region users; @Autowired diff --git a/spring-data-geode/src/test/java/org/springframework/data/gemfire/repository/support/SimpleGemfireRepositoryIntegrationTests.java b/spring-data-geode/src/test/java/org/springframework/data/gemfire/repository/support/SimpleGemfireRepositoryIntegrationTests.java index ee6d51449..6001206ef 100644 --- a/spring-data-geode/src/test/java/org/springframework/data/gemfire/repository/support/SimpleGemfireRepositoryIntegrationTests.java +++ b/spring-data-geode/src/test/java/org/springframework/data/gemfire/repository/support/SimpleGemfireRepositoryIntegrationTests.java @@ -21,8 +21,6 @@ import java.util.Collections; import java.util.List; -import javax.annotation.Resource; - import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; @@ -34,6 +32,7 @@ import org.apache.geode.cache.util.CacheListenerAdapter; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.context.annotation.Bean; import org.springframework.data.domain.Page; import org.springframework.data.domain.PageRequest; @@ -75,7 +74,8 @@ public class SimpleGemfireRepositoryIntegrationTests extends IntegrationTestsSup @Autowired private GemfireTemplate template; - @Resource(name = "People") + @Autowired + @Qualifier("People") private Region people; private RegionClearListener regionClearListener; diff --git a/spring-data-geode/src/test/java/org/springframework/data/gemfire/repository/support/SimpleGemfireRepositoryRegionDeleteAllIntegrationTests.java b/spring-data-geode/src/test/java/org/springframework/data/gemfire/repository/support/SimpleGemfireRepositoryRegionDeleteAllIntegrationTests.java index c50953ca9..0667ca11a 100644 --- a/spring-data-geode/src/test/java/org/springframework/data/gemfire/repository/support/SimpleGemfireRepositoryRegionDeleteAllIntegrationTests.java +++ b/spring-data-geode/src/test/java/org/springframework/data/gemfire/repository/support/SimpleGemfireRepositoryRegionDeleteAllIntegrationTests.java @@ -19,8 +19,6 @@ import java.util.Arrays; -import javax.annotation.Resource; - import org.junit.Before; import org.junit.BeforeClass; import org.junit.Test; @@ -31,6 +29,7 @@ import org.apache.geode.cache.Region; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Profile; import org.springframework.data.gemfire.LocalRegionFactoryBean; @@ -78,7 +77,8 @@ public static void startGeodeServer() throws Exception { startGemFireServer(GeodeServerTestConfiguration.class, "-Dspring.profiles.active=partition"); } - @Resource(name = "Users") + @Autowired + @Qualifier("Users") private Region users; @Autowired diff --git a/spring-data-geode/src/test/java/org/springframework/data/gemfire/repository/support/SimpleGemfireRepositoryTransactionalIntegrationTests.java b/spring-data-geode/src/test/java/org/springframework/data/gemfire/repository/support/SimpleGemfireRepositoryTransactionalIntegrationTests.java index 9bfbb871d..51d7760b5 100644 --- a/spring-data-geode/src/test/java/org/springframework/data/gemfire/repository/support/SimpleGemfireRepositoryTransactionalIntegrationTests.java +++ b/spring-data-geode/src/test/java/org/springframework/data/gemfire/repository/support/SimpleGemfireRepositoryTransactionalIntegrationTests.java @@ -22,8 +22,6 @@ import java.util.Collection; import java.util.concurrent.atomic.AtomicLong; -import javax.annotation.Resource; - import org.junit.After; import org.junit.Before; import org.junit.Test; @@ -32,6 +30,7 @@ import org.apache.geode.cache.Region; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.data.gemfire.GemfireTemplate; import org.springframework.data.gemfire.GemfireUtils; import org.springframework.data.gemfire.mapping.GemfireMappingContext; @@ -72,7 +71,8 @@ public class SimpleGemfireRepositoryTransactionalIntegrationTests extends Integr @Autowired private CustomerService customerService; - @Resource(name = "Customers") + @Autowired + @Qualifier("Customers") private Region customers; private static Customer createCustomer(String firstName, String lastName) { diff --git a/spring-data-geode/src/test/java/org/springframework/data/gemfire/serialization/json/JSONRegionAdviceIntegrationTests.java b/spring-data-geode/src/test/java/org/springframework/data/gemfire/serialization/json/JSONRegionAdviceIntegrationTests.java index a7d197209..7bdd9a938 100644 --- a/spring-data-geode/src/test/java/org/springframework/data/gemfire/serialization/json/JSONRegionAdviceIntegrationTests.java +++ b/spring-data-geode/src/test/java/org/springframework/data/gemfire/serialization/json/JSONRegionAdviceIntegrationTests.java @@ -22,8 +22,6 @@ import java.util.Arrays; import java.util.Map; -import javax.annotation.Resource; - import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; @@ -35,6 +33,7 @@ import org.apache.geode.cache.query.SelectResults; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.data.gemfire.GemfireOperations; import org.springframework.data.gemfire.repository.sample.Person; import org.springframework.data.gemfire.test.support.MapBuilder; @@ -74,7 +73,8 @@ private static String toJson(Object bean) { @Autowired private GemfireOperations template; - @Resource(name = "JsonRegion") + @Autowired + @Qualifier("JsonRegion") private Region jsonRegion; @Before diff --git a/spring-data-geode/src/test/java/org/springframework/data/gemfire/snapshot/SnapshotApplicationEventTriggeredImportsExportsIntegrationTests.java b/spring-data-geode/src/test/java/org/springframework/data/gemfire/snapshot/SnapshotApplicationEventTriggeredImportsExportsIntegrationTests.java index 05edae6a4..7a6ffd939 100644 --- a/spring-data-geode/src/test/java/org/springframework/data/gemfire/snapshot/SnapshotApplicationEventTriggeredImportsExportsIntegrationTests.java +++ b/spring-data-geode/src/test/java/org/springframework/data/gemfire/snapshot/SnapshotApplicationEventTriggeredImportsExportsIntegrationTests.java @@ -25,8 +25,6 @@ import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicLong; -import javax.annotation.Resource; - import org.junit.AfterClass; import org.junit.BeforeClass; import org.junit.Test; @@ -36,6 +34,7 @@ import org.apache.geode.cache.snapshot.SnapshotFilter; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.context.ApplicationEvent; import org.springframework.context.ApplicationEventPublisher; import org.springframework.data.gemfire.repository.sample.Person; @@ -80,16 +79,20 @@ public class SnapshotApplicationEventTriggeredImportsExportsIntegrationTests ext @Autowired private ApplicationEventPublisher eventPublisher; - @Resource(name = "Doe") + @Autowired + @Qualifier("Doe") private Region doe; - @Resource(name = "EveryoneElse") + @Autowired + @Qualifier("EveryoneElse") private Region everyoneElse; - @Resource(name = "Handy") + @Autowired + @Qualifier("Handy") private Region handy; - @Resource(name = "People") + @Autowired + @Qualifier("People") private Region people; @BeforeClass diff --git a/spring-data-geode/src/test/java/org/springframework/data/gemfire/support/WiringDeclarableSupportIntegrationTests.java b/spring-data-geode/src/test/java/org/springframework/data/gemfire/support/WiringDeclarableSupportIntegrationTests.java index 5e2e674ef..e7cfad7dc 100644 --- a/spring-data-geode/src/test/java/org/springframework/data/gemfire/support/WiringDeclarableSupportIntegrationTests.java +++ b/spring-data-geode/src/test/java/org/springframework/data/gemfire/support/WiringDeclarableSupportIntegrationTests.java @@ -18,8 +18,6 @@ import static org.assertj.core.api.Assertions.assertThat; -import javax.annotation.Resource; - import org.junit.Test; import org.junit.runner.RunWith; @@ -31,6 +29,7 @@ import org.springframework.beans.factory.BeanFactory; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.data.gemfire.tests.integration.IntegrationTestsSupport; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringRunner; @@ -62,7 +61,8 @@ public class WiringDeclarableSupportIntegrationTests extends IntegrationTestsSup @SuppressWarnings("unused") private BeanFactory beanFactory; - @Resource(name = "Example") + @Autowired + @Qualifier("Example") @SuppressWarnings("unused") private Region example; diff --git a/spring-data-geode/src/test/java/org/springframework/data/gemfire/transaction/CommitConflictExceptionTransactionalIntegrationTests.java b/spring-data-geode/src/test/java/org/springframework/data/gemfire/transaction/CommitConflictExceptionTransactionalIntegrationTests.java index 8ce6f2ff3..1428a8046 100644 --- a/spring-data-geode/src/test/java/org/springframework/data/gemfire/transaction/CommitConflictExceptionTransactionalIntegrationTests.java +++ b/spring-data-geode/src/test/java/org/springframework/data/gemfire/transaction/CommitConflictExceptionTransactionalIntegrationTests.java @@ -13,17 +13,16 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - package org.springframework.data.gemfire.transaction; import static org.assertj.core.api.Assertions.assertThat; import static org.springframework.data.gemfire.util.RuntimeExceptionFactory.newIllegalStateException; import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Optional; import java.util.function.Function; -import javax.transaction.Transactional; - import edu.umd.cs.mtc.MultithreadedTestCase; import edu.umd.cs.mtc.TestFramework; @@ -32,6 +31,7 @@ import org.apache.geode.cache.CacheTransactionManager; import org.apache.geode.cache.CommitConflictException; +import org.apache.geode.cache.GemFireCache; import org.apache.geode.cache.client.ClientRegionShortcut; import org.springframework.beans.factory.annotation.Autowired; @@ -45,23 +45,26 @@ import org.springframework.data.gemfire.tests.integration.IntegrationTestsSupport; import org.springframework.data.gemfire.transaction.config.EnableGemfireCacheTransactions; import org.springframework.data.repository.CrudRepository; +import org.springframework.lang.NonNull; import org.springframework.stereotype.Service; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringRunner; +import org.springframework.transaction.annotation.Propagation; +import org.springframework.transaction.annotation.Transactional; import org.springframework.util.Assert; -import lombok.Data; +import lombok.AccessLevel; import lombok.EqualsAndHashCode; -import lombok.NonNull; +import lombok.Getter; import lombok.RequiredArgsConstructor; +import lombok.ToString; /** - * Integration Tests asserting the proper configuration and behavior of Apache Geode/Pivotal GemFire - * cache Transactions inside a Spring application context when using SDG to configure - * the {@link CacheTransactionManager}. + * Integration Tests asserting the proper configuration and behavior of Apache Geode {@link GemFireCache} Transactions + * within the context of the Spring container when using SDG to configure the {@link CacheTransactionManager}. * * Specifically, this test asserts that 2 concurrent threads modifying the same entity inside a cache transaction - * leads to a {@link CommitConflictException}. + * leading to a {@link CommitConflictException}. * * @author John Blum * @see java.util.function.Function @@ -70,13 +73,18 @@ * @see org.junit.Test * @see org.apache.geode.cache.CacheTransactionManager * @see org.apache.geode.cache.CommitConflictException + * @see org.apache.geode.cache.GemFireCache + * @see org.springframework.context.annotation.Bean * @see org.springframework.data.gemfire.config.annotation.ClientCacheApplication * @see org.springframework.data.gemfire.config.annotation.EnableEntityDefinedRegions + * @see org.springframework.data.gemfire.mapping.annotation.Region * @see org.springframework.data.gemfire.repository.config.EnableGemfireRepositories * @see org.springframework.data.gemfire.tests.integration.IntegrationTestsSupport * @see org.springframework.data.gemfire.transaction.config.EnableGemfireCacheTransactions + * @see org.springframework.stereotype.Service * @see org.springframework.test.context.ContextConfiguration * @see org.springframework.test.context.junit4.SpringRunner + * @see org.springframework.transaction.annotation.Transactional * @since 2.2.0 */ @RunWith(SpringRunner.class) @@ -85,22 +93,35 @@ public class CommitConflictExceptionTransactionalIntegrationTests extends IntegrationTestsSupport { @Autowired - private CustomerService customerService; + private GemFireCache cache; + + @Autowired + private AutomatedTellerMachine atm; + + @Test + public void cacheTransactionManagementIsConfigured() { + + assertThat(this.cache).isNotNull(); + assertThat(this.cache.getName()).isEqualTo("CommitConflictExceptionTransactionalIntegrationTests"); + assertThat(this.cache.getCopyOnRead()).isTrue(); + assertThat(this.cache.getCacheTransactionManager()).isNotNull(); + } @Test public void concurrentTransactionalThreadsCauseCommitConflictException() throws Throwable { - TestFramework.runOnce(new TransactionalCommitConflictMultithreadedTestCase(this.customerService)); + TestFramework.runOnce(new TransactionalCommitConflictMultithreadedTestCase(this.atm)); } static class TransactionalCommitConflictMultithreadedTestCase extends MultithreadedTestCase { - private final CustomerService customerService; + @Getter(AccessLevel.PROTECTED) + private final AutomatedTellerMachine atm; - TransactionalCommitConflictMultithreadedTestCase(CustomerService customerService) { + TransactionalCommitConflictMultithreadedTestCase(AutomatedTellerMachine atm) { - Assert.notNull(customerService, "CustomerService is required"); + Assert.notNull(atm, "The ATM must not be null"); - this.customerService = customerService; + this.atm = atm; } @Override @@ -108,29 +129,29 @@ public void initialize() { super.initialize(); - Customer jonDoe = this.customerService.save(Customer.newCustomer(1L, "Jon Doe")); - Customer jonDoeLoaded = this.customerService.findById(jonDoe.getId()); + Account account = getAtm().save(Account.open(1).deposit(BigDecimal.valueOf(100.0d))); + Account accountLoaded = getAtm().findByAccountNumber(account.getNumber()); - assertThat(jonDoeLoaded).isEqualTo(jonDoe); + assertThat(accountLoaded).isEqualTo(account); } public void thread1() { assertTick(0); - Thread.currentThread().setName("Customer Processing Thread One"); + Thread.currentThread().setName("Account Processing Thread One"); - this.customerService.process(1L, customer -> { + getAtm().process(1, account -> { - assertThat(customer.getId()).isEqualTo(1L); - assertThat(customer.getName()).isEqualTo("Jon Doe"); + assertThat(account.getNumber()).isEqualTo(1); + assertThat(account.getBalance()).isEqualTo(BigDecimal.valueOf(100.0d)); - customer.setName("Pie Doe"); + account.withdrawal(BigDecimal.valueOf(50.0d)); waitForTick(2); assertTick(2); - return customer; + return account; }, Function.identity()); } @@ -139,24 +160,24 @@ public void thread2() { assertTick(0); - Thread.currentThread().setName("Customer Processing Thread Two"); + Thread.currentThread().setName("Account Processing Thread Two"); waitForTick(1); assertTick(1); try { - this.customerService.process(1L, customer -> { + getAtm().process(1, account -> { - assertThat(customer.getId()).isEqualTo(1L); - assertThat(customer.getName()).isEqualTo("Jon Doe"); + assertThat(account.getNumber()).isEqualTo(1); + assertThat(account.getBalance()).isEqualTo(BigDecimal.valueOf(100.0d)); - customer.setName("Sour Doe"); + account.withdrawal(BigDecimal.valueOf(75.0d)); waitForTick(3); assertTick(3); - return customer; + return account; }, Function.identity()); @@ -172,87 +193,128 @@ public void thread2() { @Override public void finish() { - Customer customer = this.customerService.findById(1L); + Account account = getAtm().findByAccountNumber(1); - assertThat(customer).isNotNull(); - assertThat(customer.getId()).isEqualTo(1L); - assertThat(customer.getName()).isEqualTo("Pie Doe"); + assertThat(account).isNotNull(); + assertThat(account.getNumber()).isEqualTo(1); + assertThat(account.getBalance()).isEqualTo(BigDecimal.valueOf(50.0d)); } } - @ClientCacheApplication(logLevel = "error") - @EnableEntityDefinedRegions( - basePackageClasses = Customer.class, - clientRegionShortcut = ClientRegionShortcut.LOCAL - ) + @ClientCacheApplication(name = "CommitConflictExceptionTransactionalIntegrationTests") + @EnableEntityDefinedRegions(basePackageClasses = Account.class, clientRegionShortcut = ClientRegionShortcut.LOCAL) @EnableGemfireCacheTransactions static class TestConfiguration { @Bean - GemfireRepositoryFactoryBean customerRepositoryFactoryBean() { + GemfireRepositoryFactoryBean accountRepository() { - GemfireRepositoryFactoryBean customerRepositoryFactoryBean - = new GemfireRepositoryFactoryBean<>(CustomerRepository.class); + GemfireRepositoryFactoryBean accountRepository + = new GemfireRepositoryFactoryBean<>(AccountRepository.class); - customerRepositoryFactoryBean.setGemfireMappingContext(new GemfireMappingContext()); + accountRepository.setGemfireMappingContext(new GemfireMappingContext()); - return customerRepositoryFactoryBean; + return accountRepository; } @Bean - CustomerService customerService(CustomerRepository customerRepository) { - return new CustomerService(customerRepository); + AutomatedTellerMachine automatedTellerMachine(AccountRepository accountRepository) { + return new AutomatedTellerMachine(accountRepository); } } - @Data + @Getter + @ToString @EqualsAndHashCode - @Region("Customers") - @RequiredArgsConstructor(staticName = "newCustomer") - static class Customer implements Serializable { + @Region("Accounts") + @RequiredArgsConstructor(staticName = "open") + static class Account implements Serializable { - @NonNull @Id - private Long id; + @Id @lombok.NonNull + private final Integer number; - @NonNull - private String name; + private BigDecimal balance = BigDecimal.valueOf(0.0d); - } + public synchronized Account deposit(@NonNull BigDecimal value) { - public interface CustomerRepository extends CrudRepository { } + this.balance = Optional.ofNullable(value) + .map(BigDecimal::abs) + .map(this.balance::add) + .orElse(this.balance); - @Service - public static class CustomerService { + return this; + } - private final CustomerRepository customerRepository; + public synchronized @NonNull Account withdrawal(@NonNull BigDecimal value) { - public CustomerService(CustomerRepository customerRepository) { + this.balance = Optional.ofNullable(value) + .map(BigDecimal::abs) + .map(this::verifyWithdrawal) + .map(this.balance::subtract) + .orElse(this.balance); - Assert.notNull(customerRepository, "CustomerRepository is required"); + return this; + } - this.customerRepository = customerRepository; + private BigDecimal verifyWithdrawal(@NonNull BigDecimal value) { + + Assert.state(getBalance().compareTo(value) >= 0, + String.format("Withdrawal [%1$s] cannot exceed balance [%2$s]", value, getBalance())); + + return value; } + } - protected Customer findById(Long id) { + public interface AccountRepository extends CrudRepository { } - Assert.notNull(id, "ID is required"); + @Service + public static class AutomatedTellerMachine { + + @Getter(AccessLevel.PROTECTED) + private final AccountRepository accountRepository; - return this.customerRepository.findById(id) - .orElseThrow(() -> newIllegalStateException("No Customer with ID [%d] was found", id)); + public AutomatedTellerMachine(@NonNull AccountRepository accountRepository) { + Assert.notNull(accountRepository, "AccountRepository must not be null"); + this.accountRepository = accountRepository; + } + + @Transactional(propagation = Propagation.REQUIRED, readOnly = true) + public @NonNull Account findByAccountNumber(@NonNull Integer accountNumber) { + + return getAccountRepository().findById(accountNumber) + .orElseThrow(() -> newIllegalStateException("Failed to find Account by number [%d]", accountNumber)); } @Transactional - public Customer process(Long id, Function beforeSave, - Function afterSave) { + public @NonNull Account process(@NonNull Integer accountNumber, @NonNull Function beforeSave, + @NonNull Function afterSave) { + + return afterSave.apply(save(beforeSave.apply(findByAccountNumber(accountNumber)))); + } - return afterSave.apply(save(beforeSave.apply(findById(id)))); + @Transactional(propagation = Propagation.REQUIRED) + public @NonNull Account save(@NonNull Account account) { + + Assert.notNull(account, "Account must not be null"); + + return getAccountRepository().save(account); } + } + + static class OverdraftException extends RuntimeException { - protected Customer save(Customer customer) { + public OverdraftException() { } - Assert.notNull(customer, "Customer is required"); + public OverdraftException(String message) { + super(message); + } + + public OverdraftException(Throwable cause) { + super(cause); + } - return this.customerRepository.save(customer); + public OverdraftException(String message, Throwable cause) { + super(message, cause); } } } diff --git a/spring-data-geode/src/test/java/org/springframework/data/gemfire/transaction/GemfireTransactionManagerIntegrationTests.java b/spring-data-geode/src/test/java/org/springframework/data/gemfire/transaction/GemfireTransactionManagerIntegrationTests.java index 487160e25..bf8304ab5 100644 --- a/spring-data-geode/src/test/java/org/springframework/data/gemfire/transaction/GemfireTransactionManagerIntegrationTests.java +++ b/spring-data-geode/src/test/java/org/springframework/data/gemfire/transaction/GemfireTransactionManagerIntegrationTests.java @@ -18,8 +18,6 @@ import static org.assertj.core.api.Assertions.assertThat; -import javax.annotation.Resource; - import org.junit.Test; import org.junit.runner.RunWith; @@ -27,6 +25,7 @@ import org.apache.geode.cache.Region; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.context.annotation.Bean; import org.springframework.data.gemfire.LocalRegionFactoryBean; import org.springframework.data.gemfire.config.annotation.PeerCacheApplication; @@ -60,7 +59,8 @@ @SuppressWarnings("unused") public class GemfireTransactionManagerIntegrationTests extends IntegrationTestsSupport { - @Resource(name = "Example") + @Autowired + @Qualifier("Example") private Region example; @Autowired diff --git a/spring-data-geode/src/test/java/org/springframework/data/gemfire/transaction/config/EnableGemfireCacheTransactionsIntegrationTests.java b/spring-data-geode/src/test/java/org/springframework/data/gemfire/transaction/config/EnableGemfireCacheTransactionsIntegrationTests.java index 2f2cd680b..a38c09230 100644 --- a/spring-data-geode/src/test/java/org/springframework/data/gemfire/transaction/config/EnableGemfireCacheTransactionsIntegrationTests.java +++ b/spring-data-geode/src/test/java/org/springframework/data/gemfire/transaction/config/EnableGemfireCacheTransactionsIntegrationTests.java @@ -17,8 +17,6 @@ import static org.assertj.core.api.Assertions.assertThat; -import javax.annotation.Resource; - import org.junit.Test; import org.junit.runner.RunWith; @@ -26,6 +24,7 @@ import org.apache.geode.cache.Region; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.context.annotation.Bean; import org.springframework.data.gemfire.LocalRegionFactoryBean; import org.springframework.data.gemfire.config.annotation.PeerCacheApplication; @@ -59,15 +58,16 @@ @SuppressWarnings("unused") public class EnableGemfireCacheTransactionsIntegrationTests extends IntegrationTestsSupport { - @Resource(name = "Example") - private Region example; - @Autowired private GemFireCache gemfireCache; @Autowired private GemfireTransactionManager transactionManager; + @Autowired + @Qualifier("Example") + private Region example; + @Autowired private TestTransactionalService transactionalService; @@ -75,6 +75,8 @@ public class EnableGemfireCacheTransactionsIntegrationTests extends IntegrationT public void transactionManagerIsConfigured() { assertThat(this.gemfireCache).isNotNull(); + assertThat(this.gemfireCache.getName()).isEqualTo("EnableGemfireCacheTransactionsIntegrationTests"); + assertThat(this.gemfireCache.getRegion("Example")).isNotNull(); assertThat(this.transactionManager).isNotNull(); assertThat(this.transactionManager.getCache()).isSameAs(this.gemfireCache); } @@ -82,20 +84,22 @@ public void transactionManagerIsConfigured() { @Test public void doInTransactionCommits() { - assertThat(example).isNotNull(); - assertThat(example).isEmpty(); - assertThat(transactionalService.doInTransactionCommits(1, "pass")).isTrue(); - assertThat(example).hasSize(1); - assertThat(example).containsKey(1); - assertThat(example.get(1)).isEqualTo("pass"); + assertThat(this.example).isNotNull(); + assertThat(this.example).isEmpty(); + assertThat(this.transactionalService.doInTransactionCommits(1, "pass")).isTrue(); + assertThat(this.example).hasSize(1); + assertThat(this.example).containsKey(1); + assertThat(this.example.get(1)).isEqualTo("pass"); } @Test(expected = RuntimeException.class) public void doInTransactionRollsback() { try { - assertThat(example).doesNotContainKey(2); - transactionalService.doInTransactionRollsBack(2, "fail"); + assertThat(this.example).isNotNull(); + assertThat(this.example).doesNotContainKey(2); + + this.transactionalService.doInTransactionRollsBack(2, "fail"); } catch (RuntimeException expected) { assertThat(expected).hasMessage("test"); @@ -119,7 +123,6 @@ public LocalRegionFactoryBean exampleRegion(GemFireCache gemFire LocalRegionFactoryBean example = new LocalRegionFactoryBean<>(); example.setCache(gemFireCache); - example.setClose(false); example.setPersistent(false); return example; @@ -135,7 +138,8 @@ TestTransactionalService transactionalService() { @SuppressWarnings("all") static class TestTransactionalService { - @Resource(name = "Example") + @Autowired + @Qualifier("Example") private Region example; @Transactional diff --git a/spring-data-geode/src/test/java/org/springframework/data/gemfire/wan/AsyncEventQueueByIdXmlConfigurationIntegrationTests.java b/spring-data-geode/src/test/java/org/springframework/data/gemfire/wan/AsyncEventQueueByIdXmlConfigurationIntegrationTests.java index 5607c9427..2364bba45 100644 --- a/spring-data-geode/src/test/java/org/springframework/data/gemfire/wan/AsyncEventQueueByIdXmlConfigurationIntegrationTests.java +++ b/spring-data-geode/src/test/java/org/springframework/data/gemfire/wan/AsyncEventQueueByIdXmlConfigurationIntegrationTests.java @@ -20,8 +20,6 @@ import java.io.IOException; -import javax.annotation.Resource; - import org.junit.AfterClass; import org.junit.BeforeClass; import org.junit.Test; @@ -35,6 +33,7 @@ import org.apache.geode.cache.asyncqueue.AsyncEventListener; import org.apache.geode.cache.asyncqueue.AsyncEventQueue; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.context.annotation.Bean; import org.springframework.data.gemfire.PartitionedRegionFactoryBean; @@ -87,7 +86,8 @@ public static void stopGeodeServer() { stop(geodeServer); } - @Resource(name = "Example") + @Autowired + @Qualifier("Example") private Region example; @Test diff --git a/spring-data-geode/src/test/java/org/springframework/data/gemfire/wan/AsyncEventQueueWithListenerIntegrationTests.java b/spring-data-geode/src/test/java/org/springframework/data/gemfire/wan/AsyncEventQueueWithListenerIntegrationTests.java index 2143eca63..700e3d5e2 100644 --- a/spring-data-geode/src/test/java/org/springframework/data/gemfire/wan/AsyncEventQueueWithListenerIntegrationTests.java +++ b/spring-data-geode/src/test/java/org/springframework/data/gemfire/wan/AsyncEventQueueWithListenerIntegrationTests.java @@ -19,8 +19,6 @@ import java.util.List; -import javax.annotation.Resource; - import org.junit.Test; import org.junit.runner.RunWith; @@ -29,6 +27,8 @@ import org.apache.geode.cache.asyncqueue.AsyncEventQueue; import org.apache.geode.cache.wan.GatewaySender; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.data.gemfire.tests.integration.IntegrationTestsSupport; import org.springframework.data.gemfire.tests.unit.annotation.GemFireUnitTest; import org.springframework.test.context.junit4.SpringRunner; @@ -56,13 +56,16 @@ @SuppressWarnings("unused") public class AsyncEventQueueWithListenerIntegrationTests extends IntegrationTestsSupport { - @Resource(name = "Q1") + @Autowired + @Qualifier("Q1") private AsyncEventQueue queueOne; - @Resource(name = "Q2") + @Autowired + @Qualifier("Q2") private AsyncEventQueue queueTwo; - @Resource(name = "Q3") + @Autowired + @Qualifier("Q3") private AsyncEventQueue queueThree; @Test diff --git a/spring-data-geode/src/test/java/org/springframework/data/gemfire/wan/CachePartitionRegionWithConcurrentParallelAsyncEventQueueAndGatewaySenderIntegrationTests.java b/spring-data-geode/src/test/java/org/springframework/data/gemfire/wan/CachePartitionRegionWithConcurrentParallelAsyncEventQueueAndGatewaySenderIntegrationTests.java index bc9508ddb..d67e2bf21 100644 --- a/spring-data-geode/src/test/java/org/springframework/data/gemfire/wan/CachePartitionRegionWithConcurrentParallelAsyncEventQueueAndGatewaySenderIntegrationTests.java +++ b/spring-data-geode/src/test/java/org/springframework/data/gemfire/wan/CachePartitionRegionWithConcurrentParallelAsyncEventQueueAndGatewaySenderIntegrationTests.java @@ -19,8 +19,6 @@ import java.util.List; -import javax.annotation.Resource; - import org.junit.Test; import org.junit.runner.RunWith; @@ -32,6 +30,7 @@ import org.apache.geode.cache.wan.GatewaySender; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.data.gemfire.tests.integration.IntegrationTestsSupport; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringRunner; @@ -64,7 +63,8 @@ public class CachePartitionRegionWithConcurrentParallelAsyncEventQueueAndGateway @Autowired private GatewaySender exampleGateway; - @Resource(name = "ExampleRegion") + @Autowired + @Qualifier("ExampleRegion") private Region exampleRegion; @Test diff --git a/spring-data-geode/src/test/java/org/springframework/data/gemfire/wan/GatewayReceiverManualStartIntegrationTests.java b/spring-data-geode/src/test/java/org/springframework/data/gemfire/wan/GatewayReceiverManualStartIntegrationTests.java index 41c915629..758dcad4f 100644 --- a/spring-data-geode/src/test/java/org/springframework/data/gemfire/wan/GatewayReceiverManualStartIntegrationTests.java +++ b/spring-data-geode/src/test/java/org/springframework/data/gemfire/wan/GatewayReceiverManualStartIntegrationTests.java @@ -19,13 +19,13 @@ import java.io.IOException; -import javax.annotation.Resource; - import org.junit.Test; import org.junit.runner.RunWith; import org.apache.geode.cache.wan.GatewayReceiver; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.data.gemfire.tests.integration.IntegrationTestsSupport; import org.springframework.data.gemfire.tests.unit.annotation.GemFireUnitTest; import org.springframework.test.context.junit4.SpringRunner; @@ -49,10 +49,12 @@ @SuppressWarnings("unused") public class GatewayReceiverManualStartIntegrationTests extends IntegrationTestsSupport { - @Resource(name = "Auto") + @Autowired + @Qualifier("Auto") private GatewayReceiver autoGatewayReceiver; - @Resource(name = "Manual") + @Autowired + @Qualifier("Manual") private GatewayReceiver manualGatewayReceiver; private void assertGreaterThanEqualToLessThanEqualTo(String message, diff --git a/spring-data-geode/src/test/java/org/springframework/data/gemfire/wan/GatewaySenderByIdXmlConfigurationIntegrationTests.java b/spring-data-geode/src/test/java/org/springframework/data/gemfire/wan/GatewaySenderByIdXmlConfigurationIntegrationTests.java index 29e703258..2613547df 100644 --- a/spring-data-geode/src/test/java/org/springframework/data/gemfire/wan/GatewaySenderByIdXmlConfigurationIntegrationTests.java +++ b/spring-data-geode/src/test/java/org/springframework/data/gemfire/wan/GatewaySenderByIdXmlConfigurationIntegrationTests.java @@ -19,8 +19,6 @@ import java.io.IOException; -import javax.annotation.Resource; - import org.junit.AfterClass; import org.junit.BeforeClass; import org.junit.Test; @@ -33,6 +31,7 @@ import org.apache.geode.cache.RegionAttributes; import org.apache.geode.cache.wan.GatewaySender; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.context.annotation.Bean; import org.springframework.data.gemfire.ReplicatedRegionFactoryBean; @@ -85,7 +84,8 @@ public static void stopGeodeServer() { stop(geodeServer); } - @Resource(name = "Example") + @Autowired + @Qualifier("Example") private Region example; @Test diff --git a/spring-data-geode/src/test/java/org/springframework/data/gemfire/wan/RegionsWithAsyncEventQueuesAndGatewaySendersUnitTests.java b/spring-data-geode/src/test/java/org/springframework/data/gemfire/wan/RegionsWithAsyncEventQueuesAndGatewaySendersUnitTests.java index 8509908dd..78fe4f8f2 100644 --- a/spring-data-geode/src/test/java/org/springframework/data/gemfire/wan/RegionsWithAsyncEventQueuesAndGatewaySendersUnitTests.java +++ b/spring-data-geode/src/test/java/org/springframework/data/gemfire/wan/RegionsWithAsyncEventQueuesAndGatewaySendersUnitTests.java @@ -18,8 +18,6 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.Mockito.mock; -import javax.annotation.Resource; - import org.junit.Test; import org.junit.runner.RunWith; @@ -30,10 +28,12 @@ import org.apache.geode.cache.asyncqueue.AsyncEventQueue; import org.apache.geode.cache.wan.GatewaySender; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.data.gemfire.support.AbstractFactoryBeanSupport; import org.springframework.data.gemfire.tests.integration.IntegrationTestsSupport; +import org.springframework.data.gemfire.tests.unit.annotation.GemFireUnitTest; import org.springframework.lang.Nullable; -import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringRunner; /** @@ -45,25 +45,30 @@ * @see org.apache.geode.cache.asyncqueue.AsyncEventQueue * @see org.apache.geode.cache.wan.GatewaySender * @see org.springframework.data.gemfire.tests.integration.IntegrationTestsSupport + * @see org.springframework.data.gemfire.tests.unit.annotation.GemFireUnitTest * @see org.springframework.test.context.ContextConfiguration * @see org.springframework.test.context.junit4.SpringRunner * @since 2.0.0 */ @RunWith(SpringRunner.class) -@ContextConfiguration +@GemFireUnitTest @SuppressWarnings("unused") public class RegionsWithAsyncEventQueuesAndGatewaySendersUnitTests extends IntegrationTestsSupport { - @Resource(name = "TemplateBasedLocalRegion") + @Autowired + @Qualifier("TemplateBasedLocalRegion") private Region templateBasedLocalRegion; - @Resource(name = "LocalRegion") + @Autowired + @Qualifier("LocalRegion") private Region localRegion; - @Resource(name = "PartitionRegion") + @Autowired + @Qualifier("PartitionRegion") private Region partitionRegion; - @Resource(name = "ReplicateRegion") + @Autowired + @Qualifier("ReplicateRegion") private Region replicateRegion; private void assertRegion(Region region, String name, DataPolicy dataPolicy) { diff --git a/spring-data-geode/src/test/resources/org/springframework/data/gemfire/AutoRegionLookupWithComponentScanningIntegrationTests-context.xml b/spring-data-geode/src/test/resources/org/springframework/data/gemfire/AutoRegionLookupWithComponentScanningIntegrationTests-context.xml index 2aec165cd..822842637 100644 --- a/spring-data-geode/src/test/resources/org/springframework/data/gemfire/AutoRegionLookupWithComponentScanningIntegrationTests-context.xml +++ b/spring-data-geode/src/test/resources/org/springframework/data/gemfire/AutoRegionLookupWithComponentScanningIntegrationTests-context.xml @@ -15,9 +15,10 @@ - + + diff --git a/spring-data-geode/src/test/resources/org/springframework/data/gemfire/colocated-region.xml b/spring-data-geode/src/test/resources/org/springframework/data/gemfire/CollocatedRegionIntegrationTests-context.xml similarity index 100% rename from spring-data-geode/src/test/resources/org/springframework/data/gemfire/colocated-region.xml rename to spring-data-geode/src/test/resources/org/springframework/data/gemfire/CollocatedRegionIntegrationTests-context.xml diff --git a/spring-data-geode/src/test/resources/org/springframework/data/gemfire/diskstore-using-propertyplaceholders-config.xml b/spring-data-geode/src/test/resources/org/springframework/data/gemfire/DiskStoreBeanUsingPropertyPlaceholdersIntegrationTests-context.xml similarity index 100% rename from spring-data-geode/src/test/resources/org/springframework/data/gemfire/diskstore-using-propertyplaceholders-config.xml rename to spring-data-geode/src/test/resources/org/springframework/data/gemfire/DiskStoreBeanUsingPropertyPlaceholdersIntegrationTests-context.xml diff --git a/spring-data-geode/src/test/resources/org/springframework/data/gemfire/config/xml/GatewayReceiverNamespaceTest-context.xml b/spring-data-geode/src/test/resources/org/springframework/data/gemfire/config/xml/GatewayReceiverNamespaceIntegrationTests-context.xml similarity index 100% rename from spring-data-geode/src/test/resources/org/springframework/data/gemfire/config/xml/GatewayReceiverNamespaceTest-context.xml rename to spring-data-geode/src/test/resources/org/springframework/data/gemfire/config/xml/GatewayReceiverNamespaceIntegrationTests-context.xml diff --git a/spring-data-geode/src/test/resources/org/springframework/data/gemfire/repository/sample/subregionRepository.xml b/spring-data-geode/src/test/resources/org/springframework/data/gemfire/repository/sample/SubRegionRepositoryIntegrationTests-context.xml similarity index 100% rename from spring-data-geode/src/test/resources/org/springframework/data/gemfire/repository/sample/subregionRepository.xml rename to spring-data-geode/src/test/resources/org/springframework/data/gemfire/repository/sample/SubRegionRepositoryIntegrationTests-context.xml diff --git a/spring-data-geode/src/test/resources/org/springframework/data/gemfire/repository/sample/userRepositoryQueriesIntegrationTest.xml b/spring-data-geode/src/test/resources/org/springframework/data/gemfire/repository/sample/UserRepositoryQueriesIntegrationTests-context.xml similarity index 95% rename from spring-data-geode/src/test/resources/org/springframework/data/gemfire/repository/sample/userRepositoryQueriesIntegrationTest.xml rename to spring-data-geode/src/test/resources/org/springframework/data/gemfire/repository/sample/UserRepositoryQueriesIntegrationTests-context.xml index 4509a90d9..7a1782e41 100644 --- a/spring-data-geode/src/test/resources/org/springframework/data/gemfire/repository/sample/userRepositoryQueriesIntegrationTest.xml +++ b/spring-data-geode/src/test/resources/org/springframework/data/gemfire/repository/sample/UserRepositoryQueriesIntegrationTests-context.xml @@ -14,7 +14,7 @@ "> - UserRepositoryQueriesIntegrationTest + UserRepositoryQueriesIntegrationTests error