import junit.framework.TestCase;
import org.fjank.jcache.CacheSweeper;
public class Bug1037611 extends TestCase {
public void testResetCache() throws Exception {
CacheAccessFactory factory = CacheAccessFactory.getInstance();
CacheAttributes catt = CacheAttributes.getDefaultCacheAttributes();
catt.setLocal();
catt.setCleanInterval(1);
Cache cache = factory.getCache(false);
//
cache.init(catt);
// CacheSweeper.startSweeper executes
// within CacheSweeper.getInstance
//
CacheSweeper instance = CacheSweeper.getInstance();
cache.close();
// CacheSweeper.stopSweeper executes
//
cache = factory.getCache(false);
//
cache.init(catt);
CacheSweeper instance2= CacheSweeper.getInstance();
assertNotSame(instance, instance2);
// CacheSweeper.startSweeper does not