Package hudson.plugins.cobertura

Examples of hudson.plugins.cobertura.Ratio


            Map<CoverageMetric, Ratio> runningTotal) {
        Map<CoverageMetric, Ratio> result = new EnumMap<CoverageMetric, Ratio>(CoverageMetric.class);
        result.putAll(runningTotal);
        for (CoverageAggregationRule rule : INITIAL_RULESET) {
            if (rule.source == source && rule.input == input) {
                Ratio prevTotal = result.get(rule.output);
                if (prevTotal == null) {
                    prevTotal = rule.mode.ZERO;
                }

                result.put(rule.output, rule.mode.aggregate(prevTotal, inputResult));
View Full Code Here


      }
    }
   
    public void updateMetric(CoverageMetric metric, Ratio additionalResult) {
        if (localResults.containsKey(metric)) {
            Ratio existingResult = localResults.get(metric);
            localResults.put(metric, CoverageAggregationRule.combine(metric, existingResult, additionalResult));
        } else {
            localResults.put(metric, additionalResult);
        }
    }
View Full Code Here

    }

    public Set<CoverageMetric> getFailingMetrics(CoverageResult coverage) {
        Set<CoverageMetric> result = EnumSet.noneOf(CoverageMetric.class);
        for (Map.Entry<CoverageMetric, Integer> target : this.targets.entrySet()) {
            Ratio observed = coverage.getCoverage(target.getKey());
            if (observed != null && roundFloatDecimal(observed.getPercentageFloat()) < (float) (target.getValue() / 100000f)) {
                result.add(target.getKey());
            }
        }

        return result;
View Full Code Here

    }

    public Set<CoverageMetric> getAllMetrics(CoverageResult coverage) {
        Set<CoverageMetric> result = EnumSet.noneOf(CoverageMetric.class);
        for (Map.Entry<CoverageMetric, Integer> target : this.targets.entrySet()) {
            Ratio observed = coverage.getCoverage(target.getKey());
            if (observed != null) {
                result.add(target.getKey());
            }
        }
View Full Code Here

        return result;
    }

    public float getObservedPercent(CoverageResult coverage, CoverageMetric key) {
        for (Map.Entry<CoverageMetric, Integer> target : this.targets.entrySet()) {
            Ratio observed = coverage.getCoverage(target.getKey());
            if (target.getKey() == key) {
                return roundFloatDecimal(observed.getPercentageFloat());
            }
        }
        return 0;
    }
View Full Code Here

    public Map<CoverageMetric, Integer> getRangeScores(CoverageTarget min, Map<CoverageMetric, Ratio> results) {
        Integer j;
        Map<CoverageMetric, Integer> result = new EnumMap<CoverageMetric, Integer>(CoverageMetric.class);
        for (Map.Entry<CoverageMetric, Integer> target : this.targets.entrySet()) {
            Ratio observed = results.get(target.getKey());
            if (observed != null) {
                j = CoverageTarget.calcRangeScore(target.getValue() / 100000, min.targets.get(target.getKey()), observed.getPercentage());
                result.put(target.getKey(), Integer.valueOf(j));
            }
        }
        return result;
    }
View Full Code Here

TOP

Related Classes of hudson.plugins.cobertura.Ratio

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.