diff --git a/spring-data-geode/src/test/java/org/springframework/data/gemfire/LookupPartitionRegionMutationIntegrationTest.java b/spring-data-geode/src/test/java/org/springframework/data/gemfire/LookupPartitionRegionMutationIntegrationTest.java index c6bc243b..8ccc188a 100644 --- a/spring-data-geode/src/test/java/org/springframework/data/gemfire/LookupPartitionRegionMutationIntegrationTest.java +++ b/spring-data-geode/src/test/java/org/springframework/data/gemfire/LookupPartitionRegionMutationIntegrationTest.java @@ -13,7 +13,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - package org.springframework.data.gemfire; import static org.junit.Assert.assertEquals; @@ -28,6 +27,9 @@ import java.util.List; import javax.annotation.Resource; +import org.junit.Test; +import org.junit.runner.RunWith; + import org.apache.geode.cache.CacheListener; import org.apache.geode.cache.CacheLoader; import org.apache.geode.cache.CacheLoaderException; @@ -47,23 +49,21 @@ import org.apache.geode.cache.RegionEvent; import org.apache.geode.cache.asyncqueue.AsyncEvent; import org.apache.geode.cache.asyncqueue.AsyncEventListener; import org.apache.geode.cache.util.CacheListenerAdapter; -import org.junit.Test; -import org.junit.runner.RunWith; + import org.springframework.beans.factory.BeanNameAware; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringRunner; import org.springframework.util.StringUtils; /** - * The LookupRegionMutationIntegrationTest class is a test suite of test cases testing the contract and integrated - * functionality between natively-defined GemFire Cache Regions and SDG's Region lookup functionality combined with - * Region attribute(s) mutation. + * Integration Tests for {@link DataPolicy#PARTITION} {@link Region} {@link Region#getAttributesMutator() mutation} + * using SDG's {@literal lookup} {@link Region} functionality. * + * @author Udo Kohlmeyer * @author John Blum - * @see Test - * @see RunWith - * @see LookupRegionFactoryBean - * @see ContextConfiguration + * @see org.junit.Test + * @see org.springframework.data.gemfire.LookupRegionFactoryBean + * @see org.springframework.test.context.ContextConfiguration * @see org.springframework.test.context.junit4.SpringJUnit4ClassRunner * @since 1.7.0 */ @@ -75,7 +75,8 @@ public class LookupPartitionRegionMutationIntegrationTest { @Resource(name = "Example") private Region example; - private void assertCacheListeners(CacheListener[] cacheListeners, Collection expectedCacheListenerNames) { + private void assertCacheListeners(CacheListener[] cacheListeners, + Collection expectedCacheListenerNames) { if (!expectedCacheListenerNames.isEmpty()) { assertNotNull("CacheListeners must not be null!", cacheListeners); @@ -85,7 +86,7 @@ public class LookupPartitionRegionMutationIntegrationTest { } private void assertEvictionAttributes(EvictionAttributes evictionAttributes, EvictionAction expectedAction, - EvictionAlgorithm expectedAlgorithm, int expectedMaximum) { + EvictionAlgorithm expectedAlgorithm, int expectedMaximum) { assertNotNull("EvictionAttributes must not be null!", evictionAttributes); assertEquals(expectedAction, evictionAttributes.getAction()); @@ -94,8 +95,7 @@ public class LookupPartitionRegionMutationIntegrationTest { } private void assertExpirationAttributes(ExpirationAttributes expirationAttributes, - - String description, int expectedTimeout, ExpirationAction expectedAction) { + String description, int expectedTimeout, ExpirationAction expectedAction) { assertNotNull(String.format("ExpirationAttributes for '%1$s' must not be null!", description), expirationAttributes); @@ -124,7 +124,7 @@ public class LookupPartitionRegionMutationIntegrationTest { } private void assertRegionAttributes(Region region, String expectedName, String expectedFullPath, - DataPolicy expectedDataPolicy) { + DataPolicy expectedDataPolicy) { assertNotNull(String.format("'%1$s' Region was not properly initialized!", region)); assertEquals(expectedName, region.getName()); @@ -170,6 +170,7 @@ public class LookupPartitionRegionMutationIntegrationTest { String getName(); void setName(String name); + } static abstract class AbstractNameable implements Nameable { @@ -205,8 +206,8 @@ public class LookupPartitionRegionMutationIntegrationTest { } @Override - public void close() { - } + public void close() { } + } public static final class TestCacheListener extends CacheListenerAdapter implements Nameable { @@ -242,35 +243,30 @@ public class LookupPartitionRegionMutationIntegrationTest { } @Override - public void close() { - } + public void close() { } + } public static final class TestCacheWriter extends AbstractNameable implements CacheWriter { @Override - public void beforeUpdate(EntryEvent event) throws CacheWriterException { - } + public void beforeUpdate(EntryEvent event) throws CacheWriterException { } @Override - public void beforeCreate(EntryEvent event) throws CacheWriterException { - } + public void beforeCreate(EntryEvent event) throws CacheWriterException { } @Override - public void beforeDestroy(EntryEvent event) throws CacheWriterException { - } + public void beforeDestroy(EntryEvent event) throws CacheWriterException { } @Override - public void beforeRegionDestroy(RegionEvent event) throws CacheWriterException { - } + public void beforeRegionDestroy(RegionEvent event) throws CacheWriterException { } @Override - public void beforeRegionClear(RegionEvent event) throws CacheWriterException { - } + public void beforeRegionClear(RegionEvent event) throws CacheWriterException { } @Override - public void close() { - } + public void close() { } + } public static final class TestCustomExpiry extends AbstractNameable implements CustomExpiry { @@ -281,7 +277,7 @@ public class LookupPartitionRegionMutationIntegrationTest { } @Override - public void close() { - } + public void close() { } + } } diff --git a/spring-data-geode/src/test/java/org/springframework/data/gemfire/LookupRegionMutationIntegrationTest.java b/spring-data-geode/src/test/java/org/springframework/data/gemfire/LookupRegionMutationIntegrationTest.java index 0d3120d4..1e7d3ddd 100644 --- a/spring-data-geode/src/test/java/org/springframework/data/gemfire/LookupRegionMutationIntegrationTest.java +++ b/spring-data-geode/src/test/java/org/springframework/data/gemfire/LookupRegionMutationIntegrationTest.java @@ -13,7 +13,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - package org.springframework.data.gemfire; import static org.junit.Assert.assertEquals; @@ -28,6 +27,9 @@ import java.util.List; import javax.annotation.Resource; +import org.junit.Test; +import org.junit.runner.RunWith; + import org.apache.geode.cache.CacheListener; import org.apache.geode.cache.CacheLoader; import org.apache.geode.cache.CacheLoaderException; @@ -48,25 +50,21 @@ import org.apache.geode.cache.asyncqueue.AsyncEvent; import org.apache.geode.cache.asyncqueue.AsyncEventListener; import org.apache.geode.cache.util.CacheListenerAdapter; -import org.junit.Test; -import org.junit.runner.RunWith; - import org.springframework.beans.factory.BeanNameAware; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringRunner; import org.springframework.util.StringUtils; /** - * The LookupRegionMutationIntegrationTest class is a test suite of test cases testing the contract and integrated - * functionality between natively-defined GemFire Cache Regions and SDG's Region lookup functionality combined with - * Region attribute(s) mutation. + * Integration Tests for {@link LookupRegionFactoryBean} testing the contract and integrated functionality between + * natively-defined GemFire/Geode cache {@link Region Regions} and SDG's {@link Region} lookup functionality + * combined with {@link org.apache.geode.cache.RegionAttributes} {@link Region#getAttributesMutator() mutation}. * * @author John Blum * @see org.junit.Test - * @see org.junit.runner.RunWith * @see org.springframework.data.gemfire.LookupRegionFactoryBean * @see org.springframework.test.context.ContextConfiguration - * @see org.springframework.test.context.junit4.SpringJUnit4ClassRunner + * @see org.springframework.test.context.junit4.SpringRunner * @since 1.7.0 */ @RunWith(SpringRunner.class) @@ -77,7 +75,7 @@ public class LookupRegionMutationIntegrationTest { @Resource(name = "Example") private Region example; - private void assertCacheListeners(CacheListener[] cacheListeners, Collection expectedCacheListenerNames) { + private void assertCacheListeners(CacheListener[] cacheListeners, Collection expectedCacheListenerNames) { if (!expectedCacheListenerNames.isEmpty()) { assertNotNull("CacheListeners must not be null!", cacheListeners); @@ -204,11 +202,14 @@ public class LookupRegionMutationIntegrationTest { public static final class TestAsyncEventListener extends AbstractNameable implements AsyncEventListener { - @Override public boolean processEvents(List events) { + @Override + public boolean processEvents(List events) { throw new UnsupportedOperationException("Not Implemented!"); } - @Override public void close() { } + @Override + public void close() { } + } public static final class TestCacheListener extends CacheListenerAdapter implements Nameable { @@ -245,21 +246,29 @@ public class LookupRegionMutationIntegrationTest { @Override public void close() { } + } public static final class TestCacheWriter extends AbstractNameable implements CacheWriter { - @Override public void beforeUpdate(EntryEvent event) throws CacheWriterException { } + @Override + public void beforeUpdate(EntryEvent event) throws CacheWriterException { } - @Override public void beforeCreate(EntryEvent event) throws CacheWriterException { } + @Override + public void beforeCreate(EntryEvent event) throws CacheWriterException { } - @Override public void beforeDestroy(EntryEvent event) throws CacheWriterException { } + @Override + public void beforeDestroy(EntryEvent event) throws CacheWriterException { } - @Override public void beforeRegionDestroy(RegionEvent event) throws CacheWriterException { } + @Override + public void beforeRegionDestroy(RegionEvent event) throws CacheWriterException { } - @Override public void beforeRegionClear(RegionEvent event) throws CacheWriterException { } + @Override + public void beforeRegionClear(RegionEvent event) throws CacheWriterException { } + + @Override + public void close() { } - @Override public void close() { } } public static final class TestCustomExpiry extends AbstractNameable implements CustomExpiry { @@ -271,5 +280,6 @@ public class LookupRegionMutationIntegrationTest { @Override public void close() { } + } } diff --git a/spring-data-geode/src/test/resources/org/springframework/data/gemfire/LookupPartitionRegionMutationIntegrationTest-context.xml b/spring-data-geode/src/test/resources/org/springframework/data/gemfire/LookupPartitionRegionMutationIntegrationTest-context.xml index 62babfb5..4a283112 100644 --- a/spring-data-geode/src/test/resources/org/springframework/data/gemfire/LookupPartitionRegionMutationIntegrationTest-context.xml +++ b/spring-data-geode/src/test/resources/org/springframework/data/gemfire/LookupPartitionRegionMutationIntegrationTest-context.xml @@ -11,7 +11,7 @@ "> - LookupRegionMutationIntegrationTest + LookupPartitionRegionMutationIntegrationTest error diff --git a/spring-data-geode/src/test/resources/org/springframework/data/gemfire/LookupRegionMutationIntegrationTest-context.xml b/spring-data-geode/src/test/resources/org/springframework/data/gemfire/LookupRegionMutationIntegrationTest-context.xml index cfaf817d..c743e7a8 100644 --- a/spring-data-geode/src/test/resources/org/springframework/data/gemfire/LookupRegionMutationIntegrationTest-context.xml +++ b/spring-data-geode/src/test/resources/org/springframework/data/gemfire/LookupRegionMutationIntegrationTest-context.xml @@ -43,8 +43,7 @@ -