@Override public boolean containsKey(K k) { return cache.containsKey(k); }
@Override public boolean containsKey(K key) { return cache.containsKey(key); }
@Override public boolean containsKey(K key) { return cache.containsKey(key); }
@TimeStep public void timeStep(BaseThreadState state) { int key = state.randomInt(keyCount); if (!cache.containsKey(key)) { cache.put(key, 0, expiryPolicy); } }
@Verify(global = true) public void globalVerify() { sleepSeconds(61); // provoke expire after TTL for (int i = 0; i < keyCount; i++) { cache.containsKey(i); } assertTrueEventually(new AssertTask() { @Override public void run() throws Exception { int cacheSize = cache.size(); logger.info(name + " ICache size: " + cacheSize); assertEquals(name + " ICache should be empty, but TTL events are not processed", 0, cacheSize); } }); } }
System.out.println("Put value \"value1\" with key \"key1\""); System.out.println("Cache contains key \"key1\": " + cache.containsKey("key1"));
if (!cache.containsKey(i)) { System.out.println("cache does not contains key: " + i);
@Verify public void globalVerify() { Counter totalCounter = new Counter(); for (Counter counter : results) { totalCounter.add(counter); } logger.info(name + " " + totalCounter + " from " + results.size() + " worker Threads"); for (int i = 0; i < keyCount; i++) { assertFalse(name + " ICache should not contain key " + i, cache.containsKey(i)); } assertFalse(name + " ICache iterator should not have elements", cache.iterator().hasNext()); assertEquals(name + " ICache size should be 0", 0, cache.size()); } }