Klasse CoverageBuildAction

java.lang.Object
io.jenkins.plugins.util.BuildAction<edu.hm.hafner.coverage.Node>
io.jenkins.plugins.coverage.metrics.steps.CoverageBuildAction
Alle implementierten Schnittstellen:
Action, ModelObject, Serializable, RunAction2, SimpleBuildStep.LastBuildAction, org.kohsuke.stapler.StaplerProxy

public final class CoverageBuildAction extends io.jenkins.plugins.util.BuildAction<edu.hm.hafner.coverage.Node> implements org.kohsuke.stapler.StaplerProxy
Controls the life cycle of the coverage results in a job. This action persists the results of a build and displays a summary on the build page. The actual visualization of the results is defined in the matching summary.jelly file. This action also provides access to the coverage details: these are rendered using a new view instance.
Autor:
Ullrich Hafner
Siehe auch:
  • Konstruktordetails

    • CoverageBuildAction

      public CoverageBuildAction(Run<?,?> owner, String id, String optionalName, String icon, edu.hm.hafner.coverage.Node result, io.jenkins.plugins.util.QualityGateResult qualityGateResult, edu.hm.hafner.util.FilteredLog log)
      Creates a new instance of CoverageBuildAction.
      Parameter:
      owner - the associated build that created the statistics
      id - ID (URL) of the results
      optionalName - optional name that overrides the default name of the results
      icon - name of the icon that should be used in actions and views
      result - the coverage tree as a result to persist with this action
      qualityGateResult - status of the quality gates
      log - the logging statements of the recording step
    • CoverageBuildAction

      public CoverageBuildAction(Run<?,?> owner, String id, String optionalName, String icon, edu.hm.hafner.coverage.Node result, io.jenkins.plugins.util.QualityGateResult qualityGateResult, edu.hm.hafner.util.FilteredLog log, String referenceBuildId, NavigableMap<edu.hm.hafner.coverage.Metric,org.apache.commons.lang3.math.Fraction> delta, List<? extends edu.hm.hafner.coverage.Value> modifiedLinesCoverage, NavigableMap<edu.hm.hafner.coverage.Metric,org.apache.commons.lang3.math.Fraction> modifiedLinesCoverageDifference, List<? extends edu.hm.hafner.coverage.Value> modifiedFilesCoverage, NavigableMap<edu.hm.hafner.coverage.Metric,org.apache.commons.lang3.math.Fraction> modifiedFilesCoverageDifference, List<? extends edu.hm.hafner.coverage.Value> indirectCoverageChanges)
      Creates a new instance of CoverageBuildAction.
      Parameter:
      owner - the associated build that created the statistics
      id - ID (URL) of the results
      optionalName - optional name that overrides the default name of the results
      icon - name of the icon that should be used in actions and views
      result - the coverage tree as a result to persist with this action
      qualityGateResult - status of the quality gates
      log - the logging statements of the recording step
      referenceBuildId - the ID of the reference build
      delta - delta of this build's coverages with respect to the reference build
      modifiedLinesCoverage - the coverages filtered by modified lines of the associated change request
      modifiedLinesCoverageDifference - difference between the project coverage and the modified lines coverage of the current build
      modifiedFilesCoverage - the coverages filtered by changed files of the associated change request
      modifiedFilesCoverageDifference - difference between the project coverage and the modified files coverage of the current build
      indirectCoverageChanges - the indirect coverage changes of the associated change request with respect to the reference build
  • Methodendetails

    • readResolve

      protected Object readResolve()
      Setzt außer Kraft:
      readResolve in Klasse io.jenkins.plugins.util.BuildAction<edu.hm.hafner.coverage.Node>
    • getLog

      public edu.hm.hafner.util.FilteredLog getLog()
    • getQualityGateResult

      public io.jenkins.plugins.util.QualityGateResult getQualityGateResult()
    • getFormatter

      public ElementFormatter getFormatter()
    • getStatistics

      public CoverageStatistics getStatistics()
    • getBaselines

      public List<Baseline> getBaselines()
      Returns the supported baselines.
      Gibt zurück:
      all supported baselines
    • hasBaselineResult

      public boolean hasBaselineResult(Baseline baseline)
      Returns whether a delta metric for the specified metric exists.
      Parameter:
      baseline - the baseline to use
      Gibt zurück:
      true if a delta is available for the specified metric, false otherwise
    • getDeltaBaseline

      public Baseline getDeltaBaseline(Baseline baseline)
      Returns the associate delta baseline for the specified baseline.
      Parameter:
      baseline - the baseline to get the delta baseline for
      Gibt zurück:
      the delta baseline
      Löst aus:
      NoSuchElementException - if this baseline does not provide a delta baseline
    • getTitle

      public String getTitle(Baseline baseline)
      Returns the title text for the specified baseline.
      Parameter:
      baseline - the baseline to get the title for
      Gibt zurück:
      the title
    • getAllValues

      public List<edu.hm.hafner.coverage.Value> getAllValues(Baseline baseline)
      Returns all available values for the specified baseline.
      Parameter:
      baseline - the baseline to get the values for
      Gibt zurück:
      the available values
      Löst aus:
      NoSuchElementException - if this baseline does not provide values
    • getAllDeltas

      public NavigableMap<edu.hm.hafner.coverage.Metric,org.apache.commons.lang3.math.Fraction> getAllDeltas(Baseline baseline)
      Returns all available deltas for the specified baseline.
      Parameter:
      baseline - the baseline to get the deltas for
      Gibt zurück:
      the available values
      Löst aus:
      NoSuchElementException - if this baseline does not provide deltas
    • getValues

      public List<edu.hm.hafner.coverage.Value> getValues(Baseline baseline)
      Returns all important values for the specified baseline.
      Parameter:
      baseline - the baseline to get the values for
      Gibt zurück:
      the available values
      Löst aus:
      NoSuchElementException - if this baseline does not provide values
    • getValueForMetric

      public Optional<edu.hm.hafner.coverage.Value> getValueForMetric(Baseline baseline, edu.hm.hafner.coverage.Metric metric)
      Returns the value for the specified metric, if available.
      Parameter:
      baseline - the baseline to get the value for
      metric - the metric to get the value for
      Gibt zurück:
      the optional value
    • hasDelta

      public boolean hasDelta(Baseline baseline)
      Returns whether a delta metric for the specified baseline exists.
      Parameter:
      baseline - the baseline to use
      Gibt zurück:
      true if a delta is available for the specified baseline, false otherwise
    • hasDelta

      public boolean hasDelta(Baseline baseline, edu.hm.hafner.coverage.Metric metric)
      Returns whether a delta metric for the specified metric exists.
      Parameter:
      baseline - the baseline to use
      metric - the metric to check
      Gibt zurück:
      true if a delta is available for the specified metric, false otherwise
    • getDelta

      public Optional<org.apache.commons.lang3.math.Fraction> getDelta(Baseline baseline, edu.hm.hafner.coverage.Metric metric)
      Returns whether a delta metric for the specified metric exists.
      Parameter:
      baseline - the baseline to use
      metric - the metric to check
      Gibt zurück:
      true if a delta is available for the specified metric, false otherwise
    • hasValue

      public boolean hasValue(Baseline baseline, edu.hm.hafner.coverage.Metric metric)
      Returns whether a value for the specified metric exists.
      Parameter:
      baseline - the baseline to use
      metric - the metric to check
      Gibt zurück:
      true if a value is available for the specified metric, false otherwise
    • formatValue

      public String formatValue(Baseline baseline, edu.hm.hafner.coverage.Metric metric)
      Returns a formatted and localized String representation of the value for the specified metric (with respect to the given baseline).
      Parameter:
      baseline - the baseline to use
      metric - the metric to get the delta for
      Gibt zurück:
      the formatted value
    • formatDelta

      public String formatDelta(Baseline baseline, edu.hm.hafner.coverage.Metric metric)
      Returns a formatted and localized String representation of the delta for the specified metric (with respect to the given baseline).
      Parameter:
      baseline - the baseline to use
      metric - the metric to get the delta for
      Gibt zurück:
      the delta metric
    • getTrend

      public double getTrend(Baseline baseline, edu.hm.hafner.coverage.Metric metric)
      Returns whether the trend of the values for the specific metric is positive or negative.
      Parameter:
      baseline - the baseline to use
      metric - the metric to check
      Gibt zurück:
      a positive value if the trend is positive, a negative value if the trend is negative, or 0 if there is no significant change in the trend
    • getReferenceBuild

      public Optional<Run<?,?>> getReferenceBuild()
      Returns the possible reference build that has been used to compute the coverage delta.
      Gibt zurück:
      the reference build, if available
    • getReferenceBuildLink

      public String getReferenceBuildLink()
      Renders the reference build as an HTML link.
      Gibt zurück:
      the reference build
      Siehe auch:
    • createXmlStream

      protected io.jenkins.plugins.util.AbstractXmlStream<edu.hm.hafner.coverage.Node> createXmlStream()
      Angegeben von:
      createXmlStream in Klasse io.jenkins.plugins.util.BuildAction<edu.hm.hafner.coverage.Node>
    • createProjectAction

      protected io.jenkins.plugins.util.JobAction<? extends io.jenkins.plugins.util.BuildAction<edu.hm.hafner.coverage.Node>> createProjectAction()
      Angegeben von:
      createProjectAction in Klasse io.jenkins.plugins.util.BuildAction<edu.hm.hafner.coverage.Node>
    • getBuildResultBaseName

      protected String getBuildResultBaseName()
      Angegeben von:
      getBuildResultBaseName in Klasse io.jenkins.plugins.util.BuildAction<edu.hm.hafner.coverage.Node>
    • getTarget

      public CoverageViewModel getTarget()
      Angegeben von:
      getTarget in Schnittstelle org.kohsuke.stapler.StaplerProxy
    • getIconFileName

      @NonNull public String getIconFileName()
      Angegeben von:
      getIconFileName in Schnittstelle Action
    • getDisplayName

      @NonNull public String getDisplayName()
      Angegeben von:
      getDisplayName in Schnittstelle Action
      Angegeben von:
      getDisplayName in Schnittstelle ModelObject
    • getUrlName

      @NonNull public String getUrlName()
      Angegeben von:
      getUrlName in Schnittstelle Action
    • toString

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