1 19 20 import javax.util.jcache.Cache; 21 import javax.util.jcache.CacheAccessFactory; 22 import javax.util.jcache.CacheAttributes; 23 import junit.framework.TestCase; 24 import org.fjank.jcache.CacheSweeper; 25 26 public class Bug1037611 extends TestCase { 27 public void testResetCache() throws Exception { 28 CacheAccessFactory factory = CacheAccessFactory.getInstance(); 29 CacheAttributes catt = CacheAttributes.getDefaultCacheAttributes(); 30 catt.setLocal(); 31 catt.setCleanInterval(1); 32 Cache cache = factory.getCache(false); 33 cache.init(catt); 35 CacheSweeper instance = CacheSweeper.getInstance(); 39 40 cache.close(); 41 cache = factory.getCache(false); 44 cache.init(catt); 46 CacheSweeper instance2= CacheSweeper.getInstance(); 47 assertNotSame(instance, instance2); 48 } 52 } | Popular Tags |