1 package test.net.sourceforge.pmd.rules.strictexception;
2
3 import net.sourceforge.pmd.PMD;
4 import net.sourceforge.pmd.rules.strictexception.ExceptionSignatureDeclaration;
5 import test.net.sourceforge.pmd.rules.SimpleAggregatorTst;
6 import test.net.sourceforge.pmd.rules.TestDescriptor;
7
8 public class ExceptionSignatureDeclarationRuleTest extends SimpleAggregatorTst {
9
10 public void testAll() {
11 runTests(new TestDescriptor[] {
12 new TestDescriptor(TEST1, "method throws Exception", 1, new ExceptionSignatureDeclaration()),
13 new TestDescriptor(TEST2, "ok", 0, new ExceptionSignatureDeclaration()),
14 new TestDescriptor(TEST3, "constructor throws Exception", 1, new ExceptionSignatureDeclaration()),
15 });
16 }
17
18 private static final String TEST1 =
19 "public class Foo {" + PMD.EOL +
20 " void foo() throws Exception {}" + PMD.EOL +
21 "}";
22
23 private static final String TEST2 =
24 "public class Foo {" + PMD.EOL +
25 " void foo() {}" + PMD.EOL +
26 "}";
27
28 private static final String TEST3 =
29 "public class Foo {" + PMD.EOL +
30 " Foo() throws Exception {}" + PMD.EOL +
31 "}";
32
33
34 }
This page was automatically generated by Maven