use of com.bumptech.glide.load.engine.cache.DiskCache.Factory in project glide by bumptech.
the class ExternallyClearedDiskCacheTest method loadFromCache_afterDiskCacheDeleted_doesNotFail.
@Test
public void loadFromCache_afterDiskCacheDeleted_doesNotFail() {
final DiskCache cache = DiskLruCacheWrapper.create(cacheDir, 1024 * 1024);
cache.get(mock(Key.class));
deleteRecursively(cacheDir);
Glide.init(context, new GlideBuilder().setDiskCache(new Factory() {
@Override
public DiskCache build() {
return cache;
}
}));
Drawable drawable = concurrency.get(Glide.with(context).load(raw.canonical).submit());
assertThat(drawable).isNotNull();
}
use of com.bumptech.glide.load.engine.cache.DiskCache.Factory in project glide by bumptech.
the class ExternallyClearedDiskCacheTest method loadFromCache_afterDiskCacheDeletedAndCleared_doesNotFail.
@Test
public void loadFromCache_afterDiskCacheDeletedAndCleared_doesNotFail() {
final DiskCache cache = DiskLruCacheWrapper.create(cacheDir, 1024 * 1024);
cache.get(mock(Key.class));
deleteRecursively(cacheDir);
cache.clear();
Glide.init(context, new GlideBuilder().setDiskCache(new Factory() {
@Override
public DiskCache build() {
return cache;
}
}));
Drawable drawable = concurrency.get(Glide.with(context).load(ResourceIds.raw.canonical).submit());
assertThat(drawable).isNotNull();
}