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 of CoverageResult form a tree structure to progressively represent smaller elements.
Seit:
22-Aug-2007 18:47:10
Autor:
Stephen Connolly
Siehe auch:
  • Felddetails

    • owner

      public transient Run<?,?> owner
  • Konstruktordetails

  • Methodendetails

    • stripGroup

      public void stripGroup()
      If the report contains a single group just remove the group.
    • getRoot

      public CoverageResult 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

      public String toString()
      Setzt außer Kraft:
      toString in Klasse Object
    • hasDelta

      public boolean hasDelta(CoverageElement coverageElement)
      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

      public String getDelta(CoverageElement coverageElement)
      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

      public Map<CoverageElement,Ratio> getLocalResults()
    • getSingletonChild

      public CoverageResult 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

      public String 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

      public List<CoverageResult> getAll(CoverageElement element)
      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

      public Optional<CoverageResult> find(String element, String name)
      Finds the coverage element with the given name.
      Parameter:
      element - the coverage element name
      name - the name of the coverage instance
      Gibt zurück:
      the result if found
    • getCoverageFor

      public Optional<Ratio> getCoverageFor(CoverageElement coverageElement)
      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

      public String printCoverageFor(CoverageElement coverageElement)
      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

      public String getRelativeSourcePath()
    • setRelativeSourcePath

      public void setRelativeSourcePath(String relativeSourcePath)
    • getName

      public String getName()
    • setName

      public void setName(String name)
    • getParent

      public CoverageResult getParent()
    • getElement

      public CoverageElement getElement()
    • isSourceCodeLevel

      public boolean isSourceCodeLevel()
    • isAggregatedLevel

      public boolean isAggregatedLevel()
    • getPaint

      public CoveragePaint getPaint()
    • paint

      public void paint(int line, int hits)
    • paint

      public void paint(int line, int hits, int branchHits, int branchTotal)
    • getCoverageDelta

      public float getCoverageDelta(CoverageElement element)
      Get delta coverage from deltaResults for a specific CoverageElement.
      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

      @Deprecated public float getChangeRequestCoverageDiffWithTargetBranch()
      Veraltet.
      Getter for property 'changeRequestCoverageDiffWithTargetBranch'.
      Gibt zurück:
      Value for property 'changeRequestCoverageDiffWithTargetBranch'.
    • setChangeRequestCoverageDiffWithTargetBranch

      @Deprecated public void setChangeRequestCoverageDiffWithTargetBranch(float changeRequestCoverageDiffWithTargetBranch)
      Veraltet.
      diff coverage is stored in deltaResults.
      Setter for property 'changeRequestCoverageDiffWithTargetBranch'.
      Parameter:
      changeRequestCoverageDiffWithTargetBranch - Value to set for property 'changeRequestCoverageDiffWithTargetBranch'.
    • getReferenceBuildUrl

      public String getReferenceBuildUrl()
    • setReferenceBuildUrl

      public void setReferenceBuildUrl(String referenceBuildUrl)
    • isSourceFileAvailable

      public boolean isSourceFileAvailable()
      Getter for property 'sourceFileAvailable'.
      Gibt zurück:
      Value for property 'sourceFileAvailable'.
    • hasPermission

      public boolean hasPermission()
    • getSourceFileContent

      public String getSourceFileContent()
      Getter for property 'sourceFileContent'.
      Gibt zurück:
      Value for property 'sourceFileContent'.
    • getParents

      public List<CoverageResult> getParents()
      Getter for property 'parents'.
      Gibt zurück:
      Value for property 'parents'.
    • getChildElements

      public Set<CoverageElement> getChildElements()
      Getter for property 'childElements'.
      Gibt zurück:
      Value for property 'childElements'.
    • getChildElement

      public CoverageElement getChildElement()
    • getChildren

      public Set<String> getChildren(CoverageElement element)
    • getChildren

      public Set<String> getChildren()
      Getter for keys of property 'children'.
      Gibt zurück:
      Value for keys of property 'children'.
    • getChildrenReal

      public Map<String,CoverageResult> getChildrenReal()
    • getResults

      public Map<CoverageElement,Ratio> getResults()
      Angegeben von:
      getResults in Schnittstelle Chartable
    • getDeltaResults

      public Map<CoverageElement,Float> getDeltaResults()
    • setDeltaResults

      public void setDeltaResults(Map<CoverageElement,Float> deltaResults)
    • getResultsAPI

      @Exported(name="results") public CoverageTree getResultsAPI()
      Getter for property 'results'.
      Gibt zurück:
      Value for property 'results'.
    • getCoverageTrends

      public List<CoverageTrend> getCoverageTrends()
    • urlTransform

      public String urlTransform(String name)
    • xmlTransform

      public String xmlTransform(String name)
    • relativeUrl

      public String relativeUrl(CoverageResult parent)
    • getChild

      public CoverageResult getChild(String name)
    • getCoverage

      public Ratio getCoverage(CoverageElement element)
    • getElements

      public Set<CoverageElement> getElements()
    • updateCoverage

      public void updateCoverage(CoverageElement element, Ratio additionalResult)
    • getOwner

      public Run<?,?> getOwner()
      Getter for property 'owner'.
      Angegeben von:
      getOwner in Schnittstelle Chartable
      Gibt zurück:
      Value for property 'owner'.
    • setOwner

      public void setOwner(Run<?,?> owner)
      Setter for property 'owner'.
      Parameter:
      owner - Value to set for property 'owner'.
    • setOwner

      public void setOwner(AbstractBuild<?,?> owner)
    • merge

      public void merge(CoverageResult another) throws CoverageException
      Löst aus:
      CoverageException
    • getTag

      public String getTag()
    • setTag

      public void setTag(String tag)
    • getPreviousResult

      public CoverageResult getPreviousResult()
      Getter for property 'previousResult'.
      Angegeben von:
      getPreviousResult in Schnittstelle Chartable
      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

      public Map<String,CoveragePaint> getPaintedSources()
      Getter for property 'paintedSources'.
      Gibt zurück:
      Value for property 'paintedSources'.
    • getLast

      public Object getLast()
    • addParent

      public void addParent(CoverageResult p)
      add parent for CoverageResult(Only effect when parent is null)
      Parameter:
      p - parent
    • resetParent

      public void resetParent(CoverageResult p)
    • addAdditionalProperty

      public void addAdditionalProperty(String propertyName, String value)
    • getAdditionalProperty

      public Set<String> getAdditionalProperty(String propertyName)
    • jsGetResults

      @JavaScriptMethod public List<CoverageResult.CoverageStatistics> jsGetResults()
      Interface for javascript code to get code coverage result.
      Gibt zurück:
      aggregated coverage results
    • jsGetChildResults

      @JavaScriptMethod public Map<String,List<CoverageResult.CoverageStatistics>> jsGetChildResults()
      Interface for javascript code to get child coverage result.
      Gibt zurück:
      aggregated child coverage results
    • jsGetTrendResults

      @JavaScriptMethod public Map<String,List<CoverageResult.CoverageStatistics>> jsGetTrendResults()
      Interface for javascript code to get code coverage trend.
      Gibt zurück:
      coverage trend
    • getDisplayName

      public String getDisplayName()
      Angegeben von:
      getDisplayName in Schnittstelle ModelObject