mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
try to find referenced member inside inner class if failed try enclosing (IDEADEV-40929)
This commit is contained in:
@@ -0,0 +1,116 @@
|
||||
package com.intellij.codeInsight.daemon;
|
||||
|
||||
import com.intellij.JavaTestUtil;
|
||||
import com.intellij.codeInspection.LocalInspectionTool;
|
||||
import com.intellij.codeInspection.javaDoc.JavaDocLocalInspection;
|
||||
import com.intellij.codeInspection.javaDoc.JavaDocReferenceInspection;
|
||||
import com.intellij.openapi.projectRoots.Sdk;
|
||||
import com.intellij.openapi.projectRoots.impl.JavaSdkImpl;
|
||||
import com.intellij.openapi.roots.LanguageLevelProjectExtension;
|
||||
import com.intellij.pom.java.LanguageLevel;
|
||||
import com.intellij.psi.JavaPsiFacade;
|
||||
|
||||
|
||||
public class JavadocHighlightingTest extends LightDaemonAnalyzerTestCase {
|
||||
private static final String BASE_PATH = "/codeInsight/daemonCodeAnalyzer/javaDoc";
|
||||
|
||||
@Override
|
||||
protected String getTestDataPath() {
|
||||
return JavaTestUtil.getJavaTestDataPath();
|
||||
}
|
||||
|
||||
protected LocalInspectionTool[] configureLocalInspectionTools() {
|
||||
return new LocalInspectionTool[]{
|
||||
new JavaDocLocalInspection(),
|
||||
new JavaDocReferenceInspection()
|
||||
};
|
||||
}
|
||||
|
||||
public void testJavadocPeriod() throws Exception {
|
||||
final JavaDocLocalInspection javaDocLocalInspection = new JavaDocLocalInspection();
|
||||
javaDocLocalInspection.IGNORE_JAVADOC_PERIOD = false;
|
||||
enableInspectionTool(javaDocLocalInspection);
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testJavadocPeriod1() throws Exception {
|
||||
final JavaDocLocalInspection javaDocLocalInspection = new JavaDocLocalInspection();
|
||||
javaDocLocalInspection.IGNORE_JAVADOC_PERIOD = false;
|
||||
enableInspectionTool(javaDocLocalInspection);
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testJavadocPeriod2() throws Exception {
|
||||
final JavaDocLocalInspection javaDocLocalInspection = new JavaDocLocalInspection();
|
||||
javaDocLocalInspection.IGNORE_JAVADOC_PERIOD = false;
|
||||
enableInspectionTool(javaDocLocalInspection);
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testInlineTagAsDescription() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testParam0() throws Exception { doTestWithLangLevel(LanguageLevel.HIGHEST); }
|
||||
public void testParam1() throws Exception { doTest(); }
|
||||
public void testParam2() throws Exception { doTest(); }
|
||||
public void testParam3() throws Exception { doTest(); }
|
||||
public void testParam4() throws Exception { doTest(); }
|
||||
public void testSee0() throws Exception { doTest(); }
|
||||
public void testSee1() throws Exception { doTest(); }
|
||||
public void testSee2() throws Exception { doTest(); }
|
||||
public void testSee3() throws Exception { doTest(); }
|
||||
public void testSee4() throws Exception { doTest(); }
|
||||
public void testSee5() throws Exception { doTest(); }
|
||||
public void testSee6() throws Exception {doTest();}
|
||||
public void testSeeConstants() throws Exception { doTest();}
|
||||
public void testReturn0() throws Exception { doTest(); }
|
||||
public void testException0() throws Exception { doTest(); }
|
||||
public void testException1() throws Exception { doTest(); }
|
||||
public void testException2() throws Exception { doTest(); }
|
||||
public void testException3() throws Exception { doTest(); }
|
||||
public void testException4() throws Exception { doTest(); }
|
||||
public void testMultipleThrows() throws Exception { doTest(); }
|
||||
public void testInheritJavaDoc() throws Exception {doTestWithLangLevel(LanguageLevel.JDK_1_3);}
|
||||
public void testLink0() throws Exception { doTest(); }
|
||||
public void testLinkFromInnerClassToSelfMethod() throws Exception {doTest();}
|
||||
|
||||
public void testValueBadReference() throws Exception { doTestWithLangLevel(LanguageLevel.HIGHEST); }
|
||||
public void testValueGoodReference() throws Exception { doTestWithLangLevel(LanguageLevel.HIGHEST); }
|
||||
public void testValueReference14() throws Exception { doTestWithLangLevel(LanguageLevel.JDK_1_4); }
|
||||
public void testValueEmpty() throws Exception { doTestWithLangLevel(LanguageLevel.JDK_1_4); }
|
||||
public void testValueNotOnField() throws Exception { doTestWithLangLevel(LanguageLevel.HIGHEST); }
|
||||
public void testValueNotOnStaticField() throws Exception { doTestWithLangLevel(LanguageLevel.HIGHEST); }
|
||||
public void testValueOnNotInitializedField() throws Exception { doTestWithLangLevel(LanguageLevel.HIGHEST); }
|
||||
|
||||
public void testUnknownInlineTag() throws Exception {doTest();}
|
||||
public void testUnknownTags() throws Exception {doTest();}
|
||||
|
||||
public void testVararg() throws Exception {doTest();}
|
||||
|
||||
public void testBadReference() throws Exception{
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testMissingReturnDescription() throws Exception {doTest();}
|
||||
|
||||
private void doTestWithLangLevel(final LanguageLevel langLevel) throws Exception {
|
||||
JavaPsiFacade manager = getJavaFacade();
|
||||
final LanguageLevel effectiveLanguageLevel = LanguageLevelProjectExtension.getInstance(manager.getProject()).getLanguageLevel();
|
||||
LanguageLevelProjectExtension.getInstance(manager.getProject()).setLanguageLevel(langLevel);
|
||||
try {
|
||||
doTest();
|
||||
}
|
||||
finally {
|
||||
LanguageLevelProjectExtension.getInstance(manager.getProject()).setLanguageLevel(effectiveLanguageLevel);
|
||||
}
|
||||
}
|
||||
|
||||
protected void doTest() throws Exception {
|
||||
super.doTest(BASE_PATH + "/" + getTestName(false) + ".java", true, false);
|
||||
}
|
||||
|
||||
protected Sdk getProjectJDK() {
|
||||
return JavaSdkImpl.getMockJdk15("java 1.5");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user