Package hudson.plugins.jacoco
Class JacocoBuildAction
- java.lang.Object
-
- hudson.plugins.jacoco.model.CoverageObject<JacocoBuildAction>
-
- hudson.plugins.jacoco.JacocoBuildAction
-
- All Implemented Interfaces:
Action
,HealthReportingAction
,ModelObject
,Serializable
,RunAction2
,SimpleBuildStep.LastBuildAction
,org.kohsuke.stapler.StaplerProxy
public final class JacocoBuildAction extends CoverageObject<JacocoBuildAction> implements HealthReportingAction, org.kohsuke.stapler.StaplerProxy, Serializable, RunAction2, SimpleBuildStep.LastBuildAction
Build view extension by JaCoCo plugin. AsCoverageObject
, it retains the overall coverage report.- Author:
- Kohsuke Kawaguchi, Jonathan Fuerth, Ognjen Bubalo
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description AbstractBuild<?,?>
build
Deprecated.-
Fields inherited from class hudson.plugins.jacoco.model.CoverageObject
branch, clazz, complexity, instruction, line, maxBranch, maxClazz, maxComplexity, maxInstruction, maxLine, maxMethod, method
-
-
Constructor Summary
Constructors Constructor Description JacocoBuildAction(Map<CoverageElement.Type,Coverage> ratios, JacocoHealthReportThresholds thresholds, TaskListener listener, String[] inclusions, String[] exclusions)
-
Method Summary
-
Methods inherited from class hudson.plugins.jacoco.model.CoverageObject
doGraph, getApi, getBranchCoverage, getClassCoverage, getComplexityScore, getInstructionCoverage, getLineCoverage, getMaxBranch, getMaxClazz, getMaxComplexity, getMaxInstruction, getMaxLine, getMaxMethod, getMethodCoverage, getParent, hasClassCoverage, hasLineCoverage, isFailed, printFourCoverageColumns, printRatioCell, printRatioTable, setAllCovTypes, setCoverage, setFailed, setMaxBranch, setMaxClazz, setMaxComplexity, setMaxInstruction, setMaxLine, setMaxMethod, toString
-
-
-
-
Field Detail
-
build
@Deprecated public transient AbstractBuild<?,?> build
Deprecated.
-
-
Constructor Detail
-
JacocoBuildAction
public JacocoBuildAction(Map<CoverageElement.Type,Coverage> ratios, JacocoHealthReportThresholds thresholds, TaskListener listener, String[] inclusions, String[] exclusions)
- Parameters:
ratios
- The available coverage ratios in the report. Null is treated the same as an empty map.thresholds
- The thresholds that applied when this build was built.listener
- The listener from which we get loggerinclusions
- SeeJacocoReportDir.parse(String[], String...)
exclusions
- SeeJacocoReportDir.parse(String[], String...)
-
-
Method Detail
-
getDisplayName
public String getDisplayName()
- Specified by:
getDisplayName
in interfaceAction
- Specified by:
getDisplayName
in interfaceModelObject
-
getIconFileName
public String getIconFileName()
- Specified by:
getIconFileName
in interfaceAction
-
getUrlName
public String getUrlName()
- Specified by:
getUrlName
in interfaceAction
-
getBuildHealth
public HealthReport getBuildHealth()
Get the coverageHealthReport
.- Specified by:
getBuildHealth
in interfaceHealthReportingAction
- Returns:
- The health report or
null
if health reporting is disabled. - Since:
- 1.7
-
getThresholds
public JacocoHealthReportThresholds getThresholds()
-
getTarget
public Object getTarget()
- Specified by:
getTarget
in interfaceorg.kohsuke.stapler.StaplerProxy
-
getBuild
public Run<?,?> getBuild()
Description copied from class:CoverageObject
Gets the build object that owns the whole coverage report tree.- Specified by:
getBuild
in classCoverageObject<JacocoBuildAction>
- Returns:
- the build object that owns the whole coverage report tree.
-
getJacocoReport
public JacocoReportDir getJacocoReport()
-
getResult
@Nullable public CoverageReport getResult()
Obtains the detailedCoverageReport
instance.- Returns:
- the report, or null if these was a problem
-
getPreviousResult
public JacocoBuildAction getPreviousResult()
Description copied from class:CoverageObject
Gets the corresponding coverage report object in the previous run that has the record.- Specified by:
getPreviousResult
in classCoverageObject<JacocoBuildAction>
- Returns:
- null if no earlier record was found.
-
getCoverageRatios
public Map<Coverage,Boolean> getCoverageRatios()
- Returns:
- A map which represents coverage objects and their status to show on build status page (summary.jelly).
-
load
public static JacocoBuildAction load(JacocoHealthReportThresholds thresholds, TaskListener listener, JacocoReportDir layout, String[] includes, String[] excludes) throws IOException
Constructs the object from JaCoCo exec files.- Parameters:
thresholds
- The thresholds that applied when this build was built.listener
- The listener from which we get loggerlayout
- The object parsing the saved "jacoco.exec" filesincludes
- SeeJacocoReportDir.parse(String[], String...)
excludes
- SeeJacocoReportDir.parse(String[], String...)
- Returns:
- new
JacocoBuildAction
from JaCoCo exec files - Throws:
IOException
- if failed to parse the file.
-
getLogger
public final PrintStream getLogger()
-
getOwner
public Run<?,?> getOwner()
-
onAttached
public void onAttached(Run<?,?> run)
- Specified by:
onAttached
in interfaceRunAction2
-
onLoad
public void onLoad(Run<?,?> run)
- Specified by:
onLoad
in interfaceRunAction2
-
getProjectActions
public Collection<? extends Action> getProjectActions()
- Specified by:
getProjectActions
in interfaceSimpleBuildStep.LastBuildAction
-
-