Source code: com/puppycrawl/tools/checkstyle/checks/whitespace/TypecastParenPadCheckTest.java
1 package com.puppycrawl.tools.checkstyle.checks.whitespace;
2
3 import com.puppycrawl.tools.checkstyle.BaseCheckTestCase;
4 import com.puppycrawl.tools.checkstyle.DefaultConfiguration;
5
6 public class TypecastParenPadCheckTest
7 extends BaseCheckTestCase
8 {
9 public void testDefault()
10 throws Exception
11 {
12 final DefaultConfiguration checkConfig =
13 createCheckConfig(TypecastParenPadCheck.class);
14 final String[] expected = {
15 "89:14: '(' is followed by whitespace.",
16 "89:21: ')' is preceded with whitespace.",
17 };
18 verify(checkConfig, getPath("InputWhitespace.java"), expected);
19 }
20
21 public void testSpace()
22 throws Exception
23 {
24 final DefaultConfiguration checkConfig =
25 createCheckConfig(TypecastParenPadCheck.class);
26 checkConfig.addAttribute("option", PadOption.SPACE.toString());
27 final String[] expected = {
28 "87:21: '(' is not followed by whitespace.",
29 "87:27: ')' is not preceded with whitespace.",
30 "88:14: '(' is not followed by whitespace.",
31 "88:20: ')' is not preceded with whitespace.",
32 "90:14: '(' is not followed by whitespace.",
33 "90:20: ')' is not preceded with whitespace.",
34 };
35 verify(checkConfig, getPath("InputWhitespace.java"), expected);
36 }
37 }