Added additional test case to test Client Region attribute configuration settings, including the new attributes for concurrency (concurrency-checks-enabled and concurrency-level) for SGF-310 and SGF-311.
This commit is contained in:
@@ -223,6 +223,28 @@ public class ClientRegionNamespaceTest {
|
||||
assertEquals("STD", compressed.getAttributes().getCompressor().toString());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testClientRegionWithAttributes() {
|
||||
assertTrue(context.containsBean("client-with-attributes"));
|
||||
|
||||
Region<Long, String> clientRegion = context.getBean("client-with-attributes", Region.class);
|
||||
|
||||
assertNotNull("The 'client-with-attributes' Client Region was not properly configured and initialized!", clientRegion);
|
||||
assertEquals("client-with-attributes", clientRegion.getName());
|
||||
assertEquals(Region.SEPARATOR + "client-with-attributes", clientRegion.getFullPath());
|
||||
assertNotNull(clientRegion.getAttributes());
|
||||
assertFalse(clientRegion.getAttributes().getCloningEnabled());
|
||||
assertTrue(clientRegion.getAttributes().getConcurrencyChecksEnabled());
|
||||
assertEquals(8, clientRegion.getAttributes().getConcurrencyLevel());
|
||||
assertEquals(DataPolicy.NORMAL, clientRegion.getAttributes().getDataPolicy());
|
||||
assertFalse(clientRegion.getAttributes().getDataPolicy().withPersistence());
|
||||
assertEquals(64, clientRegion.getAttributes().getInitialCapacity());
|
||||
assertEquals(Long.class, clientRegion.getAttributes().getKeyConstraint());
|
||||
assertEquals("0.85", String.valueOf(clientRegion.getAttributes().getLoadFactor()));
|
||||
assertEquals("gemfire-pool", clientRegion.getAttributes().getPoolName());
|
||||
assertEquals(String.class, clientRegion.getAttributes().getValueConstraint());
|
||||
}
|
||||
|
||||
public static final class TestCacheLoader implements CacheLoader<Object, Object> {
|
||||
|
||||
@Override
|
||||
|
||||
@@ -27,8 +27,6 @@
|
||||
<gfe:eviction threshold="5"/>
|
||||
</gfe:client-region>
|
||||
|
||||
<bean id="c-listener" class="org.springframework.data.gemfire.SimpleCacheListener"/>
|
||||
|
||||
<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" auto-compact="true" max-oplog-size="5" queue-size="50" time-interval="9999">
|
||||
@@ -56,6 +54,19 @@
|
||||
<gfe:compressor ref="testCompressor"/>
|
||||
</gfe:client-region>
|
||||
|
||||
<gfe:client-region id="client-with-attributes"
|
||||
cloning-enabled="false"
|
||||
concurrency-checks-enabled="true"
|
||||
concurrency-level="8"
|
||||
initial-capacity="64"
|
||||
key-constraint="java.lang.Long"
|
||||
load-factor="0.85"
|
||||
persistent="false"
|
||||
pool-name="gemfire-pool"
|
||||
shortcut="CACHING_PROXY"
|
||||
value-constraint="java.lang.String"/>
|
||||
|
||||
<bean id="c-listener" class="org.springframework.data.gemfire.SimpleCacheListener"/>
|
||||
<bean id="testCompressor" class="org.springframework.data.gemfire.config.ClientRegionNamespaceTest$TestCompressor" p:name="STD"/>
|
||||
|
||||
</beans>
|
||||
|
||||
Reference in New Issue
Block a user