summaryrefslogtreecommitdiff
path: root/java/java-tests/testSrc/com/intellij/codeInsight/daemon/JavadocHighlightingTest.java
blob: 0c561dfdace5cc385894ce2a1720c0ee4e1b4112 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
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.roots.LanguageLevelProjectExtension;
import com.intellij.pom.java.LanguageLevel;
import org.jetbrains.annotations.NotNull;


public class JavadocHighlightingTest extends LightDaemonAnalyzerTestCase {
  private static final String BASE_PATH = "/codeInsight/daemonCodeAnalyzer/javaDoc";

  @NotNull
  @Override
  protected String getTestDataPath() {
    return JavaTestUtil.getJavaTestDataPath();
  }

  @NotNull
  @Override
  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 { 
    final JavaDocLocalInspection javaDocLocalInspection = new JavaDocLocalInspection();
    javaDocLocalInspection.METHOD_OPTIONS.ACCESS_JAVADOC_REQUIRED_FOR = "package";
    enableInspectionTool(javaDocLocalInspection);
    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 testBadCharacters() throws Exception { doTest(); }

  public void testVararg() throws Exception { doTest(); }

  public void testInnerClassReferenceInSignature() throws Exception { doTest(); }

  public void testBadReference() throws Exception { doTest(); }

  public void testMissingReturnDescription() throws Exception { doTest(); }

  private void doTestWithLangLevel(final LanguageLevel langLevel) throws Exception {
    LanguageLevelProjectExtension.getInstance(getProject()).setLanguageLevel(langLevel);
    doTest();
  }

  protected void doTest() throws Exception {
    super.doTest(BASE_PATH + "/" + getTestName(false) + ".java", true, false);
  }
}