dataContainer.containsKey(key));
}
}
}
DummyInMemoryStore store = (DummyInMemoryStore) TestingUtil.getFirstLoader(cache(0, TEST_CACHE_NAME));
for (int i = 0; i < NUM_KEYS; i++) {
String key = "key" + i;
assertTrue("Key " + key + " is missing from the shared store", store.keySet().contains(key));
}
log.debugf("Invalidations: %s, L1 invalidations: %s", invalidationCounts, l1InvalidationCounts);
int joinerSize = advancedCache(joiner, TEST_CACHE_NAME).getDataContainer().size();
if (preload) {
// The joiner has preloaded the entire store, and the entries not owned have been invalidated
assertEquals(0, getCounter(l1InvalidationCounts, joiner));
assertEquals(NUM_KEYS - joinerSize, getCounter(invalidationCounts, joiner));
// No invalidations on the other nodes (using InvalidateCommands)
assertEquals(NUM_KEYS - joinerSize, getSum(invalidationCounts));
} else {
assertEquals(0, getCounter(l1InvalidationCounts, joiner));
assertEquals(0, getCounter(invalidationCounts, joiner));
assertEquals(0, getSum(invalidationCounts));
}
if (joiner > 0) {
// The entries that have moved to the joiner are invalidated on the previous owners
// using an InvalidateL1Command, which does not write to the shared store
assertEquals(joinerSize, getSum(l1InvalidationCounts));
}
// Reset stats for the next check
store.clearStats();
invalidationCounts.clear();
l1InvalidationCounts.clear();
}