1 package com.puppycrawl.tools.checkstyle.checks; 2 3 import com.puppycrawl.tools.checkstyle.BaseCheckTestCase; 4 import com.puppycrawl.tools.checkstyle.DefaultConfiguration; 5 6 public class ArrayTypeStyleCheckTest 7 extends BaseCheckTestCase 8 { 9 public void testJavaStyle() 10 throws Exception 11 { 12 final DefaultConfiguration checkConfig = 13 createCheckConfig(ArrayTypeStyleCheck.class); 14 final String [] expected = { 15 "14:23: Array brackets at illegal position.", 16 "20:44: Array brackets at illegal position.", 17 }; 18 verify(checkConfig, getPath("InputArrayTypeStyle.java"), expected); 19 } 20 21 public void testCStyle() 22 throws Exception 23 { 24 final DefaultConfiguration checkConfig = 25 createCheckConfig(ArrayTypeStyleCheck.class); 26 checkConfig.addAttribute("javaStyle", "false"); 27 final String [] expected = { 28 "13:16: Array brackets at illegal position.", 29 "16:39: Array brackets at illegal position.", 30 "22:18: Array brackets at illegal position.", 31 "30:20: Array brackets at illegal position.", 32 }; 33 verify(checkConfig, getPath("InputArrayTypeStyle.java"), expected); 34 } 35 } 36 | Popular Tags |