102103104105106107108109110111
cm.setAllowNullValues(true); Cache cache1y = cm.getCache("c1"); cache1y.put("key3", null); assertNull(cache1y.get("key3").get()); cache1y.evict("key3"); assertNull(cache1y.get("key3")); } }
105106107108109110111112113114115
Cache target = new ConcurrentMapCache("testCache"); Cache cache = new TransactionAwareCacheDecorator(target); Object key = new Object(); cache.put(key, "123"); cache.evict(key); assertNull(target.get(key)); } @Test public void evictTransactional() {
119120121122123124125126127128129
cache.put(key, "123"); TransactionStatus status = txManager.getTransaction(new DefaultTransactionAttribute( TransactionDefinition.PROPAGATION_REQUIRED)); cache.evict(key); assertEquals("123", target.get(key, String.class)); txManager.commit(status); assertNull(target.get(key)); }
106107108109110111112113114115116
cm.setAllowNullValues(true); Cache cache1y = cm.getCache("c1"); cache1y.put("key3", null); assertNull(cache1y.get("key3").get()); cache1y.evict("key3"); assertNull(cache1y.get("key3")); } @Test public void changeCacheSpecificationRecreateCache() {