use of org.apache.geode.internal.cache.TestObjectSizerImpl in project geode by apache.
the class RegionManagementDUnitTest method createDiskRegion.
private void createDiskRegion(final VM memberVM) {
memberVM.invoke("createDiskRegion", () -> {
AttributesFactory factory = new AttributesFactory();
factory.setScope(Scope.LOCAL);
factory.setEvictionAttributes(EvictionAttributes.createLRUMemoryAttributes(20, new TestObjectSizerImpl(), EvictionAction.LOCAL_DESTROY));
Region region = getCache_tmp().createRegion(REGION_NAME, factory.create());
LRUStatistics lruStats = ((AbstractRegion) region).getEvictionController().getLRUHelper().getStats();
assertThat(lruStats).isNotNull();
RegionMXBean regionMXBean = getManagementService_tmp().getLocalRegionMBean(REGION_PATH);
assertThat(regionMXBean).isNotNull();
int total;
for (total = 0; total < 100; total++) {
// TODO: why so many?
int[] array = new int[250];
array[0] = total;
region.put(new Integer(total), array);
}
assertThat(regionMXBean.getEntrySize()).isGreaterThan(0);
});
}
Aggregations