hudson.plugins.jacoco
Class JacocoBuildAction

java.lang.Object
  extended by hudson.plugins.jacoco.model.CoverageObject<JacocoBuildAction>
      extended by hudson.plugins.jacoco.JacocoBuildAction
All Implemented Interfaces:
hudson.model.Action, hudson.model.HealthReportingAction, hudson.model.ModelObject, Serializable, org.kohsuke.stapler.StaplerProxy

public final class JacocoBuildAction
extends CoverageObject<JacocoBuildAction>
implements hudson.model.HealthReportingAction, org.kohsuke.stapler.StaplerProxy, Serializable

Build view extension by JaCoCo plugin. As CoverageObject, it retains the overall coverage report.

Author:
Kohsuke Kawaguchi, Jonathan Fuerth, Ognjen Bubalo
See Also:
Serialized Form

Field Summary
 hudson.model.AbstractBuild<?,?> build
          Deprecated. 
 PrintStream logger
           
 hudson.model.AbstractBuild<?,?> owner
           
 
Fields inherited from class hudson.plugins.jacoco.model.CoverageObject
branch, clazz, complexity, instruction, line, maxBranch, maxClazz, maxComplexity, maxCoveredBranch, maxCoveredClazz, maxCoveredComplexity, maxCoveredInstruction, maxCoveredLine, maxCoveredMethod, maxInstruction, maxLine, maxMethod, maxMissedBranch, maxMissedClazz, maxMissedComplexity, maxMissedInstruction, maxMissedLine, maxMissedMethod, method
 
Constructor Summary
JacocoBuildAction(hudson.model.AbstractBuild<?,?> owner, Rule rule, Map<CoverageElement.Type,Coverage> ratios, JacocoHealthReportThresholds thresholds, hudson.model.BuildListener listener, String[] inclusions, String[] exclusions)
           
 
Method Summary
 hudson.model.AbstractBuild<?,?> getBuild()
          Gets the build object that owns the whole coverage report tree.
 hudson.model.HealthReport getBuildHealth()
          Get the coverage HealthReport.
 String getDisplayName()
           
 String getIconFileName()
           
protected static ExecutionFileLoader getJacocoReports(hudson.FilePath fp, String[] includes, String[] excludes)
           
protected  ExecutionFileLoader getJacocoReports(File file, String[] includes, String[] excludes)
           
 JacocoBuildAction getPreviousResult()
          Gets the corresponding coverage report object in the previous run that has the record.
 CoverageReport getResult()
          Obtains the detailed CoverageReport instance.
 Object getTarget()
           
 JacocoHealthReportThresholds getThresholds()
           
 String getUrlName()
           
static JacocoBuildAction load(hudson.model.AbstractBuild<?,?> owner, Rule rule, JacocoHealthReportThresholds thresholds, hudson.model.BuildListener listener, hudson.FilePath actualBuildDirRoot, String[] includes, String[] excludes)
          Constructs the object from JaCoCo exec files.
 
Methods inherited from class hudson.plugins.jacoco.model.CoverageObject
doGraph, getApi, getBranchCoverage, getClassCoverage, getComplexityScore, getInstructionCoverage, getLineCoverage, getMaxCoveredBranch, getMaxCoveredClazz, getMaxCoveredComplexity, getMaxCoveredInstruction, getMaxCoveredLine, getMaxCoveredMethod, getMaxMissedBranch, getMaxMissedClazz, getMaxMissedComplexity, getMaxMissedInstruction, getMaxMissedLine, getMaxMissedMethod, getMethodCoverage, getParent, hasClassCoverage, hasLineCoverage, isFailed, printFourCoverageColumns, printRatioCell, printRatioTable, setAllCovTypes, setCoverage, setFailed, setMaxCoveredBranch, setMaxCoveredClazz, setMaxCoveredComplexity, setMaxCoveredInstruction, setMaxCoveredLine, setMaxCoveredMethod, setMaxMissedBranch, setMaxMissedClazz, setMaxMissedComplexity, setMaxMissedInstruction, setMaxMissedLine, setMaxMissedMethod, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

owner

public final hudson.model.AbstractBuild<?,?> owner

build

@Deprecated
public transient hudson.model.AbstractBuild<?,?> build
Deprecated. 

logger

public final PrintStream logger
Constructor Detail

JacocoBuildAction

public JacocoBuildAction(hudson.model.AbstractBuild<?,?> owner,
                         Rule rule,
                         Map<CoverageElement.Type,Coverage> ratios,
                         JacocoHealthReportThresholds thresholds,
                         hudson.model.BuildListener listener,
                         String[] inclusions,
                         String[] exclusions)
Parameters:
owner -
rule -
ratios - The available coverage ratios in the report. Null is treated the same as an empty map.
thresholds -
Method Detail

getDisplayName

public String getDisplayName()
Specified by:
getDisplayName in interface hudson.model.Action
Specified by:
getDisplayName in interface hudson.model.ModelObject

getIconFileName

public String getIconFileName()
Specified by:
getIconFileName in interface hudson.model.Action

getUrlName

public String getUrlName()
Specified by:
getUrlName in interface hudson.model.Action

getBuildHealth

public hudson.model.HealthReport getBuildHealth()
Get the coverage HealthReport.

Specified by:
getBuildHealth in interface hudson.model.HealthReportingAction
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 interface org.kohsuke.stapler.StaplerProxy

getBuild

public hudson.model.AbstractBuild<?,?> getBuild()
Description copied from class: CoverageObject
Gets the build object that owns the whole coverage report tree.

Specified by:
getBuild in class CoverageObject<JacocoBuildAction>

getJacocoReports

protected ExecutionFileLoader getJacocoReports(File file,
                                               String[] includes,
                                               String[] excludes)
                                        throws IOException
Throws:
IOException

getJacocoReports

protected static ExecutionFileLoader getJacocoReports(hudson.FilePath fp,
                                                      String[] includes,
                                                      String[] excludes)
                                               throws IOException
Throws:
IOException

getResult

public CoverageReport getResult()
Obtains the detailed CoverageReport instance.


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 class CoverageObject<JacocoBuildAction>
Returns:
null if no earlier record was found.

load

public static JacocoBuildAction load(hudson.model.AbstractBuild<?,?> owner,
                                     Rule rule,
                                     JacocoHealthReportThresholds thresholds,
                                     hudson.model.BuildListener listener,
                                     hudson.FilePath actualBuildDirRoot,
                                     String[] includes,
                                     String[] excludes)
                              throws IOException
Constructs the object from JaCoCo exec files.

Throws:
IOException - if failed to parse the file.


Copyright © 2004-2013 Hudson. All Rights Reserved.