<?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/geode"
	   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/geode http://www.springframework.org/schema/geode/spring-geode.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.durable-client-id">DurableClientCacheIntegrationTest</prop>
		<prop key="gemfire.cache.client.durable-client-timeout">
			${org.springframework.data.gemfire.client.DurableClientCacheIntegrationTest.durable-client-timeout:300}
		</prop>
		<prop key="gemfire.cache.client.interests.result-policy">
			${org.springframework.data.gemfire.client.DurableClientCacheIntegrationTest.interests-result-policy:KEYS_VALUES}
		</prop>
		<prop key="gemfire.cache.server.host">localhost</prop>
		<prop key="gemfire.cache.server.port">
			${org.springframework.data.gemfire.client.DurableClientCacheIntegrationTest.cache-server-port}
		</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">TestDurableClientId</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:client-cache properties-ref="gemfireProperties" durable-client-id="${gemfire.cache.client.durable-client-id}"
					  durable-client-timeout="${gemfire.cache.client.durable-client-timeout}"
					  keep-alive="true" ready-for-events="true"/>

	<gfe:pool id="gemfireServerPool" keep-alive="true" subscription-enabled="true">
		<gfe:server host="${gemfire.cache.server.host}" port="${gemfire.cache.server.port}"/>
	</gfe:pool>

	<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}"/>
	</gfe:client-region>

</beans>
