SGF-497 - Change Pool reference from GemFire's DEFAULT Pool to the gemfireServerPool in the BeanPostProcessor when checking the pending event count.

This commit is contained in:
John Blum
2016-05-17 12:11:59 -07:00
parent 9e61270cd5
commit 2d2dca1633
2 changed files with 6 additions and 6 deletions

View File

@@ -61,6 +61,7 @@ import com.gemstone.gemfire.cache.Region;
import com.gemstone.gemfire.cache.client.ClientCache;
import com.gemstone.gemfire.cache.client.ClientCacheFactory;
import com.gemstone.gemfire.cache.client.ClientRegionShortcut;
import com.gemstone.gemfire.cache.client.Pool;
import com.gemstone.gemfire.cache.util.CacheListenerAdapter;
/**
@@ -263,17 +264,17 @@ public class DurableClientCacheIntegrationTest extends AbstractGemFireClientServ
@Override
public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException {
if (bean instanceof ClientCache) {
ClientCache clientCache = (ClientCache) bean;
if (bean instanceof Pool && "gemfireServerPool".equals(beanName)) {
Pool gemfireServerPool = (Pool) bean;
if (isBeforeDirtiesContext()) {
// NOTE: A value of -2 indicates the client connected to the server for the first time...
assertThat(clientCache.getDefaultPool().getPendingEventCount(), is(equalTo(-2)));
assertThat(gemfireServerPool.getPendingEventCount(), is(equalTo(-2)));
}
else {
// NOTE: the pending event count could be 3 because it should minimally include the 2 puts
// from the client cache producer and possibly a "marker" as well...
assertThat(clientCache.getDefaultPool().getPendingEventCount(), is(greaterThanOrEqualTo(2)));
assertThat(gemfireServerPool.getPendingEventCount(), is(greaterThanOrEqualTo(2)));
}
}

View File

@@ -37,8 +37,7 @@
<prop key="name">DurableClientCacheIntegrationTestClient</prop>
</util:properties>
<gfe:client-cache properties-ref="gemfireProperties" pool-name="gemfireServerPool"
durable-client-id="${gemfire.cache.client.durable-client-id}"
<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"/>