jira.codehaus.org

  • Log In Access more options
    • Online Help
    • Keyboard Shortcuts
    • About JIRA
    • JIRA Credits
    • What?s New
  • Dashboards Access more options (Alt+d)
  • Projects Access more options (Alt+p)
  • Issues Access more options (Alt+i)
  • Sonar
  • SONAR-121

MissingUnitTestsService is adding test metrics to non test files

  • Log In
  • Views
    • XML
    • Word
    • Printable

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major 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();

Activity

  • All
  • Comments
  • Work Log
  • History
  • Activity
Hide
Permalink
Cédric Munger added a comment - 28/Dec/07 6:14 AM

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.

Show
Cédric Munger added a comment - 28/Dec/07 6:14 AM 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.

People

  • Assignee:
    Cédric Munger
    Reporter:
    Cédric Munger
Vote (0)
Watch (0)

Dates

  • Created:
    26/Dec/07 8:33 AM
    Updated:
    31/Jan/08 4:08 AM
    Resolved:
    07/Jan/08 4:27 AM
  • Atlassian JIRA (v5.0.4#731-sha1:3aa7374)
  • Report a problem
  • Powered by a free Atlassian JIRA open source license for Codehaus. Try JIRA - bug tracking software for your team.