Tweaking JUnit tests to be more complete

git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@4657 51baf565-9d33-0410-a72c-fc3788e3496d
This commit is contained in:
Allan Caplan
2006-10-14 23:56:10 +00:00
parent 303f3f5bfc
commit 302788631a

View File

@ -32,6 +32,7 @@ public class OverrideBothEqualsAndHashcodeTest extends SimpleAggregatorTst {
new TestDescriptor(TEST11, "overloaded both", 0, rule),
new TestDescriptor(TEST12, "overloaded hashCode, should fail on equals", 1, rule),
new TestDescriptor(TEST13, "implements hashCode but with args", 0, rule),
new TestDescriptor(TEST14, "implements interface other than Comparable", 1, rule),
});
}
@ -117,4 +118,11 @@ public class OverrideBothEqualsAndHashcodeTest extends SimpleAggregatorTst {
" return 0;" + PMD.EOL +
" }" + PMD.EOL +
"}";
private static final String TEST14 =
"public class Foo implements C {" + PMD.EOL +
" public boolean equals(Object other) { return false; }" + PMD.EOL +
" public int compareTo(Object other) { return 42; }" + PMD.EOL +
"}";
}