1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20 package com.google.checkstyle.test.chapter7javadoc.rule711generalform;
21
22 import org.junit.jupiter.api.Test;
23
24 import com.google.checkstyle.test.base.AbstractGoogleModuleTestSupport;
25 import com.puppycrawl.tools.checkstyle.api.Configuration;
26 import com.puppycrawl.tools.checkstyle.checks.javadoc.SingleLineJavadocCheck;
27
28 public class SingleLineJavadocTest extends AbstractGoogleModuleTestSupport {
29
30 @Override
31 protected String getPackageLocation() {
32 return "com/google/checkstyle/test/chapter7javadoc/rule711generalform";
33 }
34
35 @Test
36 public void testSingleLineJavadoc() throws Exception {
37 final String msg = getCheckMessage(SingleLineJavadocCheck.class, "singleline.javadoc");
38
39 final String[] expected = {
40 "13: " + msg,
41 "29: " + msg,
42 "35: " + msg,
43 "41: " + msg,
44 };
45
46 final Configuration checkConfig = getModuleConfig("SingleLineJavadoc");
47 final String filePath = getPath("InputSingleLineJavadocCheck.java");
48
49 final Integer[] warnList = getLinesWithWarn(filePath);
50 verify(checkConfig, filePath, expected, warnList);
51 }
52
53 }