Refactor jcache examples (#2620)

This commit is contained in:
Grzegorz Piwowarek
2017-09-14 11:02:05 +03:00
committed by GitHub
parent 8e7fc431a0
commit 556e8fa90b
4 changed files with 40 additions and 12 deletions
@@ -9,11 +9,14 @@ import javax.cache.configuration.FactoryBuilder;
import javax.cache.configuration.MutableConfiguration;
import javax.cache.spi.CachingProvider;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
public class CacheLoaderTest {
private static final String CACHE_NAME = "SimpleCache";
private Cache<Integer, String> cache;
@Before
@@ -25,6 +28,12 @@ public class CacheLoaderTest {
this.cache = cacheManager.createCache("SimpleCache", config);
}
@After
public void tearDown() {
Caching.getCachingProvider()
.getCacheManager().destroyCache(CACHE_NAME);
}
@Test
public void whenReadingFromStorage_thenCorrect() {
for (int i = 1; i < 4; i++) {