| 1 package com.puppycrawl.tools.checkstyle.checks.naming; 2 3 import com.puppycrawl.tools.checkstyle.BaseCheckTestCase; 4 import com.puppycrawl.tools.checkstyle.DefaultConfiguration; 5 6 public class PackageNameCheckTest 7 extends BaseCheckTestCase 8 { 9 public void testSpecified() 10 throws Exception  11 { 12 final DefaultConfiguration checkConfig = 13 createCheckConfig(PackageNameCheck.class); 14 checkConfig.addAttribute("format", "[A-Z]+"); 15 final String [] expected = { 16 "6:42: Name 'com.puppycrawl.tools.checkstyle' must match pattern '[A-Z]+'.", 17 }; 18 verify(checkConfig, getPath("InputSimple.java"), expected); 19 } 20 21 public void testDefault() 22 throws Exception  23 { 24 final DefaultConfiguration checkConfig = 25 createCheckConfig(PackageNameCheck.class); 26 final String [] expected = { 27 }; 28 verify(checkConfig, getPath("InputSimple.java"), expected); 29 } 30 } 31 | Popular Tags |