use of org.cache2k.core.ExceptionWrapper in project cache2k by cache2k.
the class BasicCacheOperationsTest method getEntryState_Exception.
@Test
public void getEntryState_Exception() {
if (!(cache instanceof InternalCache)) {
return;
}
((Cache) cache).put(KEY, new ExceptionWrapper(OUCH));
InternalCache c = (InternalCache) cache;
String s = c.getEntryState(KEY);
assertTrue(s.contains("exception="));
}
use of org.cache2k.core.ExceptionWrapper in project cache2k by cache2k.
the class BasicCacheOperationsTest method peekAndPut_Exception.
@Test(expected = CacheLoaderException.class)
public void peekAndPut_Exception() {
((Cache) cache).put(KEY, new ExceptionWrapper(OUCH));
cache.peekAndPut(KEY, VALUE);
}
use of org.cache2k.core.ExceptionWrapper in project cache2k by cache2k.
the class BasicCacheOperationsTest method peekEntry_Exception.
@Test
public void peekEntry_Exception() {
((Cache) cache).put(KEY, new ExceptionWrapper(OUCH));
CacheEntry<Integer, Integer> e = cache.peekEntry(KEY);
assertEquals(KEY, e.getKey());
entryHasException(e);
assertEquals(OUCH, e.getException());
}
Aggregations