From db4af09e8b2c1f44f25a689c3165f5f6d8c01126 Mon Sep 17 00:00:00 2001 From: Sébastien Lesaint Date: Thu, 23 Jul 2015 12:31:30 +0200 Subject: SONAR-6605 forgotten Formula in CoreMetrics for Metrics moved to CE --- .../batch/deprecated/decorator/FormulaDecoratorTest.java | 14 +++----------- .../batch/mediumtest/measures/MeasuresMediumTest.java | 4 ++-- .../src/main/java/org/sonar/api/measures/CoreMetrics.java | 2 -- 3 files changed, 5 insertions(+), 15 deletions(-) diff --git a/sonar-batch/src/test/java/org/sonar/batch/deprecated/decorator/FormulaDecoratorTest.java b/sonar-batch/src/test/java/org/sonar/batch/deprecated/decorator/FormulaDecoratorTest.java index 2298a09cb33..075e77efffd 100644 --- a/sonar-batch/src/test/java/org/sonar/batch/deprecated/decorator/FormulaDecoratorTest.java +++ b/sonar-batch/src/test/java/org/sonar/batch/deprecated/decorator/FormulaDecoratorTest.java @@ -19,6 +19,9 @@ */ package org.sonar.batch.deprecated.decorator; +import java.util.Arrays; +import java.util.Collections; +import java.util.List; import org.junit.Test; import org.sonar.api.batch.DecoratorContext; import org.sonar.api.measures.CoreMetrics; @@ -29,13 +32,7 @@ import org.sonar.api.measures.Measure; import org.sonar.api.measures.Metric; import org.sonar.api.test.IsMeasure; -import java.util.Arrays; -import java.util.Collections; -import java.util.List; - import static org.assertj.core.api.Assertions.assertThat; -import static org.hamcrest.core.Is.is; -import static org.junit.Assert.assertThat; import static org.mockito.Matchers.any; import static org.mockito.Matchers.argThat; import static org.mockito.Mockito.mock; @@ -45,11 +42,6 @@ import static org.mockito.Mockito.when; public class FormulaDecoratorTest { - @Test - public void doAlwaysExecute() { - assertThat(new FormulaDecorator(CoreMetrics.LINES).shouldExecuteOnProject(null), is(true)); - } - @Test public void declareDependencies() { Formula formula = new Formula() { diff --git a/sonar-batch/src/test/java/org/sonar/batch/mediumtest/measures/MeasuresMediumTest.java b/sonar-batch/src/test/java/org/sonar/batch/mediumtest/measures/MeasuresMediumTest.java index 10f7657e886..ae97beaec18 100644 --- a/sonar-batch/src/test/java/org/sonar/batch/mediumtest/measures/MeasuresMediumTest.java +++ b/sonar-batch/src/test/java/org/sonar/batch/mediumtest/measures/MeasuresMediumTest.java @@ -67,7 +67,7 @@ public class MeasuresMediumTest { .newScanTask(new File(tmpDir, "sonar-project.properties")) .start(); - assertThat(result.allMeasures()).hasSize(18); + assertThat(result.allMeasures()).hasSize(13); } @Test @@ -94,7 +94,7 @@ public class MeasuresMediumTest { .build()) .start(); - assertThat(result.allMeasures()).hasSize(4); + assertThat(result.allMeasures()).hasSize(2); assertThat(result.allMeasures()).contains(new DefaultMeasure() .forMetric(CoreMetrics.LINES) diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/measures/CoreMetrics.java b/sonar-plugin-api/src/main/java/org/sonar/api/measures/CoreMetrics.java index c1705f2d947..b6207f33ca0 100644 --- a/sonar-plugin-api/src/main/java/org/sonar/api/measures/CoreMetrics.java +++ b/sonar-plugin-api/src/main/java/org/sonar/api/measures/CoreMetrics.java @@ -64,7 +64,6 @@ public final class CoreMetrics { .setDirection(Metric.DIRECTION_WORST) .setQualitative(false) .setDomain(DOMAIN_SIZE) - .setFormula(new SumChildValuesFormula(false)) .create(); public static final String GENERATED_LINES_KEY = "generated_lines"; @@ -83,7 +82,6 @@ public final class CoreMetrics { .setDirection(Metric.DIRECTION_WORST) .setQualitative(false) .setDomain(DOMAIN_SIZE) - .setFormula(new SumChildValuesFormula(false)) .create(); /** -- cgit v1.2.3