git-svn-id: https://svn.apache.org/repos/asf/maven/maven-1/plugins/trunk@113253 13f79535-47bb-0310-9956-ffa450edef68
49 lines
1.2 KiB
XML
49 lines
1.2 KiB
XML
<?xml version="1.0"?>
|
|
|
|
<ruleset name="JUnit Rules">
|
|
<description>
|
|
These rules deal with different problems that can occur with JUnit tests.
|
|
</description>
|
|
|
|
<rule name="JUnitSpelling"
|
|
message="You may have misspelled the JUnit framework ''{0}'' method as ''{1}''"
|
|
class="net.sourceforge.pmd.rules.JUnitSpellingRule">
|
|
<description>
|
|
Some JUnit framework methods are easy to misspell.
|
|
</description>
|
|
|
|
<example>
|
|
<![CDATA[
|
|
import junit.framework.*;
|
|
public class Foo extends TestCase {
|
|
public void setup() {} // oops, should be setUp
|
|
public void TearDown() {} // oops, should be tearDown
|
|
}
|
|
]]>
|
|
</example>
|
|
</rule>
|
|
|
|
|
|
<rule name="JUnitStaticSuite"
|
|
message="You have a suite() method that is not both public and static, so JUnit won't call it to get your TestSuite. Is that what you wanted to do?"
|
|
class="net.sourceforge.pmd.rules.JUnitStaticSuiteRule">
|
|
<description>
|
|
The suite() method in a JUnit test needs to be both public and static.
|
|
</description>
|
|
|
|
<example>
|
|
<![CDATA[
|
|
import junit.framework.*;
|
|
public class Foo extends TestCase {
|
|
public void suite() {} // oops, should be static
|
|
private static void suite() {} // oops, should be public
|
|
}
|
|
]]>
|
|
</example>
|
|
</rule>
|
|
|
|
</ruleset>
|
|
|
|
|
|
|