use of org.apache.geode.internal.cache.ha.HAContainerRegion in project geode by apache.
the class CacheClientNotifierDUnitTest method checkCacheServer.
private void checkCacheServer(VM vm, final int serverPort, final boolean withCSC, final int capacity) {
SerializableRunnable checkCacheServer = new SerializableRunnable() {
@Override
public void run() throws Exception {
List<CacheServer> cacheServers = ((GemFireCacheImpl) cache).getCacheServersAndGatewayReceiver();
CacheServerImpl server = null;
for (CacheServer cs : cacheServers) {
if (cs.getPort() == serverPort) {
server = (CacheServerImpl) cs;
break;
}
}
assertNotNull(server);
CacheClientNotifier ccn = server.getAcceptor().getCacheClientNotifier();
HAContainerRegion haContainer = (HAContainerRegion) ccn.getHaContainer();
if (server.getAcceptor().isGatewayReceiver()) {
assertNull(haContainer);
return;
}
Region internalRegion = haContainer.getMapForTest();
RegionAttributes ra = internalRegion.getAttributes();
EvictionAttributes ea = ra.getEvictionAttributes();
if (withCSC) {
assertNotNull(ea);
assertEquals(capacity, ea.getMaximum());
assertEquals(EvictionAction.OVERFLOW_TO_DISK, ea.getAction());
} else {
assertNull(ea);
}
}
};
vm.invoke(checkCacheServer);
}
Aggregations