1 package com.puppycrawl.tools.checkstyle.checks.sizes; 2 3 import com.puppycrawl.tools.checkstyle.BaseCheckTestCase; 4 import com.puppycrawl.tools.checkstyle.DefaultConfiguration; 5 6 public class ParameterNumberCheckTest 7 extends BaseCheckTestCase 8 { 9 public void testDefault() 10 throws Exception 11 { 12 final DefaultConfiguration checkConfig = 13 createCheckConfig(ParameterNumberCheck.class); 14 final String [] expected = { 15 "194:10: More than 7 parameters.", 16 }; 17 verify(checkConfig, getPath("InputSimple.java"), expected); 18 } 19 20 public void testNum() 21 throws Exception 22 { 23 final DefaultConfiguration checkConfig = 24 createCheckConfig(ParameterNumberCheck.class); 25 checkConfig.addAttribute("max", "2"); 26 final String [] expected = { 27 "71:9: More than 2 parameters.", 28 "194:10: More than 2 parameters.", 29 }; 30 verify(checkConfig, getPath("InputSimple.java"), expected); 31 } 32 } 33 | Popular Tags |