SGF-409 - Modify the GemfireDataSourcePostProcessor (basis for <gfe:datasource>) to not assume a GemFire Server was configured and bootstrapped with Spring and subsequently that the SDG ListRegionsOnServerFunction was registered.
Refactored the GemfireDataSourcePostProcessorTest class test cases based on the new implementation of the GemfireDataSourcePostProcessor BeanFactoryPostProcessor, which uses the GemFire internal GetRegionsFunction GemFire Function as a fallback when the ListRegionsOnServerFunction has not been registered or is not available. In addition, added 2 integration tests to test a Spring Data GemFire ClientCache connecting to a Spring-configured GemFire Server and non-Spring-configured GemFire Server asserting that client PROXY Region beans are appropriately created in the Spring ApplicationContext.
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0"?>
|
||||
<!DOCTYPE cache PUBLIC "-//GemStone Systems, Inc.//GemFire Declarative Caching 8.0//EN"
|
||||
"http://www.gemstone.com/dtd/cache8_0.dtd">
|
||||
<cache>
|
||||
<cache-server hostname-for-clients="localhost" port="42082"/>
|
||||
<region name="ServerRegion" refid="PARTITION"/>
|
||||
<region name="AnotherServerRegion" refid="REPLICATE"/>
|
||||
</cache>
|
||||
@@ -0,0 +1,31 @@
|
||||
<?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:gfe-data="http://www.springframework.org/schema/data/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/data/gemfire http://www.springframework.org/schema/data/gemfire/spring-data-gemfire.xsd
|
||||
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd
|
||||
">
|
||||
|
||||
<util:properties id="client.properties">
|
||||
<prop key="client.server.host">localhost</prop>
|
||||
<prop key="client.server.port">42082</prop>
|
||||
</util:properties>
|
||||
|
||||
<context:property-placeholder properties-ref="client.properties"/>
|
||||
|
||||
<gfe-data:datasource min-connections="1" max-connections="1">
|
||||
<gfe-data:server host="${client.server.host}" port="${client.server.port}"/>
|
||||
</gfe-data:datasource>
|
||||
|
||||
<gfe:client-region id="LocalRegion" shortcut="LOCAL"/>
|
||||
|
||||
<gfe:client-region id="ServerRegion" shortcut="CACHING_PROXY"/>
|
||||
|
||||
</beans>
|
||||
@@ -0,0 +1,36 @@
|
||||
<?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="server.properties">
|
||||
<prop key="gemfire.server.host">localhost</prop>
|
||||
<prop key="gemfire.server.port">42082</prop>
|
||||
</util:properties>
|
||||
|
||||
<context:property-placeholder properties-ref="server.properties"/>
|
||||
|
||||
<util:properties id="gemfireProperties">
|
||||
<prop key="name">GemFireDataSourceIntegrationTestServer</prop>
|
||||
<prop key="mcast-port">0</prop>
|
||||
<prop key="log-level">warning</prop>
|
||||
</util:properties>
|
||||
|
||||
<gfe:cache properties-ref="gemfireProperties"/>
|
||||
|
||||
<gfe:cache-server auto-startup="true" bind-address="${gemfire.server.host}" port="${gemfire.server.port}"
|
||||
max-connections="1"/>
|
||||
|
||||
<gfe:replicated-region id="ServerRegion" persistent="false"/>
|
||||
|
||||
<gfe:partitioned-region id="ExclusiveServerRegion" persistent="false"/>
|
||||
|
||||
</beans>
|
||||
@@ -0,0 +1,29 @@
|
||||
<?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:gfe-data="http://www.springframework.org/schema/data/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/data/gemfire http://www.springframework.org/schema/data/gemfire/spring-data-gemfire.xsd
|
||||
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd
|
||||
">
|
||||
|
||||
<util:properties id="client.properties">
|
||||
<prop key="client.server.host">localhost</prop>
|
||||
<prop key="client.server.port">42082</prop>
|
||||
</util:properties>
|
||||
|
||||
<context:property-placeholder properties-ref="client.properties"/>
|
||||
|
||||
<gfe-data:datasource min-connections="1" max-connections="1">
|
||||
<gfe-data:server host="${client.server.host}" port="${client.server.port}"/>
|
||||
</gfe-data:datasource>
|
||||
|
||||
<gfe:client-region id="LocalRegion" shortcut="LOCAL"/>
|
||||
|
||||
</beans>
|
||||
Reference in New Issue
Block a user