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.naming;
21
22 import static com.puppycrawl.tools.checkstyle.checks.naming.GoogleMethodNameCheck.MSG_KEY_FORMAT_REGULAR;
23 import static com.puppycrawl.tools.checkstyle.checks.naming.GoogleMethodNameCheck.MSG_KEY_FORMAT_TEST;
24 import static com.puppycrawl.tools.checkstyle.checks.naming.GoogleMethodNameCheck.MSG_KEY_UNDERSCORE_REGULAR;
25 import static com.puppycrawl.tools.checkstyle.checks.naming.GoogleMethodNameCheck.MSG_KEY_UNDERSCORE_TEST;
26
27 import org.junit.jupiter.api.Test;
28
29 import com.puppycrawl.tools.checkstyle.AbstractExamplesModuleTestSupport;
30
31 public class GoogleMethodNameCheckExamplesTest extends AbstractExamplesModuleTestSupport {
32
33 @Override
34 public String getPackageLocation() {
35 return "com/puppycrawl/tools/checkstyle/checks/naming/googlemethodname";
36 }
37
38 @Test
39 public void testExample1() throws Exception {
40 final String[] expected = {
41 "19:15: " + getCheckMessage(MSG_KEY_FORMAT_REGULAR, "Foo"),
42 "24:15: " + getCheckMessage(MSG_KEY_UNDERSCORE_REGULAR, "gradle_9_5_1"),
43 "44:15: " + getCheckMessage(MSG_KEY_UNDERSCORE_TEST, "test_1"),
44 "49:15: " + getCheckMessage(MSG_KEY_FORMAT_TEST, "test_Foo"),
45 };
46 verifyWithInlineConfigParser(getPath("Example1.java"), expected);
47 }
48
49 }