SGF-57
+ improve other tests in the process
This commit is contained in:
@@ -59,7 +59,7 @@ public class CacheNamespaceTest extends RecreatingContextTest {
|
||||
assertTrue(ctx.containsBean("cache-with-xml"));
|
||||
CacheFactoryBean cfb = (CacheFactoryBean) ctx.getBean("&cache-with-xml");
|
||||
Resource res = TestUtils.readField("cacheXml", cfb);
|
||||
assertEquals("cache.xml", res.getFilename());
|
||||
assertEquals("gemfire-cache.xml", res.getFilename());
|
||||
assertEquals(ctx.getBean("props"), TestUtils.readField("properties", cfb));
|
||||
}
|
||||
|
||||
|
||||
@@ -48,7 +48,7 @@ public class CacheServerProcess {
|
||||
AttributesFactory factory = new AttributesFactory();
|
||||
factory.setDataPolicy(DataPolicy.REPLICATE);
|
||||
factory.setScope(Scope.DISTRIBUTED_ACK);
|
||||
Region testRegion = cache.createRegion("test", factory.create());
|
||||
Region testRegion = cache.createRegion("test-cq", factory.create());
|
||||
System.out.println("Test region, " + testRegion.getFullPath() + ", created in cache.");
|
||||
|
||||
// Start Cache Server.
|
||||
|
||||
39
src/test/resources/gemfire-cache.xml
Normal file
39
src/test/resources/gemfire-cache.xml
Normal file
@@ -0,0 +1,39 @@
|
||||
<?xml version="1.0"?>
|
||||
<!DOCTYPE cache PUBLIC "-//GemStone Systems, Inc.//GemFire Declarative Caching 5.7//EN" "http://www.gemstone.com/dtd/cache5_7.dtd">
|
||||
<cache lock-lease="120" lock-timeout="60" search-timeout="300">
|
||||
<region-attributes id="attTemplate" scope="local" data-policy="normal" initial-capacity="16" load-factor="0.75" concurrency-level="16" statistics-enabled="true">
|
||||
<key-constraint>java.lang.String</key-constraint>
|
||||
</region-attributes>
|
||||
<region name="root">
|
||||
<region-attributes refid="attTemplate" scope="distributed-no-ack">
|
||||
<region-time-to-live>
|
||||
<expiration-attributes timeout="0" action="invalidate"/>
|
||||
</region-time-to-live>
|
||||
<region-idle-time>
|
||||
<expiration-attributes timeout="0" action="invalidate"/>
|
||||
</region-idle-time>
|
||||
<entry-time-to-live>
|
||||
<expiration-attributes timeout="0" action="invalidate"/>
|
||||
</entry-time-to-live>
|
||||
<entry-idle-time>
|
||||
<expiration-attributes timeout="0" action="invalidate"/>
|
||||
</entry-idle-time>
|
||||
</region-attributes>
|
||||
<entry>
|
||||
<key><string>Application Version</string></key>
|
||||
<value><string>1.0</string></value>
|
||||
</entry>
|
||||
<region name="rlocal">
|
||||
<region-attributes refid="attTemplate">
|
||||
</region-attributes>
|
||||
</region>
|
||||
<region name="rdistnoack">
|
||||
<region-attributes refid="attTemplate" scope="distributed-no-ack">
|
||||
</region-attributes>
|
||||
</region>
|
||||
<region name="rglobalreplication">
|
||||
<region-attributes refid="attTemplate" scope="global" data-policy="replicate">
|
||||
</region-attributes>
|
||||
</region>
|
||||
</region>
|
||||
</cache>
|
||||
10
src/test/resources/log4j.properties
Normal file
10
src/test/resources/log4j.properties
Normal file
@@ -0,0 +1,10 @@
|
||||
log4j.rootCategory=INFO, stdout
|
||||
|
||||
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
|
||||
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
|
||||
log4j.appender.stdout.layout.ConversionPattern=%d %p [%c] - <%m>%n
|
||||
|
||||
log4j.category.org.springframework.data.gemfire.listener=TRACE
|
||||
|
||||
# for debugging datasource initialization
|
||||
# log4j.category.test.jdbc=DEBUG
|
||||
@@ -33,7 +33,7 @@
|
||||
</bean>
|
||||
|
||||
<bean id="cache-with-xml" class="org.springframework.data.gemfire.CacheFactoryBean">
|
||||
<property name="cacheXml" value="classpath:cache.xml"/>
|
||||
<property name="cacheXml" value="classpath:gemfire-cache.xml"/>
|
||||
</bean>
|
||||
|
||||
<bean id="pdx-cache" class="org.springframework.data.gemfire.CacheFactoryBean">
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
<gfe:cache id="cache-with-name"/>
|
||||
|
||||
<gfe:cache id="cache-with-xml" cache-xml-location="classpath:cache.xml" properties-ref="props"/>
|
||||
<gfe:cache id="cache-with-xml" cache-xml-location="classpath:gemfire-cache.xml" properties-ref="props"/>
|
||||
|
||||
<util:properties id="props">
|
||||
<prop key="disable-tcp">false</prop>
|
||||
|
||||
Reference in New Issue
Block a user