use of com.android.tools.idea.res.ResourceFolderRepositoryFileCacheImpl.PruneTask in project android by JetBrains.
the class ResourceFolderRepositoryFileCacheTest method testPruneResourceCachesInProject.
public void testPruneResourceCachesInProject() throws IOException {
ResourceFolderRepositoryFileCache cache = ResourceFolderRepositoryFileCacheService.get();
VirtualFile resourceDir = getResourceDir();
File resourceCacheDir = cache.getResourceDir(getProject(), resourceDir);
assertNotNull(resourceCacheDir);
FileUtil.ensureExists(resourceCacheDir);
// Add a dummy directories alongside the real cache directory.
File dummyDirectory = new File(resourceCacheDir.getParent(), "dummyResDirCache");
FileUtil.ensureExists(dummyDirectory);
assertTrue(dummyDirectory.exists());
// Now prune.
PruneTask pruneTask = new PruneTask(getProject());
pruneTask.performInDumbMode(new MockProgressIndicator());
assertFalse(dummyDirectory.exists());
assertTrue(resourceCacheDir.exists());
}
Aggregations