Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

Source code: com/puppycrawl/tools/checkstyle/checks/whitespace/WhitespaceAfterCheckTest.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 WhitespaceAfterCheckTest
7       extends BaseCheckTestCase
8   {
9       private DefaultConfiguration mCheckConfig;
10  
11      public void setUp()
12      {
13          mCheckConfig = createCheckConfig(WhitespaceAfterCheck.class);
14      }
15  
16      public void testDefault() throws Exception
17      {
18          final String[] expected = {
19              "42:40: ',' is not followed by whitespace.",
20              "71:30: ',' is not followed by whitespace.",
21          };
22          verify(mCheckConfig, getPath("InputSimple.java"), expected);
23      }
24  
25      public void testCast() throws Exception
26      {
27          final String[] expected = {
28              "88:21: 'cast' is not followed by whitespace.",
29          };
30          verify(mCheckConfig, getPath("InputWhitespace.java"), expected);
31      }
32  
33      public void testSemi() throws Exception
34      {
35          final String[] expected = {
36              "58:23: ';' is not followed by whitespace.",
37              "58:29: ';' is not followed by whitespace.",
38              "107:19: ';' is not followed by whitespace.",
39          };
40          verify(mCheckConfig, getPath("InputBraces.java"), expected);
41      }
42     
43      public void testEmptyForIterator() throws Exception
44      {
45          final String[] expected = {
46              "14:31: ';' is not followed by whitespace.",
47              "17:31: ';' is not followed by whitespace.",
48          };
49          verify(mCheckConfig, getPath("InputForWhitespace.java"), expected);
50      }
51  }