public class CoverageTracker
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
private static class |
CoverageTracker.DummySessionInfoVisitor
An
ISessionInfoVisitor that does nothing. |
| Modifier and Type | Field and Description |
|---|---|
private java.util.Map<java.lang.String,java.lang.Double> |
branchCoverageMap
Map from method name to uncovered branch ratio (in Jacoco terms, the "missed ratio").
|
protected java.util.Set<java.lang.String> |
classesUnderTest
Names of all the classes under test.
|
private org.jacoco.core.data.ExecutionDataStore |
executionData
A local copy of Jacoco's in-memory store of the coverage information for all classes under
test.
|
| Constructor and Description |
|---|
CoverageTracker(java.util.Set<ClassOrInterfaceType> classInterfaceTypes)
Initialize the coverage tracker.
|
| Modifier and Type | Method and Description |
|---|---|
private void |
collectCoverageInformation()
Retrieve execution data from the Jacoco Java agent and merge the coverage information into
executionData. |
java.lang.Double |
getBranchCoverageForMethod(java.lang.String methodName)
Returns the uncovered branch ratio associated with the input method.
|
private java.lang.String |
getResourceFromClassName(@BinaryName java.lang.String className)
Construct the absolute resource name of a class given a class name.
|
void |
updateBranchCoverageMap()
Updates branch coverage information for all methods under test.
|
private final org.jacoco.core.data.ExecutionDataStore executionData
private final java.util.Map<java.lang.String,java.lang.Double> branchCoverageMap
protected final java.util.Set<java.lang.String> classesUnderTest
public CoverageTracker(java.util.Set<ClassOrInterfaceType> classInterfaceTypes)
classInterfaceTypes - all the classes under testprivate void collectCoverageInformation()
executionData.public void updateBranchCoverageMap()
branchCoverageMap field is updated to
contain the updated coverage information of each method branch.private java.lang.String getResourceFromClassName(@BinaryName java.lang.String className)
className - binary name of classpublic java.lang.Double getBranchCoverageForMethod(java.lang.String methodName)
methodName - name of the method to examine