Fixed the syntactically incorrect colocated-with-ref attribute on gfe:*-region elements, renaming back to colocated-with. Changed the ClientRegionNamespaceTest and associated context configuration file to allow Region names to be used as bean aliases in the Spring container using Spring GemFire configuration.

This commit is contained in:
jxblum
2013-09-24 12:08:44 -07:00
parent 591e7c5d05
commit 93079f9de9
3 changed files with 22 additions and 21 deletions

View File

@@ -32,8 +32,6 @@ import org.springframework.context.ApplicationContext;
import org.springframework.data.gemfire.SimpleObjectSizer;
import org.springframework.data.gemfire.TestUtils;
import org.springframework.data.gemfire.client.ClientRegionFactoryBean;
import org.springframework.data.gemfire.client.Interest;
import org.springframework.data.gemfire.client.RegexInterest;
import org.springframework.data.gemfire.test.GemfireTestApplicationContextInitializer;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
@@ -44,7 +42,6 @@ import com.gemstone.gemfire.cache.DataPolicy;
import com.gemstone.gemfire.cache.EvictionAction;
import com.gemstone.gemfire.cache.EvictionAlgorithm;
import com.gemstone.gemfire.cache.EvictionAttributes;
import com.gemstone.gemfire.cache.InterestResultPolicy;
import com.gemstone.gemfire.cache.Region;
import com.gemstone.gemfire.cache.RegionAttributes;
import com.gemstone.gemfire.cache.util.ObjectSizer;
@@ -82,7 +79,11 @@ public class ClientRegionNamespaceTest {
@Test
public void testBeanNames() throws Exception {
assertTrue(ObjectUtils.isEmpty(context.getAliases("publisher")));
assertTrue(context.containsBean("SimpleRegion"));
assertTrue(context.containsBean("publisher"));
assertTrue(context.containsBean("ComplexRegion"));
assertTrue(context.containsBean("PersistentRegion"));
assertTrue(context.containsBean("OverflowRegion"));
}
@SuppressWarnings("rawtypes")
@@ -134,4 +135,4 @@ public class ClientRegionNamespaceTest {
ObjectSizer sizer = evicAttr.getObjectSizer();
assertEquals(SimpleObjectSizer.class, sizer.getClass());
}
}
}

View File

@@ -9,7 +9,7 @@
<gfe:cache/>
<!-- NOTE the order of Region bean definitions is important in reproducing the issue in JIRA 195 -->
<gfe:partitioned-region id="colocatedRegion" name="Colocated" colocated-with-ref="sourceRegion"/>
<gfe:partitioned-region id="colocatedRegion" name="Colocated" colocated-with="Source"/>
<gfe:partitioned-region id="sourceRegion" name="Source"/>
</beans>

View File

@@ -10,12 +10,12 @@
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd">
<gfe:client-cache />
<gfe:client-region id="simple" />
<gfe:client-region id="simple" name="SimpleRegion"/>
<gfe:client-region id="empty" pool-name="gemfire-pool" name="publisher" data-policy="empty" close="true" destroy="false"/>
<gfe:client-region id="complex" pool-name="gemfire-pool" close="true" destroy="false" load-factor="0.5" statistics="true">
<gfe:client-region id="complex" name="ComplexRegion" pool-name="gemfire-pool" close="true" destroy="false" load-factor="0.5" statistics="true">
<gfe:cache-listener>
<ref bean="c-listener"/>
<bean class="org.springframework.data.gemfire.SimpleCacheListener"/>
@@ -23,20 +23,20 @@
<gfe:entry-ttl action="INVALIDATE" timeout="500"/>
<gfe:eviction threshold="5"/>
</gfe:client-region>
<bean id="c-listener" class="org.springframework.data.gemfire.SimpleCacheListener"/>
<gfe:pool id="gemfire-pool" subscription-enabled="false">
<gfe:locator host="localhost" port="40403"/>
</gfe:pool>
<gfe:client-region id="persistent" pool-name="gemfire-pool" persistent="true" disk-store-ref="diskStore" disk-synchronous="true"/>
<gfe:disk-store id="diskStore" queue-size="50" auto-compact="true" max-oplog-size="10" time-interval="9999">
<gfe:disk-dir location="./" max-size="1"/>
</gfe:disk-store>
<gfe:client-region id="overflow" pool-name="gemfire-pool" disk-store-ref="diskStore">
<gfe:client-region id="persistent" name="PersistentRegion" pool-name="gemfire-pool" persistent="true" disk-store-ref="diskStore" disk-synchronous="true"/>
<gfe:disk-store id="diskStore" queue-size="50" auto-compact="true" max-oplog-size="10" time-interval="9999">
<gfe:disk-dir location="./" max-size="1"/>
</gfe:disk-store>
<gfe:client-region id="overflow" name="OverflowRegion" pool-name="gemfire-pool" disk-store-ref="diskStore">
<gfe:eviction type="MEMORY_SIZE" threshold="10" action="OVERFLOW_TO_DISK">
<gfe:object-sizer>
<bean class="org.springframework.data.gemfire.SimpleObjectSizer"/>
@@ -44,4 +44,4 @@
</gfe:eviction>
</gfe:client-region>
</beans>
</beans>