use of org.apache.ignite.internal.processors.cache.eviction.paged.TestObject in project ignite by apache.
the class ThinClientPermissionCheckTest method testCacheEntryEviction.
/**
* Tests that the eviction of a cache entry does not require any special permissions from the user who adds the
* entry.
*/
@Test
public void testCacheEntryEviction() throws Exception {
try (IgniteClient client = startClient(CLIENT_PUT)) {
ClientCache<Object, Object> cache = client.cache(EVICTION_TEST_CACHE);
int entrySize = 4 * (1 << 10);
int entriesCnt = 2 * EVICTION_TEST_DATA_REGION_SIZE / entrySize;
for (int i = 0; i < entriesCnt; i++) cache.put(i, new TestObject(entrySize / 4));
for (Ignite ignite : G.allGrids()) {
Set<Integer> insertedKeys = IntStream.range(0, entriesCnt).boxed().collect(Collectors.toSet());
assertTrue(ignite.cache(EVICTION_TEST_CACHE).getAll(insertedKeys).size() < entriesCnt);
}
}
}
Aggregations