aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-batch
diff options
context:
space:
mode:
authorJulien Lancelot <julien.lancelot@sonarsource.com>2015-07-03 12:42:14 +0200
committerJulien Lancelot <julien.lancelot@sonarsource.com>2015-07-03 13:14:43 +0200
commit077bedd2ae941d320372c7c44a170be23a1679a5 (patch)
treedf174bc142d2102b00442f6e39b2a4007d91718c /sonar-batch
parent8d9953d57840d24a7d99d6f263837eaf9ef6addf (diff)
downloadsonarqube-077bedd2ae941d320372c7c44a170be23a1679a5.tar.gz
sonarqube-077bedd2ae941d320372c7c44a170be23a1679a5.zip
SONAR-6680 Move computation of measure Quality Profile to Compute Engine
Diffstat (limited to 'sonar-batch')
-rw-r--r--sonar-batch/src/test/java/org/sonar/batch/mediumtest/measures/MeasuresMediumTest.java2
-rw-r--r--sonar-batch/src/test/java/org/sonar/batch/sensor/DefaultSensorStorageTest.java27
2 files changed, 2 insertions, 27 deletions
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 b46febe1ab5..87d124989ed 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
@@ -65,7 +65,7 @@ public class MeasuresMediumTest {
.newScanTask(new File(projectDir, "sonar-project.properties"))
.start();
- assertThat(result.allMeasures()).hasSize(69);
+ assertThat(result.allMeasures()).hasSize(63);
}
@Test
diff --git a/sonar-batch/src/test/java/org/sonar/batch/sensor/DefaultSensorStorageTest.java b/sonar-batch/src/test/java/org/sonar/batch/sensor/DefaultSensorStorageTest.java
index c42ed5031d9..69b176538a1 100644
--- a/sonar-batch/src/test/java/org/sonar/batch/sensor/DefaultSensorStorageTest.java
+++ b/sonar-batch/src/test/java/org/sonar/batch/sensor/DefaultSensorStorageTest.java
@@ -39,14 +39,13 @@ import org.sonar.api.batch.sensor.measure.internal.DefaultMeasure;
import org.sonar.api.config.Settings;
import org.sonar.api.measures.CoreMetrics;
import org.sonar.api.measures.Measure;
-import org.sonar.api.measures.PersistenceMode;
import org.sonar.api.resources.File;
import org.sonar.api.resources.Project;
import org.sonar.api.resources.Resource;
import org.sonar.api.rule.RuleKey;
import org.sonar.batch.duplication.DuplicationCache;
-import org.sonar.batch.index.DefaultIndex;
import org.sonar.batch.index.BatchComponentCache;
+import org.sonar.batch.index.DefaultIndex;
import org.sonar.batch.issue.ModuleIssues;
import org.sonar.batch.report.ReportPublisher;
import org.sonar.batch.sensor.coverage.CoverageExclusions;
@@ -126,30 +125,6 @@ public class DefaultSensorStorageTest {
}
@Test
- public void shouldSetAppropriatePersistenceMode() {
- // Metric FUNCTION_COMPLEXITY_DISTRIBUTION is only persisted on directories.
-
- InputFile file = new DefaultInputFile("foo", "src/Foo.php");
-
- ArgumentCaptor<org.sonar.api.measures.Measure> argumentCaptor = ArgumentCaptor.forClass(org.sonar.api.measures.Measure.class);
- Resource sonarFile = File.create("src/Foo.php").setEffectiveKey("foo:src/Foo.php");
- resourceCache.add(sonarFile, null).setInputPath(file);
-
- when(sonarIndex.addMeasure(eq(sonarFile), argumentCaptor.capture())).thenReturn(null);
-
- sensorStorage.store(new DefaultMeasure()
- .onFile(file)
- .forMetric(CoreMetrics.FUNCTION_COMPLEXITY_DISTRIBUTION)
- .withValue("foo"));
-
- org.sonar.api.measures.Measure m = argumentCaptor.getValue();
- assertThat(m.getData()).isEqualTo("foo");
- assertThat(m.getMetric()).isEqualTo(CoreMetrics.FUNCTION_COMPLEXITY_DISTRIBUTION);
- assertThat(m.getPersistenceMode()).isEqualTo(PersistenceMode.MEMORY);
-
- }
-
- @Test
public void shouldSaveProjectMeasureToSensorContext() {
ArgumentCaptor<org.sonar.api.measures.Measure> argumentCaptor = ArgumentCaptor.forClass(org.sonar.api.measures.Measure.class);