View Javadoc
1   ////////////////////////////////////////////////////////////////////////////////
2   // checkstyle: Checks Java source code for adherence to a set of rules.
3   // Copyright (C) 2001-2017 the original author or authors.
4   //
5   // This library is free software; you can redistribute it and/or
6   // modify it under the terms of the GNU Lesser General Public
7   // License as published by the Free Software Foundation; either
8   // version 2.1 of the License, or (at your option) any later version.
9   //
10  // This library is distributed in the hope that it will be useful,
11  // but WITHOUT ANY WARRANTY; without even the implied warranty of
12  // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13  // Lesser General Public License for more details.
14  //
15  // You should have received a copy of the GNU Lesser General Public
16  // License along with this library; if not, write to the Free Software
17  // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
18  ////////////////////////////////////////////////////////////////////////////////
19  
20  package com.puppycrawl.tools.checkstyle.checks.coding;
21  
22  import static com.puppycrawl.tools.checkstyle.checks.coding.HiddenFieldCheck.MSG_KEY;
23  
24  import org.junit.Assert;
25  import org.junit.Test;
26  
27  import com.puppycrawl.tools.checkstyle.AbstractModuleTestSupport;
28  import com.puppycrawl.tools.checkstyle.DefaultConfiguration;
29  import com.puppycrawl.tools.checkstyle.utils.CommonUtils;
30  
31  public class HiddenFieldCheckTest
32      extends AbstractModuleTestSupport {
33      @Override
34      protected String getPackageLocation() {
35          return "com/puppycrawl/tools/checkstyle/checks/coding/hiddenfield";
36      }
37  
38      @Test
39      public void testStaticVisibilityFromLambdas() throws Exception {
40          final DefaultConfiguration checkConfig =
41              createModuleConfig(HiddenFieldCheck.class);
42          final String[] expected = {
43              "19:34: " + getCheckMessage(MSG_KEY, "value"),
44              "51:31: " + getCheckMessage(MSG_KEY, "languageCode"),
45              "60:35: " + getCheckMessage(MSG_KEY, "number"),
46              "73:35: " + getCheckMessage(MSG_KEY, "id"),
47              "101:33: " + getCheckMessage(MSG_KEY, "note"),
48              "126:57: " + getCheckMessage(MSG_KEY, "stringValue"),
49              "126:78: " + getCheckMessage(MSG_KEY, "intValue"),
50              "137:74: " + getCheckMessage(MSG_KEY, "doubleValue"),
51              "149:51: " + getCheckMessage(MSG_KEY, "firstString"),
52              "149:64: " + getCheckMessage(MSG_KEY, "secondString"),
53              "165:49: " + getCheckMessage(MSG_KEY, "first"),
54              "191:62: " + getCheckMessage(MSG_KEY, "mPi"),
55              "207:27: " + getCheckMessage(MSG_KEY, "justSomeList"),
56              "207:61: " + getCheckMessage(MSG_KEY, "justSomeMap"),
57              "219:55: " + getCheckMessage(MSG_KEY, "someObject"),
58              "227:52: " + getCheckMessage(MSG_KEY, "someObject"),
59          };
60          verify(checkConfig, getPath("InputHiddenFieldLambdas.java"), expected);
61      }
62  
63      @Test
64      public void testStaticVisibilityFromAnonymousClasses() throws Exception {
65          final DefaultConfiguration checkConfig =
66              createModuleConfig(HiddenFieldCheck.class);
67          final String[] expected = {
68              "10:97: " + getCheckMessage(MSG_KEY, "other"),
69              "16:94: " + getCheckMessage(MSG_KEY, "other"),
70              "24:101: " + getCheckMessage(MSG_KEY, "other"),
71              "34:105: " + getCheckMessage(MSG_KEY, "other"),
72              "46:26: " + getCheckMessage(MSG_KEY, "someField"),
73          };
74          verify(checkConfig, getPath("InputHiddenFieldStaticVisibility.java"), expected);
75      }
76  
77      @Test
78      public void testNoParameters()
79              throws Exception {
80          final DefaultConfiguration checkConfig =
81              createModuleConfig(HiddenFieldCheck.class);
82          checkConfig.addAttribute("tokens", "VARIABLE_DEF");
83          final String[] expected = {
84              "18:13: " + getCheckMessage(MSG_KEY, "hidden"),
85              "27:13: " + getCheckMessage(MSG_KEY, "hidden"),
86              "32:18: " + getCheckMessage(MSG_KEY, "hidden"),
87              "46:17: " + getCheckMessage(MSG_KEY, "innerHidden"),
88              "55:17: " + getCheckMessage(MSG_KEY, "innerHidden"),
89              "56:17: " + getCheckMessage(MSG_KEY, "hidden"),
90              "61:22: " + getCheckMessage(MSG_KEY, "innerHidden"),
91              "64:22: " + getCheckMessage(MSG_KEY, "hidden"),
92              "76:17: " + getCheckMessage(MSG_KEY, "innerHidden"),
93              "77:17: " + getCheckMessage(MSG_KEY, "hidden"),
94              "82:13: " + getCheckMessage(MSG_KEY, "hidden"),
95              "138:13: " + getCheckMessage(MSG_KEY, "hidden"),
96              "143:13: " + getCheckMessage(MSG_KEY, "hidden"),
97              "148:13: " + getCheckMessage(MSG_KEY, "hidden"),
98              "152:13: " + getCheckMessage(MSG_KEY, "hidden"),
99              "200:17: " + getCheckMessage(MSG_KEY, "hidden"),
100             "217:13: " + getCheckMessage(MSG_KEY, "hidden"),
101             "223:13: " + getCheckMessage(MSG_KEY, "hiddenStatic"),
102         };
103         verify(checkConfig, getPath("InputHiddenField.java"), expected);
104     }
105 
106     @Test
107     public void testDefault()
108             throws Exception {
109         final DefaultConfiguration checkConfig =
110             createModuleConfig(HiddenFieldCheck.class);
111         final String[] expected = {
112             "18:13: " + getCheckMessage(MSG_KEY, "hidden"),
113             "21:33: " + getCheckMessage(MSG_KEY, "hidden"),
114             "27:13: " + getCheckMessage(MSG_KEY, "hidden"),
115             "32:18: " + getCheckMessage(MSG_KEY, "hidden"),
116             "36:33: " + getCheckMessage(MSG_KEY, "hidden"),
117             "46:17: " + getCheckMessage(MSG_KEY, "innerHidden"),
118             "49:26: " + getCheckMessage(MSG_KEY, "innerHidden"),
119             "55:17: " + getCheckMessage(MSG_KEY, "innerHidden"),
120             "56:17: " + getCheckMessage(MSG_KEY, "hidden"),
121             "61:22: " + getCheckMessage(MSG_KEY, "innerHidden"),
122             "64:22: " + getCheckMessage(MSG_KEY, "hidden"),
123             "69:17: " + getCheckMessage(MSG_KEY, "innerHidden"),
124             "70:17: " + getCheckMessage(MSG_KEY, "hidden"),
125             "76:17: " + getCheckMessage(MSG_KEY, "innerHidden"),
126             "77:17: " + getCheckMessage(MSG_KEY, "hidden"),
127             "82:13: " + getCheckMessage(MSG_KEY, "hidden"),
128             "100:29: " + getCheckMessage(MSG_KEY, "prop"),
129             "106:29: " + getCheckMessage(MSG_KEY, "prop"),
130             "112:29: " + getCheckMessage(MSG_KEY, "prop"),
131             "124:28: " + getCheckMessage(MSG_KEY, "prop"),
132             "138:13: " + getCheckMessage(MSG_KEY, "hidden"),
133             "143:13: " + getCheckMessage(MSG_KEY, "hidden"),
134             "148:13: " + getCheckMessage(MSG_KEY, "hidden"),
135             "152:13: " + getCheckMessage(MSG_KEY, "hidden"),
136             "179:23: " + getCheckMessage(MSG_KEY, "y"),
137             "200:17: " + getCheckMessage(MSG_KEY, "hidden"),
138             "210:20: " + getCheckMessage(MSG_KEY, "hidden"),
139             "217:13: " + getCheckMessage(MSG_KEY, "hidden"),
140             "223:13: " + getCheckMessage(MSG_KEY, "hiddenStatic"),
141             "230:41: " + getCheckMessage(MSG_KEY, "x"),
142             "236:30: " + getCheckMessage(MSG_KEY, "xAxis"),
143             "253:40: " + getCheckMessage(MSG_KEY, "prop"),
144             "267:29: " + getCheckMessage(MSG_KEY, "prop"),
145             "278:41: " + getCheckMessage(MSG_KEY, "prop2"),
146             "290:19: " + getCheckMessage(MSG_KEY, "i"),
147         };
148         verify(checkConfig, getPath("InputHiddenField.java"), expected);
149     }
150 
151     /** Tests ignoreFormat property. */
152     @Test
153     public void testIgnoreFormat()
154             throws Exception {
155         final DefaultConfiguration checkConfig =
156             createModuleConfig(HiddenFieldCheck.class);
157         checkConfig.addAttribute("ignoreFormat", "^i.*$");
158         Assert.assertNotNull("Ignore format should not be null",
159                 checkConfig.getAttribute("ignoreFormat"));
160         final String[] expected = {
161             "18:13: " + getCheckMessage(MSG_KEY, "hidden"),
162             "21:33: " + getCheckMessage(MSG_KEY, "hidden"),
163             "27:13: " + getCheckMessage(MSG_KEY, "hidden"),
164             "32:18: " + getCheckMessage(MSG_KEY, "hidden"),
165             "36:33: " + getCheckMessage(MSG_KEY, "hidden"),
166             "56:17: " + getCheckMessage(MSG_KEY, "hidden"),
167             "64:22: " + getCheckMessage(MSG_KEY, "hidden"),
168             "70:17: " + getCheckMessage(MSG_KEY, "hidden"),
169             "77:17: " + getCheckMessage(MSG_KEY, "hidden"),
170             "82:13: " + getCheckMessage(MSG_KEY, "hidden"),
171             "100:29: " + getCheckMessage(MSG_KEY, "prop"),
172             "106:29: " + getCheckMessage(MSG_KEY, "prop"),
173             "112:29: " + getCheckMessage(MSG_KEY, "prop"),
174             "124:28: " + getCheckMessage(MSG_KEY, "prop"),
175             "138:13: " + getCheckMessage(MSG_KEY, "hidden"),
176             "143:13: " + getCheckMessage(MSG_KEY, "hidden"),
177             "148:13: " + getCheckMessage(MSG_KEY, "hidden"),
178             "152:13: " + getCheckMessage(MSG_KEY, "hidden"),
179             "179:23: " + getCheckMessage(MSG_KEY, "y"),
180             "200:17: " + getCheckMessage(MSG_KEY, "hidden"),
181             "210:20: " + getCheckMessage(MSG_KEY, "hidden"),
182             "217:13: " + getCheckMessage(MSG_KEY, "hidden"),
183             "223:13: " + getCheckMessage(MSG_KEY, "hiddenStatic"),
184             "230:41: " + getCheckMessage(MSG_KEY, "x"),
185             "236:30: " + getCheckMessage(MSG_KEY, "xAxis"),
186             "253:40: " + getCheckMessage(MSG_KEY, "prop"),
187             "267:29: " + getCheckMessage(MSG_KEY, "prop"),
188             "278:41: " + getCheckMessage(MSG_KEY, "prop2"),
189         };
190         verify(checkConfig, getPath("InputHiddenField.java"), expected);
191     }
192 
193     /** Tests ignoreSetter property. */
194     @Test
195     public void testIgnoreSetter()
196             throws Exception {
197         final DefaultConfiguration checkConfig =
198             createModuleConfig(HiddenFieldCheck.class);
199         checkConfig.addAttribute("ignoreSetter", "true");
200         final String[] expected = {
201             "18:13: " + getCheckMessage(MSG_KEY, "hidden"),
202             "21:33: " + getCheckMessage(MSG_KEY, "hidden"),
203             "27:13: " + getCheckMessage(MSG_KEY, "hidden"),
204             "32:18: " + getCheckMessage(MSG_KEY, "hidden"),
205             "36:33: " + getCheckMessage(MSG_KEY, "hidden"),
206             "46:17: " + getCheckMessage(MSG_KEY, "innerHidden"),
207             "49:26: " + getCheckMessage(MSG_KEY, "innerHidden"),
208             "55:17: " + getCheckMessage(MSG_KEY, "innerHidden"),
209             "56:17: " + getCheckMessage(MSG_KEY, "hidden"),
210             "61:22: " + getCheckMessage(MSG_KEY, "innerHidden"),
211             "64:22: " + getCheckMessage(MSG_KEY, "hidden"),
212             "69:17: " + getCheckMessage(MSG_KEY, "innerHidden"),
213             "70:17: " + getCheckMessage(MSG_KEY, "hidden"),
214             "76:17: " + getCheckMessage(MSG_KEY, "innerHidden"),
215             "77:17: " + getCheckMessage(MSG_KEY, "hidden"),
216             "82:13: " + getCheckMessage(MSG_KEY, "hidden"),
217             "106:29: " + getCheckMessage(MSG_KEY, "prop"),
218             "112:29: " + getCheckMessage(MSG_KEY, "prop"),
219             "124:28: " + getCheckMessage(MSG_KEY, "prop"),
220             "138:13: " + getCheckMessage(MSG_KEY, "hidden"),
221             "143:13: " + getCheckMessage(MSG_KEY, "hidden"),
222             "148:13: " + getCheckMessage(MSG_KEY, "hidden"),
223             "152:13: " + getCheckMessage(MSG_KEY, "hidden"),
224             "179:23: " + getCheckMessage(MSG_KEY, "y"),
225             "200:17: " + getCheckMessage(MSG_KEY, "hidden"),
226             "210:20: " + getCheckMessage(MSG_KEY, "hidden"),
227             "217:13: " + getCheckMessage(MSG_KEY, "hidden"),
228             "223:13: " + getCheckMessage(MSG_KEY, "hiddenStatic"),
229             "230:41: " + getCheckMessage(MSG_KEY, "x"),
230             "253:40: " + getCheckMessage(MSG_KEY, "prop"),
231             "278:41: " + getCheckMessage(MSG_KEY, "prop2"),
232         };
233         verify(checkConfig, getPath("InputHiddenField.java"), expected);
234     }
235 
236     /** Tests ignoreSetter and setterCanReturnItsClass properties. */
237     @Test
238     public void testIgnoreChainSetter()
239             throws Exception {
240         final DefaultConfiguration checkConfig =
241             createModuleConfig(HiddenFieldCheck.class);
242         checkConfig.addAttribute("ignoreSetter", "true");
243         checkConfig.addAttribute("setterCanReturnItsClass", "true");
244         final String[] expected = {
245             "18:13: " + getCheckMessage(MSG_KEY, "hidden"),
246             "21:33: " + getCheckMessage(MSG_KEY, "hidden"),
247             "27:13: " + getCheckMessage(MSG_KEY, "hidden"),
248             "32:18: " + getCheckMessage(MSG_KEY, "hidden"),
249             "36:33: " + getCheckMessage(MSG_KEY, "hidden"),
250             "46:17: " + getCheckMessage(MSG_KEY, "innerHidden"),
251             "49:26: " + getCheckMessage(MSG_KEY, "innerHidden"),
252             "55:17: " + getCheckMessage(MSG_KEY, "innerHidden"),
253             "56:17: " + getCheckMessage(MSG_KEY, "hidden"),
254             "61:22: " + getCheckMessage(MSG_KEY, "innerHidden"),
255             "64:22: " + getCheckMessage(MSG_KEY, "hidden"),
256             "69:17: " + getCheckMessage(MSG_KEY, "innerHidden"),
257             "70:17: " + getCheckMessage(MSG_KEY, "hidden"),
258             "76:17: " + getCheckMessage(MSG_KEY, "innerHidden"),
259             "77:17: " + getCheckMessage(MSG_KEY, "hidden"),
260             "82:13: " + getCheckMessage(MSG_KEY, "hidden"),
261             "106:29: " + getCheckMessage(MSG_KEY, "prop"),
262             "112:29: " + getCheckMessage(MSG_KEY, "prop"),
263             "124:28: " + getCheckMessage(MSG_KEY, "prop"),
264             "138:13: " + getCheckMessage(MSG_KEY, "hidden"),
265             "143:13: " + getCheckMessage(MSG_KEY, "hidden"),
266             "148:13: " + getCheckMessage(MSG_KEY, "hidden"),
267             "152:13: " + getCheckMessage(MSG_KEY, "hidden"),
268             "179:23: " + getCheckMessage(MSG_KEY, "y"),
269             "200:17: " + getCheckMessage(MSG_KEY, "hidden"),
270             "210:20: " + getCheckMessage(MSG_KEY, "hidden"),
271             "217:13: " + getCheckMessage(MSG_KEY, "hidden"),
272             "223:13: " + getCheckMessage(MSG_KEY, "hiddenStatic"),
273             "230:41: " + getCheckMessage(MSG_KEY, "x"),
274         };
275         verify(checkConfig, getPath("InputHiddenField.java"), expected);
276     }
277 
278     /** Tests ignoreConstructorParameter property. */
279     @Test
280     public void testIgnoreConstructorParameter()
281             throws Exception {
282         final DefaultConfiguration checkConfig =
283             createModuleConfig(HiddenFieldCheck.class);
284         checkConfig.addAttribute("ignoreConstructorParameter", "true");
285         final String[] expected = {
286             "18:13: " + getCheckMessage(MSG_KEY, "hidden"),
287             "27:13: " + getCheckMessage(MSG_KEY, "hidden"),
288             "32:18: " + getCheckMessage(MSG_KEY, "hidden"),
289             "36:33: " + getCheckMessage(MSG_KEY, "hidden"),
290             "46:17: " + getCheckMessage(MSG_KEY, "innerHidden"),
291             "55:17: " + getCheckMessage(MSG_KEY, "innerHidden"),
292             "56:17: " + getCheckMessage(MSG_KEY, "hidden"),
293             "61:22: " + getCheckMessage(MSG_KEY, "innerHidden"),
294             "64:22: " + getCheckMessage(MSG_KEY, "hidden"),
295             "69:17: " + getCheckMessage(MSG_KEY, "innerHidden"),
296             "70:17: " + getCheckMessage(MSG_KEY, "hidden"),
297             "76:17: " + getCheckMessage(MSG_KEY, "innerHidden"),
298             "77:17: " + getCheckMessage(MSG_KEY, "hidden"),
299             "82:13: " + getCheckMessage(MSG_KEY, "hidden"),
300             "100:29: " + getCheckMessage(MSG_KEY, "prop"),
301             "106:29: " + getCheckMessage(MSG_KEY, "prop"),
302             "112:29: " + getCheckMessage(MSG_KEY, "prop"),
303             "124:28: " + getCheckMessage(MSG_KEY, "prop"),
304             "138:13: " + getCheckMessage(MSG_KEY, "hidden"),
305             "143:13: " + getCheckMessage(MSG_KEY, "hidden"),
306             "148:13: " + getCheckMessage(MSG_KEY, "hidden"),
307             "152:13: " + getCheckMessage(MSG_KEY, "hidden"),
308             "179:23: " + getCheckMessage(MSG_KEY, "y"),
309             "200:17: " + getCheckMessage(MSG_KEY, "hidden"),
310             "217:13: " + getCheckMessage(MSG_KEY, "hidden"),
311             "223:13: " + getCheckMessage(MSG_KEY, "hiddenStatic"),
312             "230:41: " + getCheckMessage(MSG_KEY, "x"),
313             "236:30: " + getCheckMessage(MSG_KEY, "xAxis"),
314             "253:40: " + getCheckMessage(MSG_KEY, "prop"),
315             "267:29: " + getCheckMessage(MSG_KEY, "prop"),
316             "278:41: " + getCheckMessage(MSG_KEY, "prop2"),
317             "290:19: " + getCheckMessage(MSG_KEY, "i"),
318         };
319         verify(checkConfig, getPath("InputHiddenField.java"), expected);
320     }
321 
322     /** Test against a class with field declarations in different order. */
323     @Test
324     public void testReordered()
325             throws Exception {
326         final DefaultConfiguration checkConfig =
327             createModuleConfig(HiddenFieldCheck.class);
328         final String[] expected = {
329             "18:13: " + getCheckMessage(MSG_KEY, "hidden"),
330             "21:40: " + getCheckMessage(MSG_KEY, "hidden"),
331             "27:13: " + getCheckMessage(MSG_KEY, "hidden"),
332             "32:18: " + getCheckMessage(MSG_KEY, "hidden"),
333             "36:33: " + getCheckMessage(MSG_KEY, "hidden"),
334             "46:17: " + getCheckMessage(MSG_KEY, "innerHidden"),
335             "49:26: " + getCheckMessage(MSG_KEY, "innerHidden"),
336             "55:17: " + getCheckMessage(MSG_KEY, "innerHidden"),
337             "56:17: " + getCheckMessage(MSG_KEY, "hidden"),
338             "61:22: " + getCheckMessage(MSG_KEY, "innerHidden"),
339             "64:22: " + getCheckMessage(MSG_KEY, "hidden"),
340             "69:17: " + getCheckMessage(MSG_KEY, "innerHidden"),
341             "70:17: " + getCheckMessage(MSG_KEY, "hidden"),
342             "76:17: " + getCheckMessage(MSG_KEY, "innerHidden"),
343             "77:17: " + getCheckMessage(MSG_KEY, "hidden"),
344             "83:13: " + getCheckMessage(MSG_KEY, "hidden"),
345             "105:17: " + getCheckMessage(MSG_KEY, "hidden"),
346             "118:21: " + getCheckMessage(MSG_KEY, "hidden"),
347             "125:13: " + getCheckMessage(MSG_KEY, "hidden"),
348             "131:13: " + getCheckMessage(MSG_KEY, "hiddenStatic"),
349         };
350         verify(checkConfig, getPath("InputHiddenFieldReorder.java"), expected);
351     }
352 
353     @Test
354     public void testIgnoreAbstractMethods() throws Exception {
355         final DefaultConfiguration checkConfig =
356             createModuleConfig(HiddenFieldCheck.class);
357         checkConfig.addAttribute("ignoreAbstractMethods", "true");
358 
359         final String[] expected = {
360             "18:13: " + getCheckMessage(MSG_KEY, "hidden"),
361             "21:33: " + getCheckMessage(MSG_KEY, "hidden"),
362             "27:13: " + getCheckMessage(MSG_KEY, "hidden"),
363             "32:18: " + getCheckMessage(MSG_KEY, "hidden"),
364             "36:33: " + getCheckMessage(MSG_KEY, "hidden"),
365             "46:17: " + getCheckMessage(MSG_KEY, "innerHidden"),
366             "49:26: " + getCheckMessage(MSG_KEY, "innerHidden"),
367             "55:17: " + getCheckMessage(MSG_KEY, "innerHidden"),
368             "56:17: " + getCheckMessage(MSG_KEY, "hidden"),
369             "61:22: " + getCheckMessage(MSG_KEY, "innerHidden"),
370             "64:22: " + getCheckMessage(MSG_KEY, "hidden"),
371             "69:17: " + getCheckMessage(MSG_KEY, "innerHidden"),
372             "70:17: " + getCheckMessage(MSG_KEY, "hidden"),
373             "76:17: " + getCheckMessage(MSG_KEY, "innerHidden"),
374             "77:17: " + getCheckMessage(MSG_KEY, "hidden"),
375             "82:13: " + getCheckMessage(MSG_KEY, "hidden"),
376             "100:29: " + getCheckMessage(MSG_KEY, "prop"),
377             "106:29: " + getCheckMessage(MSG_KEY, "prop"),
378             "112:29: " + getCheckMessage(MSG_KEY, "prop"),
379             "124:28: " + getCheckMessage(MSG_KEY, "prop"),
380             "138:13: " + getCheckMessage(MSG_KEY, "hidden"),
381             "143:13: " + getCheckMessage(MSG_KEY, "hidden"),
382             "148:13: " + getCheckMessage(MSG_KEY, "hidden"),
383             "152:13: " + getCheckMessage(MSG_KEY, "hidden"),
384             "179:23: " + getCheckMessage(MSG_KEY, "y"),
385             "200:17: " + getCheckMessage(MSG_KEY, "hidden"),
386             "210:20: " + getCheckMessage(MSG_KEY, "hidden"),
387             "217:13: " + getCheckMessage(MSG_KEY, "hidden"),
388             "223:13: " + getCheckMessage(MSG_KEY, "hiddenStatic"),
389             "236:30: " + getCheckMessage(MSG_KEY, "xAxis"),
390             "253:40: " + getCheckMessage(MSG_KEY, "prop"),
391             "267:29: " + getCheckMessage(MSG_KEY, "prop"),
392             "278:41: " + getCheckMessage(MSG_KEY, "prop2"),
393             "290:19: " + getCheckMessage(MSG_KEY, "i"),
394         };
395         verify(checkConfig, getPath("InputHiddenField.java"), expected);
396     }
397 
398     @Test
399     public void testReceiverParameter() throws Exception {
400         final DefaultConfiguration checkConfig = createModuleConfig(HiddenFieldCheck.class);
401         final String[] expected = CommonUtils.EMPTY_STRING_ARRAY;
402         verify(checkConfig, getPath("InputHiddenFieldReceiver.java"), expected);
403     }
404 }