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 StaticVariableNameCheckTest 7 extends BaseCheckTestCase 8 { 9 public void testSpecified() 10 throws Exception 11 { 12 final DefaultConfiguration checkConfig = 13 createCheckConfig(StaticVariableNameCheck.class); 14 checkConfig.addAttribute("format", "^s[A-Z][a-zA-Z0-9]*$"); 15 final String [] expected = { 16 "30:24: Name 'badStatic' must match pattern '^s[A-Z][a-zA-Z0-9]*$'.", 17 }; 18 verify(checkConfig, getPath("InputSimple.java"), expected); 19 } 20 } 21 22 | Popular Tags |