SGF-749 - Rename o.s.d.g.RegionFactoryBean as o.s.d.g.PeerRegionFactoryBean.

Rename o.s.d.g.RegionLookupFactoryBean as o.s.d.g.ResolvableRegionFactoryBean.
This commit is contained in:
John Blum
2018-05-17 15:47:46 -07:00
parent 55766ffede
commit 1147947031
35 changed files with 218 additions and 203 deletions

View File

@@ -62,14 +62,14 @@ public class GenericRegionFactoryBeanTest {
.set("log-level", "warning")
.create();
RegionFactoryBean<Object, Object> defaultRegionFactory = new GenericRegionFactoryBean<Object, Object>();
PeerRegionFactoryBean<Object, Object> defaultRegionFactory = new GenericRegionFactoryBean<Object, Object>();
defaultRegionFactory.setCache(gemfireCache);
defaultRegionFactory.setName("DefaultRegion");
defaultRegionFactory.afterPropertiesSet();
defaultRegion = defaultRegionFactory.getObject();
RegionFactoryBean<Object, Object> emptyRegionFactory = new GenericRegionFactoryBean<Object, Object>();
PeerRegionFactoryBean<Object, Object> emptyRegionFactory = new GenericRegionFactoryBean<Object, Object>();
emptyRegionFactory.setCache(gemfireCache);
emptyRegionFactory.setDataPolicy(DataPolicy.EMPTY);
emptyRegionFactory.setName("EmptyRegion");
@@ -78,7 +78,7 @@ public class GenericRegionFactoryBeanTest {
emptyRegion = emptyRegionFactory.getObject();
RegionFactoryBean<Object, Object> localRegionFactory = new GenericRegionFactoryBean<Object, Object>();
PeerRegionFactoryBean<Object, Object> localRegionFactory = new GenericRegionFactoryBean<Object, Object>();
localRegionFactory.setCache(gemfireCache);
localRegionFactory.setDataPolicy(DataPolicy.NORMAL);
localRegionFactory.setName("LocalRegion");
@@ -87,7 +87,7 @@ public class GenericRegionFactoryBeanTest {
localRegion = localRegionFactory.getObject();
RegionFactoryBean<Object, Object> normalRegionFactory = new GenericRegionFactoryBean<Object, Object>();
PeerRegionFactoryBean<Object, Object> normalRegionFactory = new GenericRegionFactoryBean<Object, Object>();
normalRegionFactory.setCache(gemfireCache);
normalRegionFactory.setDataPolicy(DataPolicy.NORMAL);
normalRegionFactory.setName("NormalRegion");
@@ -96,7 +96,7 @@ public class GenericRegionFactoryBeanTest {
normalRegion = normalRegionFactory.getObject();
RegionFactoryBean<Object, Object> persistentPartitionRegionFactory = new GenericRegionFactoryBean<Object, Object>();
PeerRegionFactoryBean<Object, Object> persistentPartitionRegionFactory = new GenericRegionFactoryBean<Object, Object>();
persistentPartitionRegionFactory.setCache(gemfireCache);
persistentPartitionRegionFactory.setDataPolicy(DataPolicy.PERSISTENT_PARTITION);
persistentPartitionRegionFactory.setName("PersistentPartitionRegion");
@@ -105,7 +105,7 @@ public class GenericRegionFactoryBeanTest {
persistentPartitionRegion = persistentPartitionRegionFactory.getObject();
RegionFactoryBean<Object, Object> preloadedRegionFactory = new GenericRegionFactoryBean<Object, Object>();
PeerRegionFactoryBean<Object, Object> preloadedRegionFactory = new GenericRegionFactoryBean<Object, Object>();
preloadedRegionFactory.setCache(gemfireCache);
preloadedRegionFactory.setDataPolicy(DataPolicy.PRELOADED);
preloadedRegionFactory.setName("PreloadedRegion");
@@ -113,7 +113,7 @@ public class GenericRegionFactoryBeanTest {
preloadedRegion = preloadedRegionFactory.getObject();
RegionFactoryBean<Object, Object> replicateRegionFactory = new GenericRegionFactoryBean<Object, Object>();
PeerRegionFactoryBean<Object, Object> replicateRegionFactory = new GenericRegionFactoryBean<Object, Object>();
replicateRegionFactory.setCache(gemfireCache);
replicateRegionFactory.setDataPolicy(DataPolicy.REPLICATE);
replicateRegionFactory.setName("ReplicateRegion");

View File

@@ -57,7 +57,7 @@ import org.springframework.data.gemfire.test.support.AbstractRegionFactoryBeanTe
import org.springframework.data.gemfire.util.ArrayUtils;
/**
* Unit tests for {@link RegionFactoryBean}.
* Unit tests for {@link PeerRegionFactoryBean}.
*
* @author David Turanski
* @author John Blum
@@ -68,13 +68,13 @@ import org.springframework.data.gemfire.util.ArrayUtils;
* @see org.apache.geode.cache.RegionAttributes
* @see org.apache.geode.cache.RegionFactory
* @see org.apache.geode.cache.RegionShortcut
* @see org.springframework.data.gemfire.RegionFactoryBean
* @see PeerRegionFactoryBean
* @see org.springframework.data.gemfire.test.support.AbstractRegionFactoryBeanTests
*/
@SuppressWarnings("unchecked")
public class RegionFactoryBeanTest extends AbstractRegionFactoryBeanTests {
public class PeerRegionFactoryBeanTest extends AbstractRegionFactoryBeanTests {
private final RegionFactoryBean factoryBean = new TestRegionFactoryBean();
private final PeerRegionFactoryBean factoryBean = new TestRegionFactoryBean();
@After
public void tearDown() {
@@ -183,7 +183,7 @@ public class RegionFactoryBeanTest extends AbstractRegionFactoryBeanTests {
@Test
public void testIsPersistent() {
RegionFactoryBean<?, ?> factoryBean = new TestRegionFactoryBean<>();
PeerRegionFactoryBean<?, ?> factoryBean = new TestRegionFactoryBean<>();
assertFalse(factoryBean.isPersistent());
@@ -199,7 +199,7 @@ public class RegionFactoryBeanTest extends AbstractRegionFactoryBeanTests {
@Test
public void testIsNotPersistent() {
RegionFactoryBean<?, ?> factoryBean = new TestRegionFactoryBean<>();
PeerRegionFactoryBean<?, ?> factoryBean = new TestRegionFactoryBean<>();
assertFalse(factoryBean.isNotPersistent());
@@ -226,7 +226,7 @@ public class RegionFactoryBeanTest extends AbstractRegionFactoryBeanTests {
AtomicBoolean setDataPolicyCalled = new AtomicBoolean(false);
RegionFactoryBean factoryBean = new RegionFactoryBean() {
PeerRegionFactoryBean factoryBean = new PeerRegionFactoryBean() {
@Override
DataPolicy getDataPolicy(RegionFactory regionFactory, RegionShortcut regionShortcut) {
@@ -265,7 +265,7 @@ public class RegionFactoryBeanTest extends AbstractRegionFactoryBeanTests {
when(mockCache.createRegionFactory(eq(mockRegionAttributes))).thenReturn(mockRegionFactory);
RegionFactoryBean factoryBean = new TestRegionFactoryBean();
PeerRegionFactoryBean factoryBean = new TestRegionFactoryBean();
factoryBean.setAttributes(mockRegionAttributes);
factoryBean.setShortcut(null);
@@ -284,7 +284,7 @@ public class RegionFactoryBeanTest extends AbstractRegionFactoryBeanTests {
when(mockCache.createRegionFactory()).thenReturn(mockRegionFactory);
RegionFactoryBean factoryBean = new TestRegionFactoryBean();
PeerRegionFactoryBean factoryBean = new TestRegionFactoryBean();
factoryBean.setAttributes(null);
factoryBean.setShortcut(null);
@@ -340,17 +340,15 @@ public class RegionFactoryBeanTest extends AbstractRegionFactoryBeanTests {
when(mockRegionAttributes.getStatisticsEnabled()).thenReturn(true);
when(mockRegionAttributes.getSubscriptionAttributes()).thenReturn(testSubscriptionAttributes);
RegionFactoryBean factoryBean = new RegionFactoryBean() {
PeerRegionFactoryBean factoryBean = new PeerRegionFactoryBean() {
@Override
boolean isUserSpecifiedEvictionAttributes(RegionAttributes regionAttributes) {
boolean isUserSpecifiedEvictionAttributes(final RegionAttributes regionAttributes) {
return true;
}
@Override
void validateRegionAttributes(RegionAttributes regionAttributes) {
// no-op!
}
void validateRegionAttributes(RegionAttributes regionAttributes) { }
};
factoryBean.mergeRegionAttributes(mockRegionFactory, mockRegionAttributes);
@@ -455,7 +453,7 @@ public class RegionFactoryBeanTest extends AbstractRegionFactoryBeanTests {
when(mockRegionAttributes.getStatisticsEnabled()).thenReturn(true);
when(mockRegionAttributes.getSubscriptionAttributes()).thenReturn(null);
RegionFactoryBean factoryBean = new RegionFactoryBean() {
PeerRegionFactoryBean factoryBean = new PeerRegionFactoryBean() {
@Override boolean isUserSpecifiedEvictionAttributes(final RegionAttributes regionAttributes) {
return false;
}
@@ -1116,6 +1114,6 @@ public class RegionFactoryBeanTest extends AbstractRegionFactoryBeanTests {
}
}
protected static class TestRegionFactoryBean<K, V> extends RegionFactoryBean<K, V> {
protected static class TestRegionFactoryBean<K, V> extends PeerRegionFactoryBean<K, V> {
}
}

View File

@@ -28,7 +28,7 @@ import org.springframework.context.support.GenericXmlApplicationContext;
*/
public abstract class RecreatingContextTest {
protected GenericXmlApplicationContext ctx;
protected GenericXmlApplicationContext applicationContext;
protected abstract String location();
@@ -37,16 +37,16 @@ public abstract class RecreatingContextTest {
@Before
public void createCtx() {
ctx = new GenericXmlApplicationContext();
applicationContext = new GenericXmlApplicationContext();
configureContext();
ctx.load(location());
ctx.registerShutdownHook();
ctx.refresh();
applicationContext.load(location());
applicationContext.registerShutdownHook();
applicationContext.refresh();
}
@After
public void destroyCtx() {
if (ctx != null)
ctx.destroy();
if (applicationContext != null)
applicationContext.destroy();
}
}

View File

@@ -33,7 +33,7 @@ import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.FilterType;
import org.springframework.data.gemfire.PartitionedRegionFactoryBean;
import org.springframework.data.gemfire.RegionFactoryBean;
import org.springframework.data.gemfire.PeerRegionFactoryBean;
import org.springframework.data.gemfire.client.ClientRegionFactoryBean;
import org.springframework.data.gemfire.config.annotation.test.entities.CollocatedPartitionRegionEntity;
import org.springframework.data.gemfire.config.annotation.test.entities.NonEntity;
@@ -52,7 +52,7 @@ import org.springframework.data.gemfire.test.GemfireTestBeanPostProcessor;
* @see org.apache.geode.cache.Region
* @see org.springframework.context.ConfigurableApplicationContext
* @see org.springframework.context.annotation.AnnotationConfigApplicationContext
* @see org.springframework.data.gemfire.RegionFactoryBean
* @see PeerRegionFactoryBean
* @see org.springframework.data.gemfire.client.ClientRegionFactoryBean
* @see org.springframework.data.gemfire.config.annotation.RegionConfigurer
* @see org.springframework.data.gemfire.test.GemfireTestBeanPostProcessor
@@ -187,7 +187,7 @@ public class RegionConfigurerIntegrationTests {
private final Set<String> beanNames = new HashSet<>();
@Override
public void configure(String beanName, RegionFactoryBean<?, ?> bean) {
public void configure(String beanName, PeerRegionFactoryBean<?, ?> bean) {
this.beanNames.add(beanName);
}

View File

@@ -33,7 +33,7 @@ import org.springframework.beans.factory.config.BeanDefinition;
import org.springframework.beans.factory.config.BeanPostProcessor;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.AbstractApplicationContext;
import org.springframework.data.gemfire.RegionFactoryBean;
import org.springframework.data.gemfire.PeerRegionFactoryBean;
import org.springframework.data.gemfire.test.mock.context.GemFireMockObjectsApplicationContextInitializer;
import org.springframework.lang.Nullable;
import org.springframework.test.context.ContextConfiguration;
@@ -133,7 +133,7 @@ public class LuceneIndexRegionBeanFactoryPostProcessorIntegrationTests {
}
private boolean isRegionBean(Object bean) {
return bean instanceof Region || bean instanceof RegionFactoryBean;
return bean instanceof Region || bean instanceof PeerRegionFactoryBean;
}
}
}

View File

@@ -27,7 +27,7 @@ import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.data.gemfire.RegionFactoryBean;
import org.springframework.data.gemfire.PeerRegionFactoryBean;
import org.springframework.data.gemfire.TestUtils;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
@@ -51,7 +51,7 @@ public class CacheSubscriptionTest{
public void testReplicatedRegionSubscriptionAllPolicy() throws Exception {
assertTrue(context.containsBean("replicALL"));
RegionFactoryBean regionFactoryBean = context.getBean("&replicALL", RegionFactoryBean.class);
PeerRegionFactoryBean regionFactoryBean = context.getBean("&replicALL", PeerRegionFactoryBean.class);
RegionAttributes regionAttributes = TestUtils.readField("attributes", regionFactoryBean);
assertNotNull(regionAttributes);
@@ -66,7 +66,7 @@ public class CacheSubscriptionTest{
public void testPartitionRegionSubscriptionCacheContentPolicy() throws Exception {
assertTrue(context.containsBean("partCACHE_CONTENT"));
RegionFactoryBean regionFactoryBean = context.getBean("&partCACHE_CONTENT", RegionFactoryBean.class);
PeerRegionFactoryBean regionFactoryBean = context.getBean("&partCACHE_CONTENT", PeerRegionFactoryBean.class);
RegionAttributes regionAttributes = TestUtils.readField("attributes", regionFactoryBean);
assertNotNull(regionAttributes);
@@ -81,7 +81,7 @@ public class CacheSubscriptionTest{
public void testPartitionRegionSubscriptionDefaultPolicy() throws Exception {
assertTrue(context.containsBean("partDEFAULT"));
RegionFactoryBean regionFactoryBean = context.getBean("&partDEFAULT", RegionFactoryBean.class);
PeerRegionFactoryBean regionFactoryBean = context.getBean("&partDEFAULT", PeerRegionFactoryBean.class);
RegionAttributes regionAttributes = TestUtils.readField("attributes", regionFactoryBean);
assertNotNull(regionAttributes);

View File

@@ -49,7 +49,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.context.ApplicationContext;
import org.springframework.data.gemfire.PartitionedRegionFactoryBean;
import org.springframework.data.gemfire.RegionFactoryBean;
import org.springframework.data.gemfire.PeerRegionFactoryBean;
import org.springframework.data.gemfire.ReplicatedRegionFactoryBean;
import org.springframework.data.gemfire.SimpleObjectSizer;
import org.springframework.data.gemfire.TestUtils;
@@ -119,7 +119,7 @@ public class DiskStoreAndEvictionRegionParsingTest {
assertTrue(applicationContext.containsBean("replicated-data"));
RegionFactoryBean replicatedDataRegionFactoryBean = applicationContext.getBean("&replicated-data", RegionFactoryBean.class);
PeerRegionFactoryBean replicatedDataRegionFactoryBean = applicationContext.getBean("&replicated-data", PeerRegionFactoryBean.class);
assertTrue(replicatedDataRegionFactoryBean instanceof ReplicatedRegionFactoryBean);
assertEquals(DataPolicy.REPLICATE, replicatedDataRegionFactoryBean.getDataPolicy());
@@ -148,7 +148,7 @@ public class DiskStoreAndEvictionRegionParsingTest {
public void testPartitionDataOptions() throws Exception {
assertTrue(applicationContext.containsBean("partition-data"));
RegionFactoryBean fb = applicationContext.getBean("&partition-data", RegionFactoryBean.class);
PeerRegionFactoryBean fb = applicationContext.getBean("&partition-data", PeerRegionFactoryBean.class);
assertTrue(fb instanceof PartitionedRegionFactoryBean);
assertTrue((Boolean) TestUtils.readField("persistent", fb));
RegionAttributes attrs = TestUtils.readField("attributes", fb);
@@ -169,7 +169,7 @@ public class DiskStoreAndEvictionRegionParsingTest {
assertTrue(applicationContext.containsBean("replicated-data"));
RegionFactoryBean fb = applicationContext.getBean("&replicated-data", RegionFactoryBean.class);
PeerRegionFactoryBean fb = applicationContext.getBean("&replicated-data", PeerRegionFactoryBean.class);
RegionAttributes attrs = TestUtils.readField("attributes", fb);
ExpirationAttributes entryTTL = attrs.getEntryTimeToLive();
@@ -196,7 +196,7 @@ public class DiskStoreAndEvictionRegionParsingTest {
assertTrue(applicationContext.containsBean("replicated-data-custom-expiry"));
RegionFactoryBean fb = applicationContext.getBean("&replicated-data-custom-expiry", RegionFactoryBean.class);
PeerRegionFactoryBean fb = applicationContext.getBean("&replicated-data-custom-expiry", PeerRegionFactoryBean.class);
RegionAttributes attrs = TestUtils.readField("attributes", fb);
assertNotNull(attrs.getCustomEntryIdleTimeout());

View File

@@ -20,9 +20,9 @@ import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertSame;
import static org.junit.Assert.assertTrue;
import static org.springframework.data.gemfire.util.ArrayUtils.nullSafeArray;
import java.io.File;
import java.io.FilenameFilter;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.List;
@@ -39,8 +39,8 @@ import org.apache.geode.cache.wan.GatewaySender.OrderPolicy;
import org.apache.geode.cache.wan.GatewayTransportFilter;
import org.junit.AfterClass;
import org.junit.Test;
import org.springframework.data.gemfire.PeerRegionFactoryBean;
import org.springframework.data.gemfire.RecreatingContextTest;
import org.springframework.data.gemfire.RegionFactoryBean;
import org.springframework.data.gemfire.TestUtils;
import org.springframework.data.gemfire.test.GemfireTestBeanPostProcessor;
import org.springframework.data.gemfire.wan.GatewaySenderFactoryBean;
@@ -65,24 +65,25 @@ public class GemfireV7GatewayNamespaceTest extends RecreatingContextTest {
@Override
protected void configureContext() {
ctx.getBeanFactory().addBeanPostProcessor(new GemfireTestBeanPostProcessor());
this.applicationContext.getBeanFactory().addBeanPostProcessor(new GemfireTestBeanPostProcessor());
}
@AfterClass
@SuppressWarnings("all")
public static void tearDown() {
for (String name : new File(".").list(new FilenameFilter() {
@Override
public boolean accept(File file, String filename) {
return filename.startsWith("BACKUP");
}
})) {
for (String name : nullSafeArray(new File(".")
.list((file, filename) -> filename.startsWith("BACKUP")), String.class)) {
new File(name).delete();
}
}
@Test
public void testAsyncEventQueue() {
AsyncEventQueue asyncEventQueue = ctx.getBean("async-event-queue", AsyncEventQueue.class);
AsyncEventQueue asyncEventQueue =
this.applicationContext.getBean("async-event-queue", AsyncEventQueue.class);
assertNotNull(asyncEventQueue);
assertTrue(asyncEventQueue.isBatchConflationEnabled());
@@ -98,7 +99,9 @@ public class GemfireV7GatewayNamespaceTest extends RecreatingContextTest {
@Test
public void testGatewaySender() throws Exception {
GatewaySenderFactoryBean gatewaySenderFactoryBean = ctx.getBean("&gateway-sender", GatewaySenderFactoryBean.class);
GatewaySenderFactoryBean gatewaySenderFactoryBean =
this.applicationContext.getBean("&gateway-sender", GatewaySenderFactoryBean.class);
assertNotNull(gatewaySenderFactoryBean);
assertNotNull(TestUtils.readField("cache", gatewaySenderFactoryBean));
@@ -126,12 +129,14 @@ public class GemfireV7GatewayNamespaceTest extends RecreatingContextTest {
@Test
@SuppressWarnings("rawtypes")
public void testInnerGatewaySender() throws Exception {
Region<?, ?> region = ctx.getBean("region-inner-gateway-sender", Region.class);
Region<?, ?> region = this.applicationContext.getBean("region-inner-gateway-sender", Region.class);
assertNotNull(region.getAttributes().getGatewaySenderIds());
assertEquals(2, region.getAttributes().getGatewaySenderIds().size());
RegionFactoryBean regionFactoryBean = ctx.getBean("&region-inner-gateway-sender", RegionFactoryBean.class);
PeerRegionFactoryBean regionFactoryBean =
this.applicationContext.getBean("&region-inner-gateway-sender", PeerRegionFactoryBean.class);
Object[] gatewaySenders = TestUtils.readField("gatewaySenders", regionFactoryBean);
@@ -173,8 +178,10 @@ public class GemfireV7GatewayNamespaceTest extends RecreatingContextTest {
@Test
public void testGatewaySenderWithEventTransportFilterRefs() throws Exception {
GatewaySenderFactoryBean gatewaySenderFactoryBean = ctx.getBean("&gateway-sender-with-event-transport-filter-refs",
GatewaySenderFactoryBean.class);
GatewaySenderFactoryBean gatewaySenderFactoryBean =
this.applicationContext.getBean("&gateway-sender-with-event-transport-filter-refs",
GatewaySenderFactoryBean.class);
assertNotNull(gatewaySenderFactoryBean);
assertNotNull(TestUtils.readField("cache", gatewaySenderFactoryBean));
@@ -189,19 +196,21 @@ public class GemfireV7GatewayNamespaceTest extends RecreatingContextTest {
assertNotNull(eventFilters);
assertEquals(1, eventFilters.size());
assertTrue(eventFilters.get(0) instanceof TestEventFilter);
assertSame(ctx.getBean("event-filter"), eventFilters.get(0));
assertSame(applicationContext.getBean("event-filter"), eventFilters.get(0));
List<GatewayTransportFilter> transportFilters = TestUtils.readField("transportFilters", gatewaySenderFactoryBean);
assertNotNull(transportFilters);
assertEquals(1, transportFilters.size());
assertTrue(transportFilters.get(0) instanceof TestTransportFilter);
assertSame(ctx.getBean("transport-filter"), transportFilters.get(0));
assertSame(applicationContext.getBean("transport-filter"), transportFilters.get(0));
}
@Test
public void testGatewayReceiver() {
GatewayReceiver gatewayReceiver = ctx.getBean("gateway-receiver", GatewayReceiver.class);
GatewayReceiver gatewayReceiver =
this.applicationContext.getBean("gateway-receiver", GatewayReceiver.class);
assertNotNull(gatewayReceiver);
assertEquals("192.168.0.1", gatewayReceiver.getBindAddress());
@@ -215,12 +224,10 @@ public class GemfireV7GatewayNamespaceTest extends RecreatingContextTest {
public static class TestEventFilter implements GatewayEventFilter {
@Override
public void close() {
}
public void close() { }
@Override
public void afterAcknowledgement(GatewayQueueEvent arg0) {
}
public void afterAcknowledgement(GatewayQueueEvent arg0) { }
@Override
public boolean beforeEnqueue(GatewayQueueEvent arg0) {
@@ -236,8 +243,7 @@ public class GemfireV7GatewayNamespaceTest extends RecreatingContextTest {
public static class TestTransportFilter implements GatewayTransportFilter {
@Override
public void close() {
}
public void close() { }
@Override
public InputStream getInputStream(InputStream arg0) {
@@ -254,8 +260,7 @@ public class GemfireV7GatewayNamespaceTest extends RecreatingContextTest {
public static class TestAsyncEventListener implements AsyncEventListener {
@Override
public void close() {
}
public void close() { }
@Override
public boolean processEvents(List<AsyncEvent> arg0) {

View File

@@ -22,7 +22,7 @@ import static org.junit.Assert.assertTrue;
import org.junit.Test;
import org.springframework.beans.factory.BeanCreationException;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.data.gemfire.RegionFactoryBean;
import org.springframework.data.gemfire.PeerRegionFactoryBean;
/**
* The InvalidRegionDefinitionUsingBeansNamespaceTest class is a test suite of test cases testing the definition of
@@ -32,7 +32,7 @@ import org.springframework.data.gemfire.RegionFactoryBean;
*
* @author John Blum
* @see org.junit.Test
* @see org.springframework.data.gemfire.RegionFactoryBean
* @see PeerRegionFactoryBean
* @since 1.6.0
*/
public class InvalidRegionDefinitionUsingBeansNamespaceTest {
@@ -57,6 +57,6 @@ public class InvalidRegionDefinitionUsingBeansNamespaceTest {
}
@SuppressWarnings("unused")
public static final class TestRegionFactoryBean<K, V> extends RegionFactoryBean<K, V> { }
public static final class TestRegionFactoryBean<K, V> extends PeerRegionFactoryBean<K, V> { }
}

View File

@@ -34,8 +34,8 @@ import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.data.gemfire.RegionFactoryBean;
import org.springframework.data.gemfire.RegionLookupFactoryBean;
import org.springframework.data.gemfire.PeerRegionFactoryBean;
import org.springframework.data.gemfire.ResolvableRegionFactoryBean;
import org.springframework.data.gemfire.SimpleCacheListener;
import org.springframework.data.gemfire.TestUtils;
import org.springframework.data.gemfire.test.mock.context.GemFireMockObjectsApplicationContextInitializer;
@@ -83,7 +83,7 @@ public class LocalRegionNamespaceTest {
assertTrue(applicationContext.containsBean("pub"));
RegionFactoryBean publisherRegionFactoryBean = applicationContext.getBean("&pub", RegionFactoryBean.class);
PeerRegionFactoryBean publisherRegionFactoryBean = applicationContext.getBean("&pub", PeerRegionFactoryBean.class);
assertNotNull(publisherRegionFactoryBean);
assertEquals(DataPolicy.NORMAL, TestUtils.readField("dataPolicy", publisherRegionFactoryBean));
@@ -102,7 +102,7 @@ public class LocalRegionNamespaceTest {
assertTrue(applicationContext.containsBean("complex"));
RegionFactoryBean complexRegionFactoryBean = applicationContext.getBean("&complex", RegionFactoryBean.class);
PeerRegionFactoryBean complexRegionFactoryBean = applicationContext.getBean("&complex", PeerRegionFactoryBean.class);
assertNotNull(complexRegionFactoryBean);
@@ -152,7 +152,7 @@ public class LocalRegionNamespaceTest {
assertTrue(applicationContext.containsBean("lookup"));
RegionLookupFactoryBean localRegionFactoryBean = applicationContext.getBean("&lookup", RegionLookupFactoryBean.class);
ResolvableRegionFactoryBean localRegionFactoryBean = applicationContext.getBean("&lookup", ResolvableRegionFactoryBean.class);
assertEquals("existing", TestUtils.readField("name", localRegionFactoryBean));
assertSame(existing, applicationContext.getBean("lookup"));

View File

@@ -41,7 +41,7 @@ import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.data.gemfire.PartitionedRegionFactoryBean;
import org.springframework.data.gemfire.RegionFactoryBean;
import org.springframework.data.gemfire.PeerRegionFactoryBean;
import org.springframework.data.gemfire.SimpleCacheListener;
import org.springframework.data.gemfire.SimplePartitionResolver;
import org.springframework.data.gemfire.TestUtils;
@@ -96,7 +96,7 @@ public class PartitionedRegionNamespaceTest {
assertThat(options.getName()).isEqualTo("redundant");
assertThat(options.getAttributes().getOffHeap()).isTrue();
RegionFactoryBean optionsRegionFactoryBean = applicationContext.getBean("&options", RegionFactoryBean.class);
PeerRegionFactoryBean optionsRegionFactoryBean = applicationContext.getBean("&options", PeerRegionFactoryBean.class);
assertTrue(optionsRegionFactoryBean instanceof PartitionedRegionFactoryBean);
assertNull(TestUtils.readField("scope", optionsRegionFactoryBean));
@@ -122,7 +122,7 @@ public class PartitionedRegionNamespaceTest {
assertTrue(applicationContext.containsBean("complex"));
RegionFactoryBean complexRegionFactoryBean = applicationContext.getBean("&complex", RegionFactoryBean.class);
PeerRegionFactoryBean complexRegionFactoryBean = applicationContext.getBean("&complex", PeerRegionFactoryBean.class);
CacheListener[] cacheListeners = TestUtils.readField("cacheListeners", complexRegionFactoryBean);
@@ -167,7 +167,7 @@ public class PartitionedRegionNamespaceTest {
@SuppressWarnings("rawtypes")
public void testFixedPartitionRegion() throws Exception {
RegionFactoryBean fixedRegionFactoryBean = applicationContext.getBean("&fixed", RegionFactoryBean.class);
PeerRegionFactoryBean fixedRegionFactoryBean = applicationContext.getBean("&fixed", PeerRegionFactoryBean.class);
assertNotNull(fixedRegionFactoryBean);

View File

@@ -30,7 +30,7 @@ import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.data.gemfire.RegionFactoryBean;
import org.springframework.data.gemfire.PeerRegionFactoryBean;
import org.springframework.data.gemfire.TestUtils;
import org.springframework.data.gemfire.test.GemfireTestApplicationContextInitializer;
import org.springframework.test.context.ContextConfiguration;
@@ -45,7 +45,7 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
* @see org.junit.Test
* @see org.springframework.data.gemfire.PartitionAttributesFactoryBean
* @see org.springframework.data.gemfire.RegionAttributesFactoryBean
* @see org.springframework.data.gemfire.RegionFactoryBean
* @see PeerRegionFactoryBean
* @see org.springframework.data.gemfire.test.GemfireTestApplicationContextInitializer
* @see org.springframework.test.context.ContextConfiguration
* @see org.springframework.test.context.junit4.SpringJUnit4ClassRunner
@@ -82,8 +82,8 @@ public class RegionDefinitionUsingBeansNamespaceTest {
@Test
public void testAnotherExampleRegionFactoryBeanConfiguration() throws Exception {
RegionFactoryBean<?, ?> anotherExampleRegionFactoryBean = context.getBean("&AnotherExample",
RegionFactoryBean.class);
PeerRegionFactoryBean<?, ?> anotherExampleRegionFactoryBean = context.getBean("&AnotherExample",
PeerRegionFactoryBean.class);
assertNotNull(anotherExampleRegionFactoryBean);
assertEquals(DataPolicy.PERSISTENT_PARTITION, anotherExampleRegionFactoryBean.getDataPolicy());
@@ -112,7 +112,7 @@ public class RegionDefinitionUsingBeansNamespaceTest {
assertEquals(2, anotherExample.getAttributes().getPartitionAttributes().getRedundantCopies());
}
public static final class TestRegionFactoryBean<K, V> extends RegionFactoryBean<K, V> {
public static final class TestRegionFactoryBean<K, V> extends PeerRegionFactoryBean<K, V> {
}
}

View File

@@ -35,8 +35,8 @@ import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.data.gemfire.RegionFactoryBean;
import org.springframework.data.gemfire.RegionLookupFactoryBean;
import org.springframework.data.gemfire.PeerRegionFactoryBean;
import org.springframework.data.gemfire.ResolvableRegionFactoryBean;
import org.springframework.data.gemfire.ReplicatedRegionFactoryBean;
import org.springframework.data.gemfire.SimpleCacheListener;
import org.springframework.data.gemfire.TestUtils;
@@ -68,8 +68,8 @@ public class ReplicatedRegionNamespaceTest {
assertTrue(applicationContext.containsBean("simple"));
RegionFactoryBean simpleRegionFactoryBean =
applicationContext.getBean("&simple", RegionFactoryBean.class);
PeerRegionFactoryBean simpleRegionFactoryBean =
applicationContext.getBean("&simple", PeerRegionFactoryBean.class);
assertEquals("simple", TestUtils.readField("beanName", simpleRegionFactoryBean));
assertEquals(false, TestUtils.readField("close", simpleRegionFactoryBean));
@@ -89,8 +89,8 @@ public class ReplicatedRegionNamespaceTest {
assertTrue(applicationContext.containsBean("pub"));
RegionFactoryBean publisherRegionFactoryBean =
applicationContext.getBean("&pub", RegionFactoryBean.class);
PeerRegionFactoryBean publisherRegionFactoryBean =
applicationContext.getBean("&pub", PeerRegionFactoryBean.class);
assertTrue(publisherRegionFactoryBean instanceof ReplicatedRegionFactoryBean);
assertEquals("publisher", TestUtils.readField("name", publisherRegionFactoryBean));
@@ -108,8 +108,8 @@ public class ReplicatedRegionNamespaceTest {
assertTrue(applicationContext.containsBean("complex"));
RegionFactoryBean complexRegionFactoryBean =
applicationContext.getBean("&complex", RegionFactoryBean.class);
PeerRegionFactoryBean complexRegionFactoryBean =
applicationContext.getBean("&complex", PeerRegionFactoryBean.class);
assertNotNull(complexRegionFactoryBean);
assertEquals("complex", TestUtils.readField("beanName", complexRegionFactoryBean));
@@ -181,11 +181,11 @@ public class ReplicatedRegionNamespaceTest {
assertTrue(applicationContext.containsBean("lookup"));
RegionLookupFactoryBean regionLookupFactoryBean =
applicationContext.getBean("&lookup", RegionLookupFactoryBean.class);
ResolvableRegionFactoryBean regionFactoryBean =
applicationContext.getBean("&lookup", ResolvableRegionFactoryBean.class);
assertNotNull(regionLookupFactoryBean);
assertEquals("existing", TestUtils.readField("name", regionLookupFactoryBean));
assertNotNull(regionFactoryBean);
assertEquals("existing", TestUtils.readField("name", regionFactoryBean));
assertSame(existing, applicationContext.getBean("lookup"));
}

View File

@@ -27,7 +27,7 @@ import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.Test;
import org.springframework.data.gemfire.RegionFactoryBean;
import org.springframework.data.gemfire.PeerRegionFactoryBean;
import org.springframework.data.gemfire.test.StubCache;
/**
@@ -82,12 +82,12 @@ public abstract class AbstractRegionFactoryBeanTests {
public Exception exception;
@SuppressWarnings("rawtypes")
public final RegionFactoryBean regionFactoryBean;
public final PeerRegionFactoryBean regionFactoryBean;
public final String regionName;
@SuppressWarnings("rawtypes")
public RegionFactoryBeanConfig(RegionFactoryBean regionFactoryBean, String regionName) {
public RegionFactoryBeanConfig(PeerRegionFactoryBean regionFactoryBean, String regionName) {
this.regionFactoryBean = regionFactoryBean;
this.regionName = regionName;
regionFactoryBean.setBeanName(regionName);

View File

@@ -17,7 +17,7 @@
<gfe:cache properties-ref="gemfireProperties"/>
<bean id="replicate-persistent-region" class="org.springframework.data.gemfire.RegionFactoryBeanTest$TestRegionFactoryBean">
<bean id="replicate-persistent-region" class="org.springframework.data.gemfire.PeerRegionFactoryBeanTest$TestRegionFactoryBean">
<property name="cache" ref="gemfireCache"/>
<property name="dataPolicy" value="REPLICATE_PERSISTENT"/>
</bean>