1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20 package com.puppycrawl.tools.checkstyle.checks.javadoc;
21
22 import static com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocParamOrderCheck.MSG_KEY;
23
24 import org.junit.jupiter.api.Test;
25
26 import com.puppycrawl.tools.checkstyle.AbstractModuleTestSupport;
27 import com.puppycrawl.tools.checkstyle.utils.CommonUtil;
28
29 public class JavadocParamOrderCheckTest extends AbstractModuleTestSupport {
30
31 @Override
32 public String getPackageLocation() {
33 return "com/puppycrawl/tools/checkstyle/checks/javadoc/javadocparamorder";
34 }
35
36 @Test
37 public void testParamOrder() throws Exception {
38 final String[] expected = {
39 "17:8: " + getCheckMessage(MSG_KEY, "p1"),
40 "18:8: " + getCheckMessage(MSG_KEY, "<T>"),
41 "65:8: " + getCheckMessage(MSG_KEY, "a"),
42 "76:8: " + getCheckMessage(MSG_KEY, "<K>"),
43 "87:8: " + getCheckMessage(MSG_KEY, "<T>"),
44 "99:12: " + getCheckMessage(MSG_KEY, "name"),
45 "111:8: " + getCheckMessage(MSG_KEY, "<T>"),
46 "112:8: " + getCheckMessage(MSG_KEY, "p1"),
47 };
48
49 verifyWithInlineConfigParser(
50 getPath("InputJavadocParamOrder.java"), expected);
51 }
52
53 @Test
54 public void testParamOrderSupplemental() throws Exception {
55 final String[] expected = CommonUtil.EMPTY_STRING_ARRAY;
56
57 verifyWithInlineConfigParser(
58 getPath("InputJavadocParamOrderSupplemental.java"), expected);
59 }
60
61 @Test
62 public void testCompactSource() throws Exception {
63 final String[] expected = {
64 "14:4: " + getCheckMessage(MSG_KEY, "name"),
65 };
66
67 verifyWithInlineConfigParser(
68 getNonCompilablePath("compact/InputJavadocParamOrderCompact.java"),
69 expected);
70 }
71
72 }