hudson.plugins.jacoco.model
Class CoverageObject<SELF extends CoverageObject<SELF>>

java.lang.Object
  extended by hudson.plugins.jacoco.model.CoverageObject<SELF>
Direct Known Subclasses:
AbstractReport, JacocoBuildAction

@ExportedBean
public abstract class CoverageObject<SELF extends CoverageObject<SELF>>
extends Object

Base class of all coverage objects.

Author:
Kohsuke Kawaguchi

Field Summary
 Coverage branch
           
 Coverage clazz
           
 Coverage complexity
           
 Coverage instruction
           
 Coverage line
           
 int maxBranch
           
 int maxClazz
          Variables used to store which child has to highest coverage for each coverage type.
 int maxComplexity
           
 int maxInstruction
           
 int maxLine
           
 int maxMethod
           
 Coverage method
           
 
Constructor Summary
CoverageObject()
           
 
Method Summary
 void doGraph(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp)
          Generates the graph that shows the coverage trend up to this report.
 hudson.model.Api getApi()
           
 Coverage getBranchCoverage()
           
abstract  hudson.model.AbstractBuild<?,?> getBuild()
          Gets the build object that owns the whole coverage report tree.
 Coverage getClassCoverage()
           
 Coverage getComplexityScore()
           
 Coverage getInstructionCoverage()
           
 Coverage getLineCoverage()
          Line coverage.
 int getMaxBranch()
           
 int getMaxClazz()
           
 int getMaxComplexity()
           
 int getMaxInstruction()
           
 int getMaxLine()
           
 int getMaxMethod()
           
 Coverage getMethodCoverage()
           
 CoverageObject<?> getParent()
           
abstract  SELF getPreviousResult()
          Gets the corresponding coverage report object in the previous run that has the record.
 boolean hasClassCoverage()
           
 boolean hasLineCoverage()
           
 boolean isFailed()
           
 String printFourCoverageColumns()
          Used in the view to print out four table columns with the coverage info.
protected  void printRatioCell(boolean failed, Coverage ratio, StringBuilder buf)
           
protected  void printRatioTable(Coverage ratio, StringBuilder buf)
           
protected
<ReportLevel extends AggregatedReport>
void
setAllCovTypes(ReportLevel reportToSet, org.jacoco.core.analysis.ICoverageNode covReport)
           
<ReportLevel extends AggregatedReport>
void
setCoverage(ReportLevel reportToSet, org.jacoco.core.analysis.ICoverageNode covReport)
           
 void setFailed()
          Marks this coverage object as failed.
 void setMaxBranch(int maxBranch)
           
 void setMaxClazz(int maxClazz)
           
 void setMaxComplexity(int maxComplexity)
           
 void setMaxInstruction(int maxInstruction)
           
 void setMaxLine(int maxLine)
           
 void setMaxMethod(int maxMethod)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

clazz

public Coverage clazz

method

public Coverage method

line

public Coverage line

complexity

public Coverage complexity

instruction

public Coverage instruction

branch

public Coverage branch

maxClazz

public int maxClazz
Variables used to store which child has to highest coverage for each coverage type.


maxMethod

public int maxMethod

maxLine

public int maxLine

maxComplexity

public int maxComplexity

maxInstruction

public int maxInstruction

maxBranch

public int maxBranch
Constructor Detail

CoverageObject

public CoverageObject()
Method Detail

getMaxClazz

public int getMaxClazz()
Returns:
the maxClazz

setMaxClazz

public void setMaxClazz(int maxClazz)
Parameters:
maxClazz - the maxClazz to set

getMaxMethod

public int getMaxMethod()
Returns:
the maxMethod

setMaxMethod

public void setMaxMethod(int maxMethod)
Parameters:
maxMethod - the maxMethod to set

getMaxLine

public int getMaxLine()
Returns:
the maxLine

setMaxLine

public void setMaxLine(int maxLine)
Parameters:
maxLine - the maxLine to set

getMaxComplexity

public int getMaxComplexity()
Returns:
the maxComplexity

setMaxComplexity

public void setMaxComplexity(int maxComplexity)
Parameters:
maxComplexity - the maxComplexity to set

getMaxInstruction

public int getMaxInstruction()
Returns:
the maxInstruction

setMaxInstruction

public void setMaxInstruction(int maxInstruction)
Parameters:
maxInstruction - the maxInstruction to set

getMaxBranch

public int getMaxBranch()
Returns:
the maxBranch

setMaxBranch

public void setMaxBranch(int maxBranch)
Parameters:
maxBranch - the maxBranch to set

isFailed

public boolean isFailed()

setFailed

public void setFailed()
Marks this coverage object as failed.

See Also:
Rule

getClassCoverage

@Exported(inline=true)
public Coverage getClassCoverage()

getMethodCoverage

@Exported(inline=true)
public Coverage getMethodCoverage()

getComplexityScore

@Exported(inline=true)
public Coverage getComplexityScore()

getInstructionCoverage

@Exported(inline=true)
public Coverage getInstructionCoverage()

getBranchCoverage

@Exported(inline=true)
public Coverage getBranchCoverage()

getLineCoverage

@Exported(inline=true)
public Coverage getLineCoverage()
Line coverage. Can be null if this information is not collected.


getBuild

public abstract hudson.model.AbstractBuild<?,?> getBuild()
Gets the build object that owns the whole coverage report tree.


getPreviousResult

@Exported
public abstract SELF getPreviousResult()
Gets the corresponding coverage report object in the previous run that has the record.

Returns:
null if no earlier record was found.

getParent

public CoverageObject<?> getParent()

printFourCoverageColumns

public String printFourCoverageColumns()
Used in the view to print out four table columns with the coverage info.


hasLineCoverage

public boolean hasLineCoverage()

hasClassCoverage

public boolean hasClassCoverage()

printRatioCell

protected void printRatioCell(boolean failed,
                              Coverage ratio,
                              StringBuilder buf)

printRatioTable

protected void printRatioTable(Coverage ratio,
                               StringBuilder buf)

setAllCovTypes

protected <ReportLevel extends AggregatedReport> void setAllCovTypes(ReportLevel reportToSet,
                                                                     org.jacoco.core.analysis.ICoverageNode covReport)

setCoverage

public <ReportLevel extends AggregatedReport> void setCoverage(ReportLevel reportToSet,
                                                               org.jacoco.core.analysis.ICoverageNode covReport)

doGraph

public void doGraph(org.kohsuke.stapler.StaplerRequest req,
                    org.kohsuke.stapler.StaplerResponse rsp)
             throws IOException
Generates the graph that shows the coverage trend up to this report.

Throws:
IOException

getApi

public hudson.model.Api getApi()

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2004-2014 Hudson. All Rights Reserved.