01: package com.puppycrawl.tools.checkstyle.checks.whitespace;
02:
03: import com.puppycrawl.tools.checkstyle.BaseCheckTestCase;
04: import com.puppycrawl.tools.checkstyle.DefaultConfiguration;
05:
06: public class TypecastParenPadCheckTest extends BaseCheckTestCase {
07: public void testDefault() throws Exception {
08: final DefaultConfiguration checkConfig = createCheckConfig(TypecastParenPadCheck.class);
09: final String[] expected = {
10: "89:14: '(' is followed by whitespace.",
11: "89:21: ')' is preceded with whitespace.", };
12: verify(checkConfig, getPath("InputWhitespace.java"), expected);
13: }
14:
15: public void testSpace() throws Exception {
16: final DefaultConfiguration checkConfig = createCheckConfig(TypecastParenPadCheck.class);
17: checkConfig.addAttribute("option", PadOption.SPACE.toString());
18: final String[] expected = {
19: "87:21: '(' is not followed by whitespace.",
20: "87:27: ')' is not preceded with whitespace.",
21: "88:14: '(' is not followed by whitespace.",
22: "88:20: ')' is not preceded with whitespace.",
23: "90:14: '(' is not followed by whitespace.",
24: "90:20: ')' is not preceded with whitespace.",
25: "241:18: '(' is not followed by whitespace.",
26: "241:21: ')' is not preceded with whitespace.", };
27: verify(checkConfig, getPath("InputWhitespace.java"), expected);
28: }
29:
30: public void test1322879() throws Exception {
31: final DefaultConfiguration checkConfig = createCheckConfig(TypecastParenPadCheck.class);
32: checkConfig.addAttribute("option", PadOption.SPACE.toString());
33: final String[] expected = {};
34: verify(checkConfig,
35: getPath("whitespace/InputWhitespaceAround.java"),
36: expected);
37: }
38: }
|