Menu

#1453 [java] TestClassWithoutTestCases: false positive

PMD-5.3.7
closed
java (55)
PMD
3-Major
Bug
5.4.1
java-junit/TestClassWithoutTestCases
2016-06-25
2016-01-20
Rei Angelus
No

Test Class Without Test Cases gives false positive when the class extends an other.

For exmple:
:::xml
<test-code>
<description><![CDATA
False positive when the test class extends an other.
]></description>
<expected-problems>0</expected-problems>
<![CDATA[
import static org.junit.Assert.*;
import org.junit.Test;

public class MyTest extends YourTest {

@Test
public void falseMethod() {

    assertFalse(0 == 1);
}

}
]]>

</test-code>

Thanks,

Discussion

  • Andreas Dangel

    Andreas Dangel - 2016-02-01
    • status: open --> closed
    • assigned_to: Andreas Dangel
    • Milestone: New Tickets --> PMD-5.3.7
     
  • Andreas Dangel

    Andreas Dangel - 2016-02-01
    • Ruleset / Rule: --> java-junit/TestClassWithoutTestCases
     
  • Andreas Dangel

    Andreas Dangel - 2016-06-25
    • labels: --> java
    • summary: Test Class Without Test Cases gives false positive --> [java] TestClassWithoutTestCases: false positive
     

Log in to post a comment.