Klasse CoverageResult
java.lang.Object
io.jenkins.plugins.coverage.targets.CoverageResult
- Alle implementierten Schnittstellen:
ModelObject
,Chartable
,Serializable
@ExportedBean(defaultVisibility=2)
public class CoverageResult
extends Object
implements Serializable, Chartable, ModelObject
Coverage result for a specific programming element.
Instances ofCoverageResult
form a tree structure to progressively represent smaller elements.- Seit:
- 22-Aug-2007 18:47:10
- Autor:
- Stephen Connolly
- Siehe auch:
-
Verschachtelte Klassen - Übersicht
-
Feldübersicht
-
Konstruktorübersicht
KonstruktorBeschreibungCoverageResult
(CoverageElement elementType, CoverageResult parent, String name) -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungvoid
addAdditionalProperty
(String propertyName, String value) void
add parent for CoverageResult(Only effect when parent is null)Finds the coverage element with the given name.getAdditionalProperty
(String propertyName) getAll
(CoverageElement element) Returns recursively all elements of the given type.float
Veraltet.Getter for property 'childElements'.Getter for keys of property 'children'.getChildren
(CoverageElement element) getCoverage
(CoverageElement element) float
getCoverageDelta
(CoverageElement element) Get delta coverage fromdeltaResults
for a specificCoverageElement
.getCoverageFor
(CoverageElement coverageElement) Returns the coverage ratio for the specified element.getDelta
(CoverageElement coverageElement) Returns the delta result with respect to the reference build.getDynamic
(String token, org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp) getLast()
getName()
Run
<?, ?> getOwner()
Getter for property 'owner'.getPaint()
Getter for property 'paintedSources'.Returns the name of the parent element or "-" if there is no such element.Getter for property 'parents'.Getter for property 'previousResult'.Getter for property 'results'.getRoot()
If the report is an aggregation with a single report just remove the aggregation.Returns the singleton child of this result.Getter for property 'sourceFileContent'.getTag()
boolean
hasDelta
(CoverageElement coverageElement) Returns whether a delta result with respect to the reference build is available.boolean
Returns whether this result has a parent.boolean
boolean
Returns whether a delta computation with a reference build is available.boolean
Returns whether this result has a singleton child.boolean
boolean
boolean
Getter for property 'sourceFileAvailable'.Interface for javascript code to get child coverage result.Interface for javascript code to get code coverage result.Interface for javascript code to get code coverage trend.void
merge
(CoverageResult another) void
paint
(int line, int hits) void
paint
(int line, int hits, int branchHits, int branchTotal) printCoverageFor
(CoverageElement coverageElement) Prints the coverage for the specified element.relativeUrl
(CoverageResult parent) void
void
setChangeRequestCoverageDiffWithTargetBranch
(float changeRequestCoverageDiffWithTargetBranch) Veraltet.diff coverage is stored indeltaResults
.void
setDeltaResults
(Map<CoverageElement, Float> deltaResults) void
void
setOwner
(AbstractBuild<?, ?> owner) void
Setter for property 'owner'.void
setReferenceBuildUrl
(String referenceBuildUrl) void
setRelativeSourcePath
(String relativeSourcePath) void
void
If the report contains a single group just remove the group.toString()
void
updateCoverage
(CoverageElement element, Ratio additionalResult) urlTransform
(String name) xmlTransform
(String name)
-
Felddetails
-
owner
-
-
Konstruktordetails
-
CoverageResult
-
-
Methodendetails
-
stripGroup
public void stripGroup()If the report contains a single group just remove the group. -
getRoot
If the report is an aggregation with a single report just remove the aggregation.- Gibt zurück:
- the actual root of the hierarchy
-
toString
-
hasDelta
Returns whether a delta result with respect to the reference build is available.- Parameter:
coverageElement
- the element to check- Gibt zurück:
true
if a delta result is available,false
otherwise
-
getDelta
Returns the delta result with respect to the reference build.- Parameter:
coverageElement
- the element to get the delta for- Gibt zurück:
- the delta result (if available)
-
hasReferenceBuild
public boolean hasReferenceBuild()Returns whether a delta computation with a reference build is available.- Gibt zurück:
true
if there is a reference build,false
if not
-
getLocalResults
-
getSingletonChild
Returns the singleton child of this result.- Gibt zurück:
- the singleton child of this result
- Löst aus:
NoSuchElementException
- if this result does not contain children- Siehe auch:
-
hasSingletonChild
public boolean hasSingletonChild()Returns whether this result has a singleton child.- Gibt zurück:
true
if this result has a singleton child,false
otherwise
-
hasParent
public boolean hasParent()Returns whether this result has a parent.- Gibt zurück:
true
if this result has a parent,false
if it is the root of the hierarchy
-
getParentName
Returns the name of the parent element or "-" if there is no such element.- Gibt zurück:
- the name of the parent element
-
getAll
Returns recursively all elements of the given type.- Parameter:
element
- the element type to look for- Gibt zurück:
- all elements of the given type
-
find
Finds the coverage element with the given name.- Parameter:
element
- the coverage element namename
- the name of the coverage instance- Gibt zurück:
- the result if found
-
getCoverageFor
Returns the coverage ratio for the specified element.- Parameter:
coverageElement
- the element to get the coverage ratio for- Gibt zurück:
- coverage ratio if available
-
printCoverageFor
Prints the coverage for the specified element.- Parameter:
coverageElement
- the element to print the coverage for- Gibt zurück:
- coverage ratio in a human-readable format
-
getRelativeSourcePath
-
setRelativeSourcePath
-
getName
-
setName
-
getParent
-
getElement
-
isSourceCodeLevel
public boolean isSourceCodeLevel() -
isAggregatedLevel
public boolean isAggregatedLevel() -
getPaint
-
paint
public void paint(int line, int hits) -
paint
public void paint(int line, int hits, int branchHits, int branchTotal) -
getCoverageDelta
Get delta coverage fromdeltaResults
for a specificCoverageElement
.- Parameter:
element
- the element to get the diff coverage for.- Gibt zurück:
- the diff coverage or 0, if diff coverage for element is not available.
-
getChangeRequestCoverageDiffWithTargetBranch
Veraltet.usegetCoverageDelta(CoverageElement)
instead.Getter for property 'changeRequestCoverageDiffWithTargetBranch'.- Gibt zurück:
- Value for property 'changeRequestCoverageDiffWithTargetBranch'.
-
setChangeRequestCoverageDiffWithTargetBranch
@Deprecated public void setChangeRequestCoverageDiffWithTargetBranch(float changeRequestCoverageDiffWithTargetBranch) Veraltet.diff coverage is stored indeltaResults
.Setter for property 'changeRequestCoverageDiffWithTargetBranch'.- Parameter:
changeRequestCoverageDiffWithTargetBranch
- Value to set for property 'changeRequestCoverageDiffWithTargetBranch'.
-
getReferenceBuildUrl
-
setReferenceBuildUrl
-
isSourceFileAvailable
public boolean isSourceFileAvailable()Getter for property 'sourceFileAvailable'.- Gibt zurück:
- Value for property 'sourceFileAvailable'.
-
hasPermission
public boolean hasPermission() -
getSourceFileContent
Getter for property 'sourceFileContent'.- Gibt zurück:
- Value for property 'sourceFileContent'.
-
getParents
Getter for property 'parents'.- Gibt zurück:
- Value for property 'parents'.
-
getChildElements
Getter for property 'childElements'.- Gibt zurück:
- Value for property 'childElements'.
-
getChildElement
-
getChildren
-
getChildren
Getter for keys of property 'children'.- Gibt zurück:
- Value for keys of property 'children'.
-
getChildrenReal
-
getResults
- Angegeben von:
getResults
in SchnittstelleChartable
-
getDeltaResults
-
setDeltaResults
-
getResultsAPI
Getter for property 'results'.- Gibt zurück:
- Value for property 'results'.
-
getCoverageTrends
-
urlTransform
-
xmlTransform
-
relativeUrl
-
getChild
-
getCoverage
-
getElements
-
updateCoverage
-
getOwner
Getter for property 'owner'. -
setOwner
Setter for property 'owner'.- Parameter:
owner
- Value to set for property 'owner'.
-
setOwner
-
merge
- Löst aus:
CoverageException
-
getTag
-
setTag
-
getPreviousResult
Getter for property 'previousResult'.- Angegeben von:
getPreviousResult
in SchnittstelleChartable
- Gibt zurück:
- Value for property 'previousResult'.
-
getDynamic
public Object getDynamic(String token, org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp) throws IOException - Löst aus:
IOException
-
getPaintedSources
Getter for property 'paintedSources'.- Gibt zurück:
- Value for property 'paintedSources'.
-
getLast
-
addParent
add parent for CoverageResult(Only effect when parent is null)- Parameter:
p
- parent
-
resetParent
-
addAdditionalProperty
-
getAdditionalProperty
-
jsGetResults
Interface for javascript code to get code coverage result.- Gibt zurück:
- aggregated coverage results
-
jsGetChildResults
Interface for javascript code to get child coverage result.- Gibt zurück:
- aggregated child coverage results
-
jsGetTrendResults
Interface for javascript code to get code coverage trend.- Gibt zurück:
- coverage trend
-
getDisplayName
- Angegeben von:
getDisplayName
in SchnittstelleModelObject
-
getCoverageDelta(CoverageElement)
instead.