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.chapter5naming.rule528typevariablenames;
21
22 import java.util.Map;
23
24 import org.junit.jupiter.api.Test;
25
26 import com.google.checkstyle.test.base.AbstractGoogleModuleTestSupport;
27 import com.puppycrawl.tools.checkstyle.api.Configuration;
28
29 public class InterfaceTypeParameterNameTest extends AbstractGoogleModuleTestSupport {
30
31 private static final String MSG_KEY = "name.invalidPattern";
32
33 @Override
34 protected String getPackageLocation() {
35 return "com/google/checkstyle/test/chapter5naming/rule528typevariablenames";
36 }
37
38 @Test
39 public void testInterfaceDefault() throws Exception {
40 final Configuration configuration = getModuleConfig("InterfaceTypeParameterName");
41 final String format = configuration.getProperty("format");
42 final Map<String, String> messages = configuration.getMessages();
43
44 final String[] expected = {
45 "48:15: " + getCheckMessage(messages, MSG_KEY, "Input", format),
46 "76:25: " + getCheckMessage(messages, MSG_KEY, "Request", format),
47 "80:25: " + getCheckMessage(messages, MSG_KEY, "TRequest", format),
48 };
49
50 final String filePath = getPath("InputInterfaceTypeParameterName.java");
51
52 final Integer[] warnList = getLinesWithWarn(filePath);
53 verify(configuration, filePath, expected, warnList);
54 }
55
56 }