aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-db
diff options
context:
space:
mode:
authorJulien Lancelot <julien.lancelot@sonarsource.com>2016-03-21 16:17:04 +0100
committerJulien Lancelot <julien.lancelot@sonarsource.com>2016-03-23 13:18:43 +0100
commitdf152833050afc8ca498accf21419947edd7da48 (patch)
treea083293ed685b61719995760f4efdbe01f22d827 /sonar-db
parent9a7197f04bf804f18360409dbe164863627f44f7 (diff)
downloadsonarqube-df152833050afc8ca498accf21419947edd7da48.tar.gz
sonarqube-df152833050afc8ca498accf21419947edd7da48.zip
SONAR-7330 Remove usage of PROJECT_MEASURES.RULE_ID
Diffstat (limited to 'sonar-db')
-rw-r--r--sonar-db/src/main/java/org/sonar/db/measure/MeasureDto.java12
-rw-r--r--sonar-db/src/main/java/org/sonar/db/measure/PastMeasureDto.java10
-rw-r--r--sonar-db/src/main/resources/org/sonar/db/measure/MeasureMapper.xml21
-rw-r--r--sonar-db/src/main/resources/org/sonar/db/purge/PurgeMapper.xml2
-rw-r--r--sonar-db/src/test/java/org/sonar/db/measure/MeasureDaoTest.java44
-rw-r--r--sonar-db/src/test/java/org/sonar/db/measure/PastMeasureDtoTest.java4
-rw-r--r--sonar-db/src/test/resources/org/sonar/db/measure/MeasureDaoTest/insert-result.xml2
-rw-r--r--sonar-db/src/test/resources/org/sonar/db/measure/MeasureDaoTest/past_measures.xml12
-rw-r--r--sonar-db/src/test/resources/org/sonar/db/measure/MeasureDaoTest/past_measures_with_person_id.xml6
-rw-r--r--sonar-db/src/test/resources/org/sonar/db/measure/MeasureDaoTest/past_measures_with_rule_id.xml32
-rw-r--r--sonar-db/src/test/resources/org/sonar/db/measure/MeasureDaoTest/select_by_snapshot_and_metric_keys_with_characteristic_id.xml17
-rw-r--r--sonar-db/src/test/resources/org/sonar/db/measure/MeasureDaoTest/select_by_snapshot_and_metric_keys_with_rule_id.xml17
-rw-r--r--sonar-db/src/test/resources/org/sonar/db/purge/PurgeCommandsTest/shouldDeleteSnapshot-result.xml2
-rw-r--r--sonar-db/src/test/resources/org/sonar/db/purge/PurgeCommandsTest/shouldDeleteSnapshot.xml3
-rw-r--r--sonar-db/src/test/resources/org/sonar/db/purge/PurgeCommandsTest/shouldDeleteWastedMeasuresWhenPurgingSnapshot-result.xml10
-rw-r--r--sonar-db/src/test/resources/org/sonar/db/purge/PurgeCommandsTest/shouldDeleteWastedMeasuresWhenPurgingSnapshot.xml10
16 files changed, 20 insertions, 184 deletions
diff --git a/sonar-db/src/main/java/org/sonar/db/measure/MeasureDto.java b/sonar-db/src/main/java/org/sonar/db/measure/MeasureDto.java
index 1fb9708b6ab..1536d9633be 100644
--- a/sonar-db/src/main/java/org/sonar/db/measure/MeasureDto.java
+++ b/sonar-db/src/main/java/org/sonar/db/measure/MeasureDto.java
@@ -44,7 +44,6 @@ public class MeasureDto {
private Long componentId;
private Long snapshotId;
private Integer metricId;
- private Integer ruleId;
private Long developerId;
// TODO to delete – not in db
@@ -190,13 +189,11 @@ public class MeasureDto {
return this;
}
- @CheckForNull
- public Integer getRuleId() {
- return ruleId;
- }
-
+ /**
+ * @deprecated in 5.5. Does nothing. Kept for compatibility with developer cockpit plugin, version 1.10
+ */
+ @Deprecated
public MeasureDto setRuleId(@Nullable Integer ruleId) {
- this.ruleId = ruleId;
return this;
}
@@ -245,7 +242,6 @@ public class MeasureDto {
.add("componentId", componentId)
.add("snapshotId", snapshotId)
.add("metricId", metricId)
- .add("ruleId", ruleId)
.add("developerId", developerId)
.add("metricKey", metricKey)
.toString();
diff --git a/sonar-db/src/main/java/org/sonar/db/measure/PastMeasureDto.java b/sonar-db/src/main/java/org/sonar/db/measure/PastMeasureDto.java
index 7f32a678832..6e95625af48 100644
--- a/sonar-db/src/main/java/org/sonar/db/measure/PastMeasureDto.java
+++ b/sonar-db/src/main/java/org/sonar/db/measure/PastMeasureDto.java
@@ -28,7 +28,6 @@ public class PastMeasureDto {
private Long id;
private Double value;
private Integer metricId;
- private Integer ruleId;
private Integer personId;
public Long getId() {
@@ -73,13 +72,4 @@ public class PastMeasureDto {
return this;
}
- @CheckForNull
- public Integer getRuleId() {
- return ruleId;
- }
-
- public PastMeasureDto setRuleId(@Nullable Integer ruleId) {
- this.ruleId = ruleId;
- return this;
- }
}
diff --git a/sonar-db/src/main/resources/org/sonar/db/measure/MeasureMapper.xml b/sonar-db/src/main/resources/org/sonar/db/measure/MeasureMapper.xml
index d0747a1a205..4f9f8211536 100644
--- a/sonar-db/src/main/resources/org/sonar/db/measure/MeasureMapper.xml
+++ b/sonar-db/src/main/resources/org/sonar/db/measure/MeasureMapper.xml
@@ -5,7 +5,6 @@
<sql id="measureColumns">
pm.id,
pm.metric_id as metricId,
- pm.rule_id as ruleId,
pm.person_id as developerId,
pm.snapshot_id as snapshotId,
pm.value as value,
@@ -35,8 +34,6 @@
<where>
AND p.kee = #{componentKey}
AND metric.name=#{metricKey}
- AND pm.rule_id IS NULL
- AND pm.characteristic_id IS NULL
AND pm.person_id IS NULL
</where>
</select>
@@ -54,8 +51,6 @@
<foreach item="metricKey" index="index" collection="metricKeys" open="(" separator=" or " close=")">
metric.name=#{metricKey}
</foreach>
- AND pm.rule_id IS NULL
- AND pm.characteristic_id IS NULL
AND pm.person_id IS NULL
</where>
</select>
@@ -81,8 +76,6 @@
FROM project_measures pm
<where>
pm.snapshot_id = #{snapshotId}
- AND pm.rule_id is NULL
- AND pm.characteristic_id is NULL
AND pm.person_id = #{developerId}
AND
<foreach item="metricId" index="index" collection="metricIds" open="(" separator=" or " close=")">
@@ -105,8 +98,6 @@
<foreach item="metricId" collection="metricIds" open="(" separator="," close=")">
#{metricId}
</foreach>
- AND pm.rule_id is NULL
- AND pm.characteristic_id is NULL
AND pm.person_id is NULL
</where>
</select>
@@ -124,8 +115,6 @@
<foreach item="metricId" collection="metricIds" open="(" separator="," close=")">
#{metricId}
</foreach>
- AND pm.rule_id is NULL
- AND pm.characteristic_id is NULL
</where>
</select>
@@ -135,8 +124,6 @@
FROM project_measures pm
<where>
pm.snapshot_id = #{snapshotId}
- AND pm.rule_id is NULL
- AND pm.characteristic_id is NULL
AND pm.person_id is NULL
AND
<foreach item="metricId" index="index" collection="metricIds" open="(" separator=" or " close=")">
@@ -154,15 +141,13 @@
<where>
AND p.kee = #{componentKey}
AND metric.name = #{metricKey}
- AND pm.rule_id IS NULL
- AND pm.characteristic_id IS NULL
AND pm.person_id IS NULL
</where>
</select>
<select id="selectByComponentUuidAndProjectSnapshotIdAndStatusAndMetricIds" parameterType="map"
resultType="org.sonar.db.measure.PastMeasureDto">
- SELECT pm.id as id, pm.metric_id as metricId, pm.rule_id as ruleId,
+ SELECT pm.id as id, pm.metric_id as metricId,
pm.person_id as personId, pm.value as value
FROM project_measures pm
INNER JOIN snapshots s ON s.id=pm.snapshot_id AND s.status=#{status}
@@ -180,12 +165,12 @@
<insert id="insert" parameterType="Measure" useGeneratedKeys="false">
INSERT INTO project_measures (
- value, metric_id, snapshot_id, rule_id, text_value, project_id, alert_status, alert_text, description,
+ value, metric_id, snapshot_id, text_value, project_id, alert_status, alert_text, description,
person_id, variation_value_1, variation_value_2, variation_value_3, variation_value_4,
variation_value_5, measure_data)
VALUES (
#{value, jdbcType=DOUBLE}, #{metricId, jdbcType=INTEGER}, #{snapshotId, jdbcType=INTEGER},
- #{ruleId, jdbcType=INTEGER}, #{textValue, jdbcType=VARCHAR},
+ #{textValue, jdbcType=VARCHAR},
#{componentId, jdbcType=INTEGER}, #{alertStatus, jdbcType=VARCHAR}, #{alertText, jdbcType=VARCHAR},
#{description, jdbcType=VARCHAR},
#{developerId, jdbcType=INTEGER}, #{variation1, jdbcType=DOUBLE}, #{variation2, jdbcType=DOUBLE},
diff --git a/sonar-db/src/main/resources/org/sonar/db/purge/PurgeMapper.xml b/sonar-db/src/main/resources/org/sonar/db/purge/PurgeMapper.xml
index 1185c61863e..5c64bb131ec 100644
--- a/sonar-db/src/main/resources/org/sonar/db/purge/PurgeMapper.xml
+++ b/sonar-db/src/main/resources/org/sonar/db/purge/PurgeMapper.xml
@@ -121,7 +121,7 @@
<foreach collection="snapshotIds" open="(" close=")" item="snapshotId" separator=",">
#{snapshotId}
</foreach>
- and (rule_id is not null or person_id is not null
+ and (person_id is not null
<if test="mids.size()>0">
or metric_id in
<foreach item="mid" index="index" collection="mids" open="(" separator="," close=")">#{mid}</foreach>
diff --git a/sonar-db/src/test/java/org/sonar/db/measure/MeasureDaoTest.java b/sonar-db/src/test/java/org/sonar/db/measure/MeasureDaoTest.java
index a807759c70b..d85f6cbbfce 100644
--- a/sonar-db/src/test/java/org/sonar/db/measure/MeasureDaoTest.java
+++ b/sonar-db/src/test/java/org/sonar/db/measure/MeasureDaoTest.java
@@ -44,7 +44,6 @@ import static com.google.common.collect.Sets.newHashSet;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.guava.api.Assertions.assertThat;
-
public class MeasureDaoTest {
private static final int SNAPSHOT_ID = 5;
@@ -181,7 +180,6 @@ public class MeasureDaoTest {
PastMeasureDto fileMeasure1 = fileMeasures.get(5L);
assertThat(fileMeasure1.getValue()).isEqualTo(5d);
assertThat(fileMeasure1.getMetricId()).isEqualTo(1);
- assertThat(fileMeasure1.getRuleId()).isNull();
assertThat(fileMeasure1.getPersonId()).isNull();
PastMeasureDto fileMeasure2 = fileMeasures.get(6L);
@@ -205,35 +203,6 @@ public class MeasureDaoTest {
}
@Test
- public void select_past_measures_on_rule_by_component_uuid_and_root_snapshot_id_and_metric_keys() {
- db.prepareDbUnit(getClass(), "past_measures_with_rule_id.xml");
- dbSession.commit();
-
- List<PastMeasureDto> measures = underTest.selectByComponentUuidAndProjectSnapshotIdAndMetricIds(dbSession, "ABCD", 1000L, ImmutableSet.of(1));
- assertThat(measures).hasSize(3);
-
- Map<Long, PastMeasureDto> pastMeasuresById = pastMeasuresById(measures);
-
- PastMeasureDto measure1 = pastMeasuresById.get(1L);
- assertThat(measure1.getValue()).isEqualTo(60d);
- assertThat(measure1.getMetricId()).isEqualTo(1);
- assertThat(measure1.getRuleId()).isNull();
- assertThat(measure1.getPersonId()).isNull();
-
- PastMeasureDto measure2 = pastMeasuresById.get(2L);
- assertThat(measure2.getValue()).isEqualTo(20d);
- assertThat(measure2.getMetricId()).isEqualTo(1);
- assertThat(measure2.getRuleId()).isEqualTo(30);
- assertThat(measure2.getPersonId()).isNull();
-
- PastMeasureDto measure3 = pastMeasuresById.get(3L);
- assertThat(measure3.getValue()).isEqualTo(40d);
- assertThat(measure3.getMetricId()).isEqualTo(1);
- assertThat(measure3.getRuleId()).isEqualTo(31);
- assertThat(measure3.getPersonId()).isNull();
- }
-
- @Test
public void select_past_measures_ignore_measures_with_person_id() {
db.prepareDbUnit(getClass(), "past_measures_with_person_id.xml");
@@ -270,19 +239,6 @@ public class MeasureDaoTest {
}
@Test
- public void select_by_snapshot_and_metric_keys_return_measures_with_rule_id() throws Exception {
- db.prepareDbUnit(getClass(), "select_by_snapshot_and_metric_keys_with_rule_id.xml");
-
- List<MeasureDto> results = underTest.selectBySnapshotIdAndMetricKeys(SNAPSHOT_ID, newHashSet("ncloc"), dbSession);
- assertThat(results).hasSize(3);
-
- Map<Long, MeasureDto> measuresById = measuresById(results);
- assertThat(measuresById.get(1L).getRuleId()).isNull();
- assertThat(measuresById.get(2L).getRuleId()).isEqualTo(30);
- assertThat(measuresById.get(3L).getRuleId()).isEqualTo(31);
- }
-
- @Test
public void selectByDeveloperForSnapshotAndMetrics_when_there_is_no_measure_for_developer_returns_empty() {
db.prepareDbUnit(getClass(), "shared.xml");
diff --git a/sonar-db/src/test/java/org/sonar/db/measure/PastMeasureDtoTest.java b/sonar-db/src/test/java/org/sonar/db/measure/PastMeasureDtoTest.java
index 4a6325ee390..2baa68158fd 100644
--- a/sonar-db/src/test/java/org/sonar/db/measure/PastMeasureDtoTest.java
+++ b/sonar-db/src/test/java/org/sonar/db/measure/PastMeasureDtoTest.java
@@ -31,14 +31,12 @@ public class PastMeasureDtoTest {
.setId(10L)
.setValue(1d)
.setMetricId(2)
- .setRuleId(3)
.setPersonId(5);
assertThat(dto.getId()).isEqualTo(10L);
assertThat(dto.hasValue()).isTrue();
assertThat(dto.getValue()).isEqualTo(1d);
assertThat(dto.getMetricId()).isEqualTo(2);
- assertThat(dto.getRuleId()).isEqualTo(3);
assertThat(dto.getPersonId()).isEqualTo(5);
}
@@ -48,14 +46,12 @@ public class PastMeasureDtoTest {
.setId(10L)
.setValue(1d)
.setMetricId(2)
- .setRuleId(3)
.setPersonId(5);
assertThat(measureWithValue.hasValue()).isTrue();
PastMeasureDto measureWithoutValue = new PastMeasureDto()
.setId(10L)
.setMetricId(2)
- .setRuleId(3)
.setPersonId(5);
assertThat(measureWithoutValue.hasValue()).isFalse();
}
diff --git a/sonar-db/src/test/resources/org/sonar/db/measure/MeasureDaoTest/insert-result.xml b/sonar-db/src/test/resources/org/sonar/db/measure/MeasureDaoTest/insert-result.xml
index eff8abfd5bd..ce9ed90d98b 100644
--- a/sonar-db/src/test/resources/org/sonar/db/measure/MeasureDaoTest/insert-result.xml
+++ b/sonar-db/src/test/resources/org/sonar/db/measure/MeasureDaoTest/insert-result.xml
@@ -4,7 +4,7 @@
snapshot_id="2"
metric_id="3"
characteristic_id="[null]"
- rule_id="5"
+ rule_id="[null]"
project_id="6"
person_id="23"
value="2.0"
diff --git a/sonar-db/src/test/resources/org/sonar/db/measure/MeasureDaoTest/past_measures.xml b/sonar-db/src/test/resources/org/sonar/db/measure/MeasureDaoTest/past_measures.xml
index 1a9eaecf522..3c66edfdb2a 100644
--- a/sonar-db/src/test/resources/org/sonar/db/measure/MeasureDaoTest/past_measures.xml
+++ b/sonar-db/src/test/resources/org/sonar/db/measure/MeasureDaoTest/past_measures.xml
@@ -42,18 +42,18 @@
<!-- project measures -->
- <project_measures id="1" VALUE="60" METRIC_ID="1" SNAPSHOT_ID="1000" RULE_ID="[null]" characteristic_id="[null]" person_id="[null]"/>
+ <project_measures id="1" VALUE="60" METRIC_ID="1" SNAPSHOT_ID="1000" person_id="[null]"/>
- <project_measures id="2" VALUE="80" METRIC_ID="2" SNAPSHOT_ID="1000" RULE_ID="[null]" characteristic_id="[null]" person_id="[null]"/>
+ <project_measures id="2" VALUE="80" METRIC_ID="2" SNAPSHOT_ID="1000" person_id="[null]"/>
<!-- package measures -->
- <project_measures id="3" VALUE="20" METRIC_ID="1" SNAPSHOT_ID="1001" RULE_ID="[null]" characteristic_id="[null]" person_id="[null]"/>
+ <project_measures id="3" VALUE="20" METRIC_ID="1" SNAPSHOT_ID="1001" person_id="[null]"/>
- <project_measures id="4" VALUE="70" METRIC_ID="2" SNAPSHOT_ID="1001" RULE_ID="[null]" characteristic_id="[null]" person_id="[null]"/>
+ <project_measures id="4" VALUE="70" METRIC_ID="2" SNAPSHOT_ID="1001" person_id="[null]"/>
<!-- file measures -->
- <project_measures id="5" VALUE="5" METRIC_ID="1" SNAPSHOT_ID="1002" RULE_ID="[null]" characteristic_id="[null]" person_id="[null]"/>
+ <project_measures id="5" VALUE="5" METRIC_ID="1" SNAPSHOT_ID="1002" person_id="[null]"/>
- <project_measures id="6" VALUE="60" METRIC_ID="2" SNAPSHOT_ID="1002" RULE_ID="[null]" characteristic_id="[null]" person_id="[null]"/>
+ <project_measures id="6" VALUE="60" METRIC_ID="2" SNAPSHOT_ID="1002" person_id="[null]"/>
</dataset>
diff --git a/sonar-db/src/test/resources/org/sonar/db/measure/MeasureDaoTest/past_measures_with_person_id.xml b/sonar-db/src/test/resources/org/sonar/db/measure/MeasureDaoTest/past_measures_with_person_id.xml
index 47a1c6933e4..88489e1c20b 100644
--- a/sonar-db/src/test/resources/org/sonar/db/measure/MeasureDaoTest/past_measures_with_person_id.xml
+++ b/sonar-db/src/test/resources/org/sonar/db/measure/MeasureDaoTest/past_measures_with_person_id.xml
@@ -13,10 +13,10 @@
status="P" islast="[false]" depth="0"/>
<!-- project measures -->
- <project_measures id="1" VALUE="60" METRIC_ID="1" SNAPSHOT_ID="1000" RULE_ID="[null]" person_id="[null]"/>
+ <project_measures id="1" VALUE="60" METRIC_ID="1" SNAPSHOT_ID="1000" person_id="[null]"/>
- <project_measures id="2" VALUE="20" METRIC_ID="1" SNAPSHOT_ID="1000" RULE_ID="[null]" person_id="20"/>
+ <project_measures id="2" VALUE="20" METRIC_ID="1" SNAPSHOT_ID="1000" person_id="20"/>
- <project_measures id="3" VALUE="40" METRIC_ID="1" SNAPSHOT_ID="1000" RULE_ID="[null]" person_id="21"/>
+ <project_measures id="3" VALUE="40" METRIC_ID="1" SNAPSHOT_ID="1000" person_id="21"/>
</dataset>
diff --git a/sonar-db/src/test/resources/org/sonar/db/measure/MeasureDaoTest/past_measures_with_rule_id.xml b/sonar-db/src/test/resources/org/sonar/db/measure/MeasureDaoTest/past_measures_with_rule_id.xml
deleted file mode 100644
index b6ccf49fca2..00000000000
--- a/sonar-db/src/test/resources/org/sonar/db/measure/MeasureDaoTest/past_measures_with_rule_id.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<dataset>
-
- <metrics delete_historical_data="[null]" id="1" name="minor_violations" VAL_TYPE="INT" DESCRIPTION="[null]" enabled="[true]"/>
-
- <rules tags="[null]" system_tags="[null]" id="30" name="Classes that override clone should be Cloneable and call super.clone()"
- plugin_rule_key="S1182"
- plugin_config_key="S1182" plugin_name="squid" description="[null]" priority="4" status="READY"
- is_template="[false]" template_id="[null]"/>
-
- <rules tags="[null]" system_tags="[null]" id="31" name="Overriding methods should do more than simply call the same method in the super class"
- plugin_rule_key="S1185"
- plugin_config_key="S1185" plugin_name="squid" description="[null]" priority="1" status="READY"
- is_template="[false]" template_id="[null]"/>
-
- <!-- project -->
- <projects long_name="[null]" id="1" scope="PRJ" qualifier="TRK" kee="project" name="project"
- root_id="[null]" uuid="ABCD" project_uuid="ABCD" module_uuid="[null]" module_uuid_path=".ABCD."
- enabled="[true]"/>
-
- <!-- snapshots -->
- <snapshots id="1000" project_id="1" parent_snapshot_id="[null]" root_project_id="1" root_snapshot_id="[null]"
- scope="PRJ" qualifier="TRK" created_at="1225544280000" build_date="1225544280000" version="[null]" path=""
- status="P" islast="[false]" depth="0"/>
-
- <!-- project measures -->
- <project_measures id="1" VALUE="60" METRIC_ID="1" SNAPSHOT_ID="1000" RULE_ID="[null]" characteristic_id="[null]" person_id="[null]"/>
-
- <project_measures id="2" VALUE="20" METRIC_ID="1" SNAPSHOT_ID="1000" RULE_ID="30" characteristic_id="[null]" person_id="[null]"/>
-
- <project_measures id="3" VALUE="40" METRIC_ID="1" SNAPSHOT_ID="1000" RULE_ID="31" characteristic_id="[null]" person_id="[null]"/>
-
-</dataset>
diff --git a/sonar-db/src/test/resources/org/sonar/db/measure/MeasureDaoTest/select_by_snapshot_and_metric_keys_with_characteristic_id.xml b/sonar-db/src/test/resources/org/sonar/db/measure/MeasureDaoTest/select_by_snapshot_and_metric_keys_with_characteristic_id.xml
deleted file mode 100644
index 8f451b78d8b..00000000000
--- a/sonar-db/src/test/resources/org/sonar/db/measure/MeasureDaoTest/select_by_snapshot_and_metric_keys_with_characteristic_id.xml
+++ /dev/null
@@ -1,17 +0,0 @@
-<dataset>
-
- <metrics id="10" name="authors_by_line"/>
- <metrics id="11" name="coverage_line_hits_data"/>
- <metrics id="12" name="ncloc"/>
-
- <projects id="1" kee="org.struts:struts-core:src/org/struts/RequestContext.java" enabled="[true]"/>
-
- <snapshots id="5" project_id="1" islast="[true]" />
-
- <project_measures id="1" VALUE="60" METRIC_ID="12" SNAPSHOT_ID="5" RULE_ID="[null]" characteristic_id="[null]" person_id="[null]"/>
-
- <project_measures id="2" VALUE="20" METRIC_ID="12" SNAPSHOT_ID="5" RULE_ID="[null]" characteristic_id="10" person_id="[null]"/>
-
- <project_measures id="3" VALUE="40" METRIC_ID="12" SNAPSHOT_ID="5" RULE_ID="[null]" characteristic_id="11" person_id="[null]"/>
-
-</dataset>
diff --git a/sonar-db/src/test/resources/org/sonar/db/measure/MeasureDaoTest/select_by_snapshot_and_metric_keys_with_rule_id.xml b/sonar-db/src/test/resources/org/sonar/db/measure/MeasureDaoTest/select_by_snapshot_and_metric_keys_with_rule_id.xml
deleted file mode 100644
index 1398c2447f8..00000000000
--- a/sonar-db/src/test/resources/org/sonar/db/measure/MeasureDaoTest/select_by_snapshot_and_metric_keys_with_rule_id.xml
+++ /dev/null
@@ -1,17 +0,0 @@
-<dataset>
-
- <metrics id="10" name="authors_by_line"/>
- <metrics id="11" name="coverage_line_hits_data"/>
- <metrics id="12" name="ncloc"/>
-
- <projects id="1" kee="org.struts:struts-core:src/org/struts/RequestContext.java" enabled="[true]"/>
-
- <snapshots id="5" project_id="1" islast="[true]" />
-
- <project_measures id="1" VALUE="60" METRIC_ID="12" SNAPSHOT_ID="5" RULE_ID="[null]" characteristic_id="[null]" person_id="[null]"/>
-
- <project_measures id="2" VALUE="20" METRIC_ID="12" SNAPSHOT_ID="5" RULE_ID="30" characteristic_id="[null]" person_id="[null]"/>
-
- <project_measures id="3" VALUE="40" METRIC_ID="12" SNAPSHOT_ID="5" RULE_ID="31" characteristic_id="[null]" person_id="[null]"/>
-
-</dataset>
diff --git a/sonar-db/src/test/resources/org/sonar/db/purge/PurgeCommandsTest/shouldDeleteSnapshot-result.xml b/sonar-db/src/test/resources/org/sonar/db/purge/PurgeCommandsTest/shouldDeleteSnapshot-result.xml
index f17226a159a..4cdaecd90fd 100644
--- a/sonar-db/src/test/resources/org/sonar/db/purge/PurgeCommandsTest/shouldDeleteSnapshot-result.xml
+++ b/sonar-db/src/test/resources/org/sonar/db/purge/PurgeCommandsTest/shouldDeleteSnapshot-result.xml
@@ -18,7 +18,7 @@
variation_value_5="[null]"
rule_priority="[null]"
alert_text="[null]" VALUE="10.0" METRIC_ID="1" SNAPSHOT_ID="1" rules_category_id="[null]"
- RULE_ID="1"
+ RULE_ID="[null]"
person_id="[null]"
text_value="[null]" tendency="[null]" measure_date="[null]" project_id="[null]"
alert_status="[null]" description="[null]" measure_data="[null]"/>
diff --git a/sonar-db/src/test/resources/org/sonar/db/purge/PurgeCommandsTest/shouldDeleteSnapshot.xml b/sonar-db/src/test/resources/org/sonar/db/purge/PurgeCommandsTest/shouldDeleteSnapshot.xml
index 3f756fc37d3..299c31cb5ce 100644
--- a/sonar-db/src/test/resources/org/sonar/db/purge/PurgeCommandsTest/shouldDeleteSnapshot.xml
+++ b/sonar-db/src/test/resources/org/sonar/db/purge/PurgeCommandsTest/shouldDeleteSnapshot.xml
@@ -17,7 +17,6 @@
variation_value_5="[null]"
rule_priority="[null]"
alert_text="[null]" VALUE="10.0" METRIC_ID="1" SNAPSHOT_ID="1" rules_category_id="[null]"
- RULE_ID="1"
person_id="[null]"
text_value="[null]" tendency="[null]" measure_date="[null]" project_id="[null]"
alert_status="[null]" description="[null]" measure_data="[null]"/>
@@ -44,7 +43,7 @@
variation_value_5="[null]"
rule_priority="[null]"
alert_text="[null]" VALUE="10.0" METRIC_ID="1" SNAPSHOT_ID="5" rules_category_id="[null]"
- RULE_ID="1"
+ RULE_ID="[null]"
person_id="[null]"
text_value="[null]" tendency="[null]" measure_date="[null]" project_id="[null]"
alert_status="[null]" description="[null]" measure_data="[null]"/>
diff --git a/sonar-db/src/test/resources/org/sonar/db/purge/PurgeCommandsTest/shouldDeleteWastedMeasuresWhenPurgingSnapshot-result.xml b/sonar-db/src/test/resources/org/sonar/db/purge/PurgeCommandsTest/shouldDeleteWastedMeasuresWhenPurgingSnapshot-result.xml
index f326322849d..62301d952b6 100644
--- a/sonar-db/src/test/resources/org/sonar/db/purge/PurgeCommandsTest/shouldDeleteWastedMeasuresWhenPurgingSnapshot-result.xml
+++ b/sonar-db/src/test/resources/org/sonar/db/purge/PurgeCommandsTest/shouldDeleteWastedMeasuresWhenPurgingSnapshot-result.xml
@@ -31,16 +31,6 @@
text_value="[null]" tendency="[null]" measure_date="[null]" alert_status="[null]"
description="[null]" measure_data="[null]"/>
- <!-- delete measure on rule -->
- <!--<project_measures ID="2" project_id="1" SNAPSHOT_ID="1" RULE_ID="33" characteristic_id="[null]" METRIC_ID="1"
- url="[null]" variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]"
- variation_value_4="[null]"
- variation_value_5="[null]" rule_priority="[null]" alert_text="[null]" VALUE="10.0"
- rules_category_id="[null]"
- person_id="[null]"
- text_value="[null]" tendency="[null]" measure_date="[null]" alert_status="[null]"
- description="[null]" measure_data="[null]"/>-->
-
<!-- do not delete measure on characteristic -->
<project_measures id="3" project_id="1" snapshot_id="1" rule_id="[null]" characteristic_id="1" metric_id="1"
url="[null]" variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]"
diff --git a/sonar-db/src/test/resources/org/sonar/db/purge/PurgeCommandsTest/shouldDeleteWastedMeasuresWhenPurgingSnapshot.xml b/sonar-db/src/test/resources/org/sonar/db/purge/PurgeCommandsTest/shouldDeleteWastedMeasuresWhenPurgingSnapshot.xml
index 17c989e1392..9475e5ec6fb 100644
--- a/sonar-db/src/test/resources/org/sonar/db/purge/PurgeCommandsTest/shouldDeleteWastedMeasuresWhenPurgingSnapshot.xml
+++ b/sonar-db/src/test/resources/org/sonar/db/purge/PurgeCommandsTest/shouldDeleteWastedMeasuresWhenPurgingSnapshot.xml
@@ -31,16 +31,6 @@
text_value="[null]" tendency="[null]" measure_date="[null]" alert_status="[null]"
description="[null]" measure_data="[null]"/>
- <!-- delete measure on rule -->
- <project_measures id="2" project_id="1" snapshot_id="1" rule_id="33" characteristic_id="[null]" metric_id="1"
- url="[null]" variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]"
- variation_value_4="[null]"
- variation_value_5="[null]" rule_priority="[null]" alert_text="[null]" value="10.0"
- rules_category_id="[null]"
- person_id="[null]"
- text_value="[null]" tendency="[null]" measure_date="[null]" alert_status="[null]"
- description="[null]" measure_data="[null]"/>
-
<!-- do not delete measure on root characteristic -->
<project_measures id="3" project_id="1" snapshot_id="1" rule_id="[null]" characteristic_id="1" metric_id="1"
url="[null]" variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]"