mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
projectview tests fixed
This commit is contained in:
+4
-1
@@ -41,7 +41,10 @@ public class PackageViewLibrariesNode extends ProjectViewNode<LibrariesElement>{
|
||||
}
|
||||
|
||||
public boolean contains(@NotNull final VirtualFile file) {
|
||||
return someChildContainsFile(file);
|
||||
ProjectFileIndex index = ProjectRootManager.getInstance(getProject()).getFileIndex();
|
||||
if (!index.isInLibrarySource(file) && !index.isInLibraryClasses(file)) return false;
|
||||
|
||||
return someChildContainsFile(file, false);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
|
||||
@@ -130,11 +130,10 @@ public abstract class ProjectViewNode <Value> extends AbstractTreeNode<Value> im
|
||||
|
||||
public boolean someChildContainsFile(final VirtualFile file, boolean optimizeByCheckingFileRootsFirst) {
|
||||
VirtualFile parent = file.getParent();
|
||||
if (parent == null) return false;
|
||||
|
||||
boolean mayContain = false;
|
||||
|
||||
if (optimizeByCheckingFileRootsFirst) {
|
||||
if (optimizeByCheckingFileRootsFirst && parent != null) {
|
||||
Collection<VirtualFile> roots = getRoots();
|
||||
for (VirtualFile eachRoot : roots) {
|
||||
if (parent.equals(eachRoot.getParent())) {
|
||||
|
||||
@@ -83,7 +83,7 @@ public abstract class ModuleGroupNode extends ProjectViewNode<ModuleGroup> imple
|
||||
}
|
||||
|
||||
public boolean contains(@NotNull VirtualFile file) {
|
||||
return someChildContainsFile(file);
|
||||
return someChildContainsFile(file, false);
|
||||
}
|
||||
|
||||
public void update(PresentationData presentation) {
|
||||
|
||||
@@ -78,6 +78,9 @@ public class ProjectViewTestUtil {
|
||||
boolean actual = eachNode.contains(eachFile);
|
||||
boolean expected = map.get(eachFile).contains(eachNode);
|
||||
if (actual != expected) {
|
||||
boolean actual1 = eachNode.contains(eachFile);
|
||||
boolean expected1 = map.get(eachFile).contains(eachNode);
|
||||
|
||||
Assert.assertTrue("file=" + eachFile + " node=" + eachNode.getTestPresentation() + " expected:" + expected, false);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user