summaryrefslogtreecommitdiff
path: root/java/java-tests/testSrc/com/intellij/codeInspection/JavaDocInspectionTest.java
blob: 30802e8a6da35956511ec0d8cb143ecf77dcc6dc (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
package com.intellij.codeInspection;

import com.intellij.JavaTestUtil;
import com.intellij.codeInspection.javaDoc.JavaDocLocalInspection;
import com.intellij.testFramework.InspectionTestCase;

public class JavaDocInspectionTest extends InspectionTestCase {
  @Override
  protected String getTestDataPath() {
    return JavaTestUtil.getJavaTestDataPath() + "/inspection";
  }

  private void doTest() throws Exception {
    doTest("javaDocInspection/" + getTestName(true),  new JavaDocLocalInspection());
  }

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

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

  // tests for duplicate class tags
  public void testDuplicateDeprecated() throws Exception {
    doTest();
  }

  // tests for duplicate field tags
  public void testDuplicateSerial() throws Exception {
    doTest();
  }

  public void testDuplicateThrows() throws Exception {
    JavaDocLocalInspection tool = new JavaDocLocalInspection();
    tool.setIgnoreDuplicatedThrows(false);
    doTest("javaDocInspection/" + getTestName(true), tool);
  }

  //inherited javadoc
  public void testMissedTags() throws Exception {
    doTest();
  }

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

  public void testMissedThrowsTag() throws Exception {
    final JavaDocLocalInspection localInspection = new JavaDocLocalInspection();
    localInspection.METHOD_OPTIONS.ACCESS_JAVADOC_REQUIRED_FOR = "package";
    doTest("javaDocInspection/" + getTestName(true), localInspection);
  }

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

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

  public void testEnumConstructor() throws Exception {
    final JavaDocLocalInspection localInspection = new JavaDocLocalInspection();
    localInspection.METHOD_OPTIONS.ACCESS_JAVADOC_REQUIRED_FOR = "package";
    doTest("javaDocInspection/" + getTestName(true), localInspection);
  }

  public void testIgnoreDuplicateThrows() throws Exception {
    final JavaDocLocalInspection inspection = new JavaDocLocalInspection();
    doTest("javaDocInspection/" + getTestName(true), inspection);
  }

  public void testIgnoreAccessors() throws Exception {
    final JavaDocLocalInspection inspection = new JavaDocLocalInspection();
    inspection.setIgnoreSimpleAccessors(true);
    doTest("javaDocInspection/" + getTestName(true), inspection);
  }

  public void testPackageInfo() throws Exception {
    final JavaDocLocalInspection inspection = new JavaDocLocalInspection();
    inspection.IGNORE_DEPRECATED = true;
    inspection.setPackageOption("public", "@author");
    doTest("javaDocInspection/" + getTestName(true), inspection);
  }
}