DATAGEODE-8 - Ensure locators and servers and configured correctly when using <gfe:pool> attributes.
Related JIRA: https://jira.spring.io/browse/SGF-628. (cherry picked from commit ffb8c704f0a785f6f441c871756fcc802fd5be81) Signed-off-by: John Blum <jblum@pivotal.io>
This commit is contained in:
@@ -507,7 +507,9 @@ public class PoolParserUnitTests {
|
||||
doAnswer(answer).when(mockRegistry).registerBeanDefinition(eq(generateBeanName(MethodInvokingBean.class)),
|
||||
any(BeanDefinition.class));
|
||||
|
||||
assertThat(parser.parseLocators(mockElement, mockRegistry)).isTrue();
|
||||
BeanDefinitionBuilder poolBuilder = BeanDefinitionBuilder.genericBeanDefinition();
|
||||
|
||||
assertThat(parser.parseLocators(mockElement, poolBuilder, mockRegistry)).isTrue();
|
||||
|
||||
verify(mockElement, times(1)).getAttribute(eq(PoolParser.ID_ATTRIBUTE));
|
||||
verify(mockElement, times(1)).getAttribute(eq(PoolParser.LOCATORS_ATTRIBUTE_NAME));
|
||||
@@ -557,7 +559,9 @@ public class PoolParserUnitTests {
|
||||
doAnswer(answer).when(mockRegistry).registerBeanDefinition(eq(generateBeanName(MethodInvokingBean.class)),
|
||||
any(BeanDefinition.class));
|
||||
|
||||
assertThat(parser.parseServers(mockElement, mockRegistry)).isTrue();
|
||||
BeanDefinitionBuilder poolBuilder = BeanDefinitionBuilder.genericBeanDefinition();
|
||||
|
||||
assertThat(parser.parseServers(mockElement, poolBuilder, mockRegistry)).isTrue();
|
||||
|
||||
verify(mockElement, times(1)).getAttribute(eq(PoolParser.ID_ATTRIBUTE));
|
||||
verify(mockElement, times(1)).getAttribute(eq(PoolParser.SERVERS_ATTRIBUTE_NAME));
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
">
|
||||
|
||||
<util:properties id="client.properties">
|
||||
<prop key="gemfire.cache.client.locator.host-and-port">localhost[11235]</prop>
|
||||
<prop key="gemfire.cache.client.pool.locator.hosts-and-ports">localhost[11235]</prop>
|
||||
</util:properties>
|
||||
|
||||
<context:property-placeholder properties-ref="client.properties"/>
|
||||
@@ -21,11 +21,12 @@
|
||||
<prop key="log-level">warning</prop>
|
||||
</util:properties>
|
||||
|
||||
<gfe:client-cache properties-ref="gemfireProperties" pool-name="locatorPool"/>
|
||||
|
||||
<gfe:pool id="locatorPool" locators="${gemfire.cache.client.locator.host-and-port}"/>
|
||||
<gfe:client-cache properties-ref="gemfireProperties"/>
|
||||
|
||||
<gfe:client-region id="Example" pool-name="locatorPool" shortcut="PROXY"
|
||||
key-constraint="java.lang.String" value-constraint="java.lang.Integer"/>
|
||||
|
||||
<!-- Keep the definition of this GemFire Pool bean after the Region (Example) that depends on it! -->
|
||||
<gfe:pool id="locatorPool" locators="${gemfire.cache.client.pool.locator.hosts-and-ports}"/>
|
||||
|
||||
</beans>
|
||||
|
||||
@@ -12,9 +12,9 @@
|
||||
">
|
||||
|
||||
<util:properties id="clientProperties">
|
||||
<prop key="gemfire.cache.client.server.hosts-and-ports">localhost[23579],localhost[23654]</prop>
|
||||
<prop key="gemfire.cache.client.server.host.3">localhost</prop>
|
||||
<prop key="gemfire.cache.client.server.port.3">24448</prop>
|
||||
<prop key="gemfire.cache.client.pool.server.hosts-and-ports">localhost[23579],localhost[23654]</prop>
|
||||
<prop key="gemfire.cache.client.pool.server.host">localhost</prop>
|
||||
<prop key="gemfire.cache.client.pool.server.port">24448</prop>
|
||||
</util:properties>
|
||||
|
||||
<context:property-placeholder properties-ref="clientProperties"/>
|
||||
@@ -25,11 +25,12 @@
|
||||
|
||||
<gfe:client-cache properties-ref="gemfireProperties" pool-name="serverPool"/>
|
||||
|
||||
<gfe:pool id="serverPool" servers="${gemfire.cache.client.server.hosts-and-ports}">
|
||||
<gfe:server host="${gemfire.cache.client.server.host.3}" port="${gemfire.cache.client.server.port.3}"/>
|
||||
</gfe:pool>
|
||||
|
||||
<gfe:client-region id="Example" pool-name="serverPool" shortcut="PROXY"
|
||||
key-constraint="java.lang.String" value-constraint="java.lang.Integer"/>
|
||||
|
||||
<!-- Keep the definition of this GemFire Pool bean after the Region (Example) that depends on it! -->
|
||||
<gfe:pool id="serverPool" servers="${gemfire.cache.client.pool.server.hosts-and-ports}">
|
||||
<gfe:server host="${gemfire.cache.client.pool.server.host}" port="${gemfire.cache.client.pool.server.port}"/>
|
||||
</gfe:pool>
|
||||
|
||||
</beans>
|
||||
|
||||
Reference in New Issue
Block a user