SGF-434 - Add a durable GemFire client cache test to assert proper behavior by SDG.
(cherry picked from commit b52a185) Signed-off-by: John Blum <jblum@pivotal.io>
This commit is contained in:
@@ -12,7 +12,7 @@
|
||||
<util:properties id="gemfireProperties">
|
||||
<prop key="name">BasicSubRegionConfig</prop>
|
||||
<prop key="mcast-port">0</prop>
|
||||
<prop key="log-level">config</prop>
|
||||
<prop key="log-level">warning</prop>
|
||||
</util:properties>
|
||||
|
||||
<gfe:cache properties-ref="gemfireProperties" use-bean-factory-locator="false"/>
|
||||
|
||||
@@ -0,0 +1,45 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||
xmlns:context="http://www.springframework.org/schema/context"
|
||||
xmlns:gfe="http://www.springframework.org/schema/gemfire"
|
||||
xmlns:util="http://www.springframework.org/schema/util"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="
|
||||
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
|
||||
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd
|
||||
http://www.springframework.org/schema/gemfire http://www.springframework.org/schema/gemfire/spring-gemfire.xsd
|
||||
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd
|
||||
">
|
||||
|
||||
<util:properties id="clientProperties">
|
||||
<prop key="gemfire.cache.client.server.host">localhost</prop>
|
||||
<prop key="gemfire.cache.client.server.port">24842</prop>
|
||||
</util:properties>
|
||||
|
||||
<context:property-placeholder properties-ref="clientProperties"/>
|
||||
|
||||
<bean class="org.springframework.data.gemfire.client.DurableClientCacheIntegrationTest$ClientCacheBeanPostProcessor"/>
|
||||
|
||||
<util:properties id="gemfireProperties">
|
||||
<prop key="durable-client-id">DurableClientCacheIntegrationTestClientId</prop>
|
||||
<prop key="durable-client-timeout">300</prop>
|
||||
<prop key="log-level">warning</prop>
|
||||
<prop key="mcast-port">0</prop>
|
||||
<prop key="name">DurableClientCacheIntegrationTestClient</prop>
|
||||
</util:properties>
|
||||
|
||||
<gfe:pool id="gemfireServerPool" keep-alive="true" subscription-enabled="true">
|
||||
<gfe:server host="${gemfire.cache.client.server.host}" port="${gemfire.cache.client.server.port}"/>
|
||||
</gfe:pool>
|
||||
|
||||
<gfe:client-cache properties-ref="gemfireProperties" keep-alive="true" pool-name="gemfireServerPool" ready-for-events="true"
|
||||
use-bean-factory-locator="false"/>
|
||||
|
||||
<gfe:client-region id="Example" pool-name="gemfireServerPool" shortcut="CACHING_PROXY">
|
||||
<gfe:cache-listener>
|
||||
<bean class="org.springframework.data.gemfire.client.DurableClientCacheIntegrationTest.RegionEntryEventRecordingCacheListener"/>
|
||||
</gfe:cache-listener>
|
||||
<gfe:regex-interest durable="true" pattern= ".*" result-policy="${gemfire.cache.client.interests.result-policy:KEYS_VALUES}"/>
|
||||
</gfe:client-region>
|
||||
|
||||
</beans>
|
||||
@@ -0,0 +1,50 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||
xmlns:c="http://www.springframework.org/schema/c"
|
||||
xmlns:context="http://www.springframework.org/schema/context"
|
||||
xmlns:gfe="http://www.springframework.org/schema/gemfire"
|
||||
xmlns:p="http://www.springframework.org/schema/p"
|
||||
xmlns:util="http://www.springframework.org/schema/util"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="
|
||||
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
|
||||
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd
|
||||
http://www.springframework.org/schema/gemfire http://www.springframework.org/schema/gemfire/spring-gemfire.xsd
|
||||
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd
|
||||
">
|
||||
|
||||
<util:properties id="serverProperties">
|
||||
<prop key="gemfire.cache.server.host">localhost</prop>
|
||||
<prop key="gemfire.cache.server.port">24842</prop>
|
||||
</util:properties>
|
||||
|
||||
<context:property-placeholder properties-ref="serverProperties"/>
|
||||
|
||||
<util:properties id="gemfireProperties">
|
||||
<prop key="name">DurableClientCacheIntegrationTestServer</prop>
|
||||
<prop key="mcast-port">0</prop>
|
||||
<prop key="log-level">warning</prop>
|
||||
</util:properties>
|
||||
|
||||
<gfe:cache properties-ref="gemfireProperties"/>
|
||||
|
||||
<gfe:cache-server bind-address="${gemfire.cache.server.host}" port="${gemfire.cache.server.port}" auto-startup="true"/>
|
||||
|
||||
<gfe:replicated-region id="Example" persistent="false" initial-capacity="11" load-factor="0.75"
|
||||
key-constraint="java.lang.String" value-constraint="java.lang.Integer"/>
|
||||
|
||||
<!-- The GemfireTemplate bean definition is required to trigger the creation of the actual '/Example' Region bean
|
||||
by the SDG RegionFactoryBean in order for the RegionDataLoadingBeanPostProcessor callback to initialize
|
||||
the '/Example' Region with data. -->
|
||||
<bean class="org.springframework.data.gemfire.GemfireTemplate" p:region-ref="Example"/>
|
||||
|
||||
<util:map id="exampleRegionData" key-type="java.lang.String" value-type="java.lang.Integer">
|
||||
<entry key="one" value="1"/>
|
||||
<entry key="two" value="2"/>
|
||||
<entry key="three" value="3"/>
|
||||
</util:map>
|
||||
|
||||
<bean class="org.springframework.data.gemfire.client.DurableClientCacheIntegrationTest$RegionDataLoadingBeanPostProcessor"
|
||||
c:regionName="Example" p:regionData-ref="exampleRegionData"/>
|
||||
|
||||
</beans>
|
||||
@@ -0,0 +1,29 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||
xmlns:gfe="http://www.springframework.org/schema/gemfire"
|
||||
xmlns:util="http://www.springframework.org/schema/util"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="
|
||||
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
|
||||
http://www.springframework.org/schema/gemfire http://www.springframework.org/schema/gemfire/spring-gemfire.xsd
|
||||
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd
|
||||
">
|
||||
|
||||
<util:properties id="gemfireProperties">
|
||||
<prop key="name">ClientCacheNamespaceTest</prop>
|
||||
<prop key="mcast-port">0</prop>
|
||||
<prop key="log-level">warning</prop>
|
||||
</util:properties>
|
||||
|
||||
<gfe:pool id="serverPool">
|
||||
<gfe:server host="localhost" port="1234"/>
|
||||
</gfe:pool>
|
||||
|
||||
<bean id="reflectionPdxSerializer" class="com.gemstone.gemfire.pdx.ReflectionBasedAutoSerializer"/>
|
||||
|
||||
<gfe:client-cache cache-xml-location="/path/to/bogus/cache.xml" properties-ref="gemfireProperties" lazy-init="true"
|
||||
copy-on-read="true" critical-heap-percentage="0.85" eviction-heap-percentage="0.65"
|
||||
pdx-serializer-ref="reflectionPdxSerializer" pdx-ignore-unread-fields="true" pdx-persistent="false"
|
||||
pdx-read-serialized="true" keep-alive="true" pool-name="serverPool" ready-for-events="false"/>
|
||||
|
||||
</beans>
|
||||
Reference in New Issue
Block a user