JUnitTestShouldIncludeAssert false positive
A source code analyzer
Brought to you by:
adangel,
juansotuyo
package org.sourceforge.pmd.test;
import junit.framework.TestCase;
public class AssertTest extends TestCase {
public AssertTest(String test) {
super(test);
}
public void testSomething() { // <-- Incorrect violation reported
moveToSomeState();
doTestState();
moveToOtherState();
doTestState();
}
private void doTestState() {
assertEquals("Some assert", 1, 2-1);
}
private void moveToSomeState() {
// ...
}
private void moveToOtherState() {
// ...
}
}
Logged In: YES
user_id=1983058
Originator: NO
This check has a lot of false positives especially when using custom assert methods, which is a recognised JUnit testing pattern.
This check would be nice, if it weren't so buggy...