A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/pmd/pmd/issues/3624 below:

[java] TestClassWithoutTestCases reports wrong classes in a file · Issue #3624 · pmd/pmd · GitHub

Affects PMD Version: 6.40.0

Rule: TestClassWithoutTestCases

Description:

When a test class contains additional helper classes in the same compilation units, then these are reported as well, even if they are no test classes.

Code Sample demonstrating the issue:

import org.junit.Test;

public class MyTest {
    @Test
    public void myTest() {
    }
}

class Helper { }  // this is reported, but this is not a test class, so doesn't need test cases

Expected outcome:

PMD reports a violation at line 9, but that's wrong. That's a false positive.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4