mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
cleanPersistentContent only for tested file
This commit is contained in:
+9
-1
@@ -1314,6 +1314,11 @@ public class PersistentFSImpl extends PersistentFS implements ApplicationCompone
|
||||
return FSRecords.getName(id);
|
||||
}
|
||||
|
||||
@TestOnly
|
||||
public void cleanPersistedContent(int id) {
|
||||
doCleanPersistedContent(id);
|
||||
}
|
||||
|
||||
@TestOnly
|
||||
public void cleanPersistedContents() {
|
||||
int[] roots = FSRecords.listRoots();
|
||||
@@ -1329,10 +1334,13 @@ public class PersistentFSImpl extends PersistentFS implements ApplicationCompone
|
||||
}
|
||||
}
|
||||
else {
|
||||
setFlag(id, MUST_RELOAD_CONTENT, true);
|
||||
doCleanPersistedContent(id);
|
||||
}
|
||||
}
|
||||
|
||||
private static void doCleanPersistedContent(int id) {
|
||||
setFlag(id, MUST_RELOAD_CONTENT, true);
|
||||
}
|
||||
|
||||
private static class FsRoot extends VirtualDirectoryImpl {
|
||||
private final String myName;
|
||||
|
||||
+1
-1
@@ -336,7 +336,7 @@ public class LocalFileSystemTest extends BareTestFixtureTestCase {
|
||||
assertEquals(5, virtualFile.getLength());
|
||||
|
||||
FileUtil.writeToFile(file, "new content");
|
||||
((PersistentFSImpl)PersistentFS.getInstance()).cleanPersistedContents();
|
||||
((PersistentFSImpl)PersistentFS.getInstance()).cleanPersistedContent(((VirtualFileWithId)virtualFile).getId());
|
||||
s = VfsUtilCore.loadText(virtualFile);
|
||||
assertEquals("new content", s);
|
||||
assertEquals(11, virtualFile.getLength());
|
||||
|
||||
Reference in New Issue
Block a user