aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-batch
diff options
context:
space:
mode:
authorsimonbrandhof <simon.brandhof@gmail.com>2010-12-01 22:09:09 +0000
committersimonbrandhof <simon.brandhof@gmail.com>2010-12-01 22:09:09 +0000
commit473065f87a746470a2d9c431155db0584805b95b (patch)
tree2473c9ce5c7c06b7d94f7d4596c668e07e486a78 /sonar-batch
parent87d0f9a556fcac9bc7b85c6219de50abca87e28e (diff)
downloadsonarqube-473065f87a746470a2d9c431155db0584805b95b.tar.gz
sonarqube-473065f87a746470a2d9c431155db0584805b95b.zip
SONAR-249 save configuration used for measure variations and new violations in the table SNAPSHOTS
Diffstat (limited to 'sonar-batch')
-rw-r--r--sonar-batch/src/main/java/org/sonar/batch/DefaultTimeMachine.java6
-rw-r--r--sonar-batch/src/main/java/org/sonar/batch/index/MeasurePersister.java12
-rw-r--r--sonar-batch/src/test/java/org/sonar/batch/index/MeasurePersisterTest.java4
3 files changed, 11 insertions, 11 deletions
diff --git a/sonar-batch/src/main/java/org/sonar/batch/DefaultTimeMachine.java b/sonar-batch/src/main/java/org/sonar/batch/DefaultTimeMachine.java
index 6a2f85bbd89..824cc7d774c 100644
--- a/sonar-batch/src/main/java/org/sonar/batch/DefaultTimeMachine.java
+++ b/sonar-batch/src/main/java/org/sonar/batch/DefaultTimeMachine.java
@@ -146,9 +146,9 @@ public class DefaultTimeMachine implements TimeMachine {
measure.setAlertStatus(model.getAlertStatus());
measure.setAlertText(model.getAlertText());
measure.setTendency(model.getTendency());
- measure.setDiffValue1(model.getDiffValue1());
- measure.setDiffValue2(model.getDiffValue2());
- measure.setDiffValue3(model.getDiffValue3());
+ measure.setVariation1(model.getDiffValue1());
+ measure.setVariation2(model.getDiffValue2());
+ measure.setVariation3(model.getDiffValue3());
measure.setUrl(model.getUrl());
measure.setCharacteristic(model.getCharacteristic());
return measure;
diff --git a/sonar-batch/src/main/java/org/sonar/batch/index/MeasurePersister.java b/sonar-batch/src/main/java/org/sonar/batch/index/MeasurePersister.java
index ab8375835b2..79eab354dec 100644
--- a/sonar-batch/src/main/java/org/sonar/batch/index/MeasurePersister.java
+++ b/sonar-batch/src/main/java/org/sonar/batch/index/MeasurePersister.java
@@ -100,9 +100,9 @@ public final class MeasurePersister {
measure.getTendency() == null &&
measure.getUrl() == null &&
measure.getData() == null &&
- (measure.getDiffValue1() == null || NumberUtils.compare(measure.getDiffValue1().doubleValue(), 0.0) == 0) &&
- (measure.getDiffValue2() == null || NumberUtils.compare(measure.getDiffValue2().doubleValue(), 0.0) == 0) &&
- (measure.getDiffValue3() == null || NumberUtils.compare(measure.getDiffValue3().doubleValue(), 0.0) == 0);
+ (measure.getVariation1() == null || NumberUtils.compare(measure.getVariation1().doubleValue(), 0.0) == 0) &&
+ (measure.getVariation2() == null || NumberUtils.compare(measure.getVariation2().doubleValue(), 0.0) == 0) &&
+ (measure.getVariation3() == null || NumberUtils.compare(measure.getVariation3().doubleValue(), 0.0) == 0);
}
public void dump() {
@@ -135,9 +135,9 @@ public final class MeasurePersister {
merge.setAlertStatus(measure.getAlertStatus());
merge.setAlertText(measure.getAlertText());
merge.setTendency(measure.getTendency());
- merge.setDiffValue1(measure.getDiffValue1());
- merge.setDiffValue2(measure.getDiffValue2());
- merge.setDiffValue3(measure.getDiffValue3());
+ merge.setDiffValue1(measure.getVariation1());
+ merge.setDiffValue2(measure.getVariation2());
+ merge.setDiffValue3(measure.getVariation3());
merge.setUrl(measure.getUrl());
merge.setCharacteristic(measure.getCharacteristic());
if (measure.getValue() != null) {
diff --git a/sonar-batch/src/test/java/org/sonar/batch/index/MeasurePersisterTest.java b/sonar-batch/src/test/java/org/sonar/batch/index/MeasurePersisterTest.java
index aa7f42a44bb..c14b147d84d 100644
--- a/sonar-batch/src/test/java/org/sonar/batch/index/MeasurePersisterTest.java
+++ b/sonar-batch/src/test/java/org/sonar/batch/index/MeasurePersisterTest.java
@@ -196,10 +196,10 @@ public class MeasurePersisterTest extends AbstractDbUnitTestCase {
Measure duplicatedLines = new Measure(CoreMetrics.DUPLICATED_LINES_DENSITY, 0.0);
assertThat(MeasurePersister.shouldPersistMeasure(file, duplicatedLines), is(false));
- duplicatedLines.setDiffValue1(0.0);
+ duplicatedLines.setVariation1(0.0);
assertThat(MeasurePersister.shouldPersistMeasure(file, duplicatedLines), is(false));
- duplicatedLines.setDiffValue1(-3.0);
+ duplicatedLines.setVariation1(-3.0);
assertThat(MeasurePersister.shouldPersistMeasure(file, duplicatedLines), is(true));
}