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

(cherry picked from commit 2d2dca163323d557aed3791d2d1f9a9ed23f01ed)
Signed-off-by: John Blum <jblum@pivotal.io>
This commit is contained in:
John Blum
2016-05-17 12:11:59 -07:00
parent b4ecdf2cc1
commit 3f84baa378
3 changed files with 58 additions and 60 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)));
}
}