mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
make DirectoryIndexLightTest more interesting: give files without id some parent hierarchy
GitOrigin-RevId: 73a43f294493007be8dac44767b6ae9a3ef3a8ae
This commit is contained in:
committed by
intellij-monorepo-bot
parent
2e39eb6e2c
commit
33d9645cc5
+15
-11
@@ -32,14 +32,27 @@ public class DirectoryIndexLightTest extends BasePlatformTestCase {
|
||||
}
|
||||
});
|
||||
|
||||
List<LightVirtualFile> filesWithoutId = Arrays.asList(new MyVirtualFile1(), new MyVirtualFile2(), new MyVirtualFile3());
|
||||
VirtualFile noId1 = new LightVirtualFile();
|
||||
VirtualFile noId2 = new LightVirtualFile() {
|
||||
@Override
|
||||
public VirtualFile getParent() {
|
||||
return noId1;
|
||||
}
|
||||
};
|
||||
VirtualFile noId3 = new LightVirtualFile() {
|
||||
@Override
|
||||
public VirtualFile getParent() {
|
||||
return noId2;
|
||||
}
|
||||
};
|
||||
List<VirtualFile> filesWithoutId = Arrays.asList(noId1, noId2, noId3);
|
||||
|
||||
ProjectFileIndex index = ProjectFileIndex.getInstance(getProject());
|
||||
|
||||
PlatformTestUtil.startPerformanceTest("Directory index query", 2500, () -> {
|
||||
for (int i = 0; i < 100; i++) {
|
||||
assertFalse(index.isInContent(fsRoot));
|
||||
for (LightVirtualFile file : filesWithoutId) {
|
||||
for (VirtualFile file : filesWithoutId) {
|
||||
assertFalse(file instanceof VirtualFileWithId);
|
||||
assertFalse(index.isInContent(file));
|
||||
assertFalse(index.isInSource(file));
|
||||
@@ -54,13 +67,4 @@ public class DirectoryIndexLightTest extends BasePlatformTestCase {
|
||||
}).reattemptUntilJitSettlesDown().assertTiming();
|
||||
}
|
||||
|
||||
private static class MyVirtualFile1 extends LightVirtualFile {
|
||||
}
|
||||
|
||||
private static class MyVirtualFile2 extends LightVirtualFile {
|
||||
}
|
||||
|
||||
private static class MyVirtualFile3 extends LightVirtualFile {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user