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 TypeNameCheckTest 7 extends BaseCheckTestCase 8 { 9 public void testSpecified() 10 throws Exception 11 { 12 final DefaultConfiguration checkConfig = 13 createCheckConfig(TypeNameCheck.class); 14 checkConfig.addAttribute("format", "^inputHe"); 15 final String [] expected = { 16 }; 17 verify(checkConfig, getPath("inputHeader.java"), expected); 18 } 19 20 public void testDefault() 21 throws Exception 22 { 23 final DefaultConfiguration checkConfig = 24 createCheckConfig(TypeNameCheck.class); 25 final String [] expected = { 26 "1:48: Name 'inputHeader' must match pattern '^[A-Z][a-zA-Z0-9]*$'." 27 }; 28 verify(checkConfig, getPath("inputHeader.java"), expected); 29 } 30 } 31 | Popular Tags |