Package hudson.plugins.jacoco.report
Class CoverageReport
- java.lang.Object
-
- hudson.plugins.jacoco.model.CoverageObject<SELF>
-
- hudson.plugins.jacoco.report.AbstractReport<PARENT,SELF>
-
- hudson.plugins.jacoco.report.AggregatedReport<CoverageReport,CoverageReport,PackageReport>
-
- hudson.plugins.jacoco.report.CoverageReport
-
- All Implemented Interfaces:
ModelObject
public final class CoverageReport extends AggregatedReport<CoverageReport,CoverageReport,PackageReport>
Root object of the coverage report.- Author:
- Kohsuke Kawaguchi, Ognjen Bubalo
-
-
Field Summary
-
Fields inherited from class hudson.plugins.jacoco.model.CoverageObject
branch, clazz, complexity, instruction, line, method
-
-
Constructor Summary
Constructors Constructor Description CoverageReport(JacocoBuildAction action, ExecutionFileLoader executionFileLoader)
Loads the exec files using JaCoCo API.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.kohsuke.stapler.HttpResponse
doJacocoExec()
Serves a single jacoco.exec file that merges all that have been recorded.Run<?,?>
getBuild()
Gets the build object that owns the whole coverage report tree.CoverageReport
getPreviousResult()
Gets the corresponding coverage report object in the previous run that has the record.protected void
printRatioCell(boolean failed, Coverage ratio, StringBuilder buf)
protected void
printRatioTable(Coverage ratio, StringBuilder buf)
void
setThresholds(JacocoHealthReportThresholds healthReports)
-
Methods inherited from class hudson.plugins.jacoco.report.AggregatedReport
add, getChildren, getDynamic, hasChildren, hasChildrenClassCoverage, hasChildrenLineCoverage, setFailed, setParent
-
Methods inherited from class hudson.plugins.jacoco.report.AbstractReport
addCoverage, getDisplayName, getName, getParent, sanitizeName, setName
-
Methods inherited from class hudson.plugins.jacoco.model.CoverageObject
doGraph, getApi, getBranchCoverage, getClassCoverage, getComplexityScore, getInstructionCoverage, getLineCoverage, getMaxBranch, getMaxClazz, getMaxComplexity, getMaxInstruction, getMaxLine, getMaxMethod, getMethodCoverage, hasClassCoverage, hasLineCoverage, isFailed, printFourCoverageColumns, setAllCovTypes, setCoverage, setMaxBranch, setMaxClazz, setMaxComplexity, setMaxInstruction, setMaxLine, setMaxMethod, toString
-
-
-
-
Constructor Detail
-
CoverageReport
public CoverageReport(JacocoBuildAction action, @NonNull ExecutionFileLoader executionFileLoader)
Loads the exec files using JaCoCo API. Creates the reporting objects and the report tree.- Parameters:
action
- Jacoco build actionexecutionFileLoader
- execution file loader owning bundle coverage
-
-
Method Detail
-
printRatioCell
protected void printRatioCell(boolean failed, Coverage ratio, StringBuilder buf)
- Overrides:
printRatioCell
in classCoverageObject<CoverageReport>
-
printRatioTable
protected void printRatioTable(Coverage ratio, StringBuilder buf)
- Overrides:
printRatioTable
in classCoverageObject<CoverageReport>
-
getPreviousResult
public CoverageReport getPreviousResult()
Description copied from class:CoverageObject
Gets the corresponding coverage report object in the previous run that has the record.- Overrides:
getPreviousResult
in classAbstractReport<CoverageReport,CoverageReport>
- Returns:
- null if no earlier record was found.
-
getBuild
public Run<?,?> getBuild()
Description copied from class:CoverageObject
Gets the build object that owns the whole coverage report tree.- Overrides:
getBuild
in classAbstractReport<CoverageReport,CoverageReport>
- Returns:
- the build object that owns the whole coverage report tree.
-
doJacocoExec
@WebMethod(name="jacoco.exec") public org.kohsuke.stapler.HttpResponse doJacocoExec() throws IOException
Serves a single jacoco.exec file that merges all that have been recorded.- Returns:
- HTTP response serving a single jacoco.exec file, or error 404 if nothing has been recorded.
- Throws:
IOException
- if any I/O error occurs
-
setThresholds
public void setThresholds(JacocoHealthReportThresholds healthReports)
-
-