mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
test depends on the first 17 classes in annotations.jar? Really?
This commit is contained in:
@@ -7,7 +7,7 @@ public class ProjectTreeStructureTest extends BaseProjectViewTestCase {
|
||||
@Override
|
||||
protected void setUp() throws Exception {
|
||||
super.setUp();
|
||||
myPrintInfo = new Queryable.PrintInfo(new String[]{"className", "fileName", "fieldName", "methodName", "packageName"});
|
||||
myPrintInfo = new Queryable.PrintInfo();
|
||||
}
|
||||
|
||||
public void test1() {
|
||||
@@ -33,24 +33,6 @@ public class ProjectTreeStructureTest extends BaseProjectViewTestCase {
|
||||
" Form1.form\n" +
|
||||
" Form2.form\n");
|
||||
|
||||
assertStructureEqual("Project\n" +
|
||||
" External Libraries\n" +
|
||||
" Library: < java 1.7 >\n" +
|
||||
" annotations.jar\n" +
|
||||
" META-INF\n" +
|
||||
" MANIFEST.MF\n" +
|
||||
" classpath.index\n" +
|
||||
" org\n" +
|
||||
" intellij\n" +
|
||||
" lang\n" +
|
||||
" annotations\n" +
|
||||
" Identifier\n" +
|
||||
" Language\n" +
|
||||
" Pattern\n" +
|
||||
" PrintFormat\n" +
|
||||
" PrintFormatPattern\n" +
|
||||
" RegExp\n");
|
||||
|
||||
getProjectTreeStructure().setProviders();
|
||||
|
||||
assertStructureEqual(getPackageDirectory(),
|
||||
@@ -62,23 +44,6 @@ public class ProjectTreeStructureTest extends BaseProjectViewTestCase {
|
||||
" Form1.java\n" +
|
||||
" Form2.form\n");
|
||||
|
||||
assertStructureEqual("Project\n" +
|
||||
" External Libraries\n" +
|
||||
" Library: < java 1.7 >\n" +
|
||||
" annotations.jar\n" +
|
||||
" META-INF\n" +
|
||||
" MANIFEST.MF\n" +
|
||||
" classpath.index\n" +
|
||||
" org\n" +
|
||||
" intellij\n" +
|
||||
" lang\n" +
|
||||
" annotations\n" +
|
||||
" Identifier.class\n" +
|
||||
" Language.class\n" +
|
||||
" Pattern.class\n" +
|
||||
" PrintFormat.class\n" +
|
||||
" PrintFormatPattern.class\n" +
|
||||
" RegExp.class\n");
|
||||
}
|
||||
|
||||
public void testShowClassMembers() {
|
||||
|
||||
@@ -31,7 +31,7 @@ import com.intellij.openapi.util.Disposer;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.intellij.psi.PsiDirectory;
|
||||
import com.intellij.psi.PsiElement;
|
||||
import com.intellij.testFramework.IdeaTestUtil;
|
||||
import com.intellij.testFramework.PlatformTestUtil;
|
||||
import com.intellij.testFramework.ProjectViewTestUtil;
|
||||
import com.intellij.testFramework.TestSourceBasedTestCase;
|
||||
import com.intellij.util.Function;
|
||||
@@ -112,10 +112,6 @@ public abstract class BaseProjectViewTestCase extends TestSourceBasedTestCase {
|
||||
return (AbstractProjectTreeStructure)myStructure;
|
||||
}
|
||||
|
||||
protected void assertStructureEqual(@NonNls String expected) {
|
||||
assertStructureEqual(myStructure.getRootElement(), expected);
|
||||
}
|
||||
|
||||
protected void assertStructureEqual(String expected, Comparator comparator) {
|
||||
assertStructureEqual(myStructure.getRootElement(), expected, 27, comparator);
|
||||
}
|
||||
@@ -123,16 +119,12 @@ public abstract class BaseProjectViewTestCase extends TestSourceBasedTestCase {
|
||||
private void assertStructureEqual(PsiDirectory root, String expected, int maxRowCount, AbstractTreeStructure structure) {
|
||||
assertNotNull(root);
|
||||
PsiDirectoryNode rootNode = new PsiDirectoryNode(myProject, root, (ViewSettings)structure);
|
||||
assertStructureEqual(rootNode, expected, maxRowCount, IdeaTestUtil.createComparator(myPrintInfo));
|
||||
}
|
||||
|
||||
private void assertStructureEqual(Object rootNode, String expected) {
|
||||
assertStructureEqual(rootNode, expected, 17, IdeaTestUtil.createComparator(myPrintInfo));
|
||||
assertStructureEqual(rootNode, expected, maxRowCount, PlatformTestUtil.createComparator(myPrintInfo));
|
||||
}
|
||||
|
||||
private void assertStructureEqual(Object rootNode, String expected, int maxRowCount, Comparator comparator) {
|
||||
checkGetParentConsistency(rootNode);
|
||||
StringBuffer actual = IdeaTestUtil.print(myStructure, rootNode, 0, comparator, maxRowCount, ' ', myPrintInfo);
|
||||
StringBuffer actual = PlatformTestUtil.print(myStructure, rootNode, 0, comparator, maxRowCount, ' ', myPrintInfo);
|
||||
assertEquals(expected, actual.toString());
|
||||
}
|
||||
|
||||
@@ -185,7 +177,7 @@ public abstract class BaseProjectViewTestCase extends TestSourceBasedTestCase {
|
||||
}
|
||||
|
||||
protected static void assertListsEqual(ListModel model, String expected) {
|
||||
assertEquals(expected, IdeaTestUtil.print(model));
|
||||
assertEquals(expected, PlatformTestUtil.print(model));
|
||||
}
|
||||
|
||||
public static void checkContainsMethod(final Object rootElement, final AbstractTreeStructure structure) {
|
||||
|
||||
@@ -26,8 +26,8 @@ public interface Queryable {
|
||||
void putInfo(@NotNull Map<String, String> info);
|
||||
|
||||
class PrintInfo {
|
||||
String[] myIdKeys;
|
||||
String[] myInfoKeys;
|
||||
private final String[] myIdKeys;
|
||||
private final String[] myInfoKeys;
|
||||
|
||||
public PrintInfo() {
|
||||
this(null, null);
|
||||
@@ -57,13 +57,13 @@ public interface Queryable {
|
||||
|
||||
String id = null;
|
||||
|
||||
String[] names = print.myIdKeys != null ? print.myIdKeys : new String[] {"name"};
|
||||
for (String eachKey : names) {
|
||||
String eachValue = map.get(eachKey);
|
||||
if (eachValue != null) {
|
||||
id = eachValue;
|
||||
}
|
||||
}
|
||||
//String[] names = print.myIdKeys != null ? print.myIdKeys : new String[] {"name"};
|
||||
//for (String eachKey : names) {
|
||||
// String eachValue = map.get(eachKey);
|
||||
// if (eachValue != null) {
|
||||
// id = eachValue;
|
||||
// }
|
||||
//}
|
||||
|
||||
if (!map.isEmpty()) {
|
||||
id = map.values().iterator().next();
|
||||
|
||||
@@ -1029,7 +1029,7 @@ public abstract class PsiFileImpl extends ElementBase implements PsiFileEx, PsiF
|
||||
}
|
||||
|
||||
@Override
|
||||
public void putInfo(Map<String, String> info) {
|
||||
public void putInfo(@NotNull Map<String, String> info) {
|
||||
putInfo(this, info);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user