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 EmptyForIteratorPadCheckTest 7 extends BaseCheckTestCase 8 { 9 private DefaultConfiguration mCheckConfig; 10 11 public void setUp() 12 { 13 mCheckConfig = createCheckConfig(EmptyForIteratorPadCheck.class); 14 } 15 16 public void testDefault() throws Exception 17 { 18 final String [] expected = { 19 "27:31: ';' is followed by whitespace.", 20 "43:32: ';' is followed by whitespace.", 21 }; 22 verify(mCheckConfig, getPath("InputForWhitespace.java"), expected); 23 } 24 25 public void testSpaceOption() throws Exception 26 { 27 mCheckConfig.addAttribute("option", PadOption.SPACE.toString()); 28 final String [] expected = { 29 "23:31: ';' is not followed by whitespace.", 30 }; 31 verify(mCheckConfig, getPath("InputForWhitespace.java"), expected); 32 } 33 } 34 | Popular Tags |