Export line coverage information to portable and easy-to-
process format. This allows/simplify Emma usage by
external coverage reporting tools.
File format - CSV(TAB as separator), similar to text files
exported by PureCoverage. Line coverage information
only. All redundant/computable summary information
omitted for now.
Format: list of line coverage information for each file.
all_info:
<file_info>
[<file_info>]
file_info:
"SourceLines" <file_path> <full_class_name>
"LineNumber" "LineCoverage"
<line_number>.<file_number> <visits_count>
Implementation details:
Emma already supports interface that allows easily
implement own report formats.
Interface AbstractItemVisitor defines "visitor" interface
that shall be implemented by each ReportGenerator.
Class AbstractReportGenerator provides implementation
for all format-independent stuff. It factory method create
() creates appropriate ReportGenerator for specified
report output format parameter. This logic hardcoded for
now, but according to comments, author already
consider externalize it and allow to add new report
formats without original source code changes.
New format (ReportGenerator) introduced -
com.vladium.emma.report.rpc.ReportGenerator.
process () - enumerates all data model items to be
processed, starting from report root item and initiates it
processing using it accept() method.
visit (<any data item>) - process passed data item,
decide whenewer it child items shall be processed as
well and adds it to processing queue if necessary.
visit (AllItem), visit (PackageItem) - just adds child
items to processing queue
visit (SrcFileItem) - retreive line coverage information
(LineCoverage attribute containing map between line
number and it coverage status) from data model and
writes it to output file in PureCoverage -like format - not
covered lines reported as visited 0 times, covered and
partially covered reported as visited 1 time.
External settings - NONE. Use "-r rpc" command-line
parameter to export coverage information in this format.
Output sample:
SourceLines (Unknown Directory)\NullLogger.java
com.xxx.yyy.logging.NullLogger
LineNumber LineCoverage
25.2 1
26.2 1
30.2 0
SourceLines (Unknown Directory)\InParam.java
com.xxx.rdbms.InParam
LineNumber LineCoverage
15.3 0
16.3 1
17.3 0
This RFE somewhat related to "[ 962007 ] coverage data
export API"
CVS diff vs emma-2.0.4217-src.zip from downloads