org.sonar.l10n.pmd.rules.pmd-unit-tests.TestClassWithoutTestCases.html Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of sonar-pmd-plugin Show documentation
Show all versions of sonar-pmd-plugin Show documentation
PMD is a tool that looks for potential problems like possible bugs, dead code, suboptimal code, overcomplicated expressions or duplicate code.
Test classes end with the suffix Test. Having a non-test class with that name is not a good practice, since most people will assume it is a test case. Test classes have test methods named testXXX.
Beware: This rule doesn't support JUnit 4.x's @Test annotation.
public class CarTest { // violation, consider changing the name of the class if it is not a test
// consider adding test methods if it is a test
public static void main(String[] args) {
// do something
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy