Closed maxvetrenko closed 10 years ago
Test classes are named starting with the name of the class they are testing, and ending with Test. For example, HashTest or HashIntegrationTest.
Checkstyle have no ability to distinguish Test class from any other. There numerous UTs libraries: http://en.wikipedia.org/wiki/List_of_unit_testing_frameworks#Java , Junit is the only one of them. You will never support or distinguish Test class from from business logic classes. It is even non trivial task for human.
If Checkstyle can't cover JUnit3 naming convention, is it has any reason to include JUnit4 into Checkstyle confiig? Google has a lot of JUnit3 tests in it's projects and we'll have a lot of false positive on method names.
So, we can't cover a part ClassNames with Test classes.
In Google Style there is not a word about Junit!! Junit is one from big number of testing frameworks.
Nobody claimed that Tests have to be in JUnit only. Developer can choose any testing framework he wants.
That part of rule can not be enforced by Checkstyle at all. Please close this issue.
https://github.com/maxvetrenko/sevntu.checkstyle/blob/NameConvensionForTests/sevntu-checks/src/main/java/com/github/sevntu/checkstyle/checks/coding/NameConvensionForJUnit4TestsClassesCheck.java
This Check have to cover JUnit3 name convention.