code-level recipes - reading the exec file, reading project coverage data at class and line level

24 views
Skip to first unread message

julian...@gmail.com

unread,
Aug 7, 2017, 7:36:03 AM8/7/17
to JaCoCo and EclEmma Users
Hi Everyone,

I'm looking for (for want of a better word) JaCoCo internals recipes.

I can do the following in Cobertura.

1. Read .ser file
http://alvinalexander.com/java/jwarehouse/cobertura-1.9/src/net/sourceforge/cobertura/coveragedata/CoverageDataFileHandler.java.shtml
(Where the equivalent in Jacoco is the exec file)

Store in CoverageData
https://github.com/cobertura/cobertura/blob/master/cobertura/src/main/java/net/sourceforge/cobertura/coveragedata/ProjectData.java
(I don't know what the overall project level data is called in Jacoco).

Pull out classData
https://github.com/cobertura/cobertura/blob/master/cobertura/src/main/java/net/sourceforge/cobertura/coveragedata/ClassData.java
(I don't know how to retrieve coverage data at a class level from the exec file in Cobertura)

Pull out LineData
https://github.com/cobertura/cobertura/blob/master/cobertura/src/main/java/net/sourceforge/cobertura/coveragedata/LineData.java
(I don't know how to pull code the data at a line-level of covered/uncovered code in Cobertura).

Can someone point me do how to do the same in JaCoco?
1. Read the exec file
2. Pull out the data at a project level
3. Pull out data at a class level
4. Pull out data at a line-level.

Cheers
Julian

Evgeny Mandrikov

unread,
Aug 11, 2017, 4:57:48 PM8/11/17
to JaCoCo and EclEmma Users, julian...@gmail.com
Hi,

Please read documentation at http://www.jacoco.org/jacoco/trunk/doc/
In particular there is API Usage Examples - http://www.jacoco.org/jacoco/trunk/doc/api.html
that shows how to read exec file and generate report.
Reply all
Reply to author
Forward
This conversation is locked
You cannot reply and perform actions on locked conversations.
0 new messages