View Javadoc
1 /* $Id: LongParameterListRuleTest.java,v 1.11 2003/06/26 21:13:13 tomcopeland Exp $ */ 2 3 package test.net.sourceforge.pmd.rules.design; 4 5 import net.sourceforge.pmd.PMD; 6 import net.sourceforge.pmd.rules.design.LongParameterListRule; 7 import test.net.sourceforge.pmd.rules.RuleTst; 8 9 public class LongParameterListRuleTest extends RuleTst { 10 11 private static final String TEST1 = 12 "public class LongParameterList0 {" + PMD.EOL + 13 " public void foo() {}" + PMD.EOL + 14 "}"; 15 16 private static final String TEST2 = 17 "public class LongParameterList1 {" + PMD.EOL + 18 " public void foo(int p01, int p02, int p03, int p04, int p05," + PMD.EOL + 19 " int p06, int p07, int p08, int p09, int p10 ) { }" + PMD.EOL + 20 " public void bar(int p01, int p02, int p03, int p04, int p05 ) { }" + PMD.EOL + 21 "}"; 22 23 public LongParameterListRule getIUT() { 24 LongParameterListRule IUT = new LongParameterListRule(); 25 IUT.addProperty("minimum", "9"); 26 return IUT; 27 } 28 29 public void testShortMethod() throws Throwable { 30 runTestFromString(TEST1, 0, getIUT()); 31 } 32 33 public void testOneLongMethod() throws Throwable { 34 runTestFromString(TEST2, 1, getIUT()); 35 } 36 }

This page was automatically generated by Maven