Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 1.0.2
-
Fix Version/s: 1.1
-
Component/s: None
-
Labels:None
Description
this service is adding test metrics to files that are not unit tests files. since unit test files and regular source files are mixed within the same table in the database.
The code uses a method named module.getFiles(); to get the current modules files.
Should be split in 2 : module.getTestFiles(); and module.getSourceFiles();
first implementation based on the source file name commited. check if file name ends with test.java, assuming that this is an unit test file.
Not really great.
A clean solution would be to modify the files table and add a type column (JAVA_SOURCE_FILE, JAVA_UNIT_TEST_FILE,...) and modify the Jxr metrics collector to fill this column correctly.
The implementation would only have to lookup for source file of a certain type to correctly find unit test files in our case.