]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-2329 NonUniqueResultException occurs when analyzing both a maven module and...
authorsimonbrandhof <simon.brandhof@gmail.com>
Tue, 12 Apr 2011 19:56:52 +0000 (21:56 +0200)
committersimonbrandhof <simon.brandhof@gmail.com>
Tue, 12 Apr 2011 19:56:52 +0000 (21:56 +0200)
sonar-batch/src/main/java/org/sonar/batch/phases/UpdateStatusJob.java
sonar-batch/src/test/java/org/sonar/batch/phases/UpdateStatusJobTest.java
sonar-batch/src/test/resources/org/sonar/batch/phases/UpdateStatusJobTest/lastSnapshotIsNotUpdatedWhenAnalyzingPastSnapshot-result.xml [deleted file]
sonar-batch/src/test/resources/org/sonar/batch/phases/UpdateStatusJobTest/lastSnapshotIsNotUpdatedWhenAnalyzingPastSnapshot.xml [deleted file]
sonar-batch/src/test/resources/org/sonar/batch/phases/UpdateStatusJobTest/shouldNotEnableSnapshotWhenNotLatest-result.xml [new file with mode: 0644]
sonar-batch/src/test/resources/org/sonar/batch/phases/UpdateStatusJobTest/shouldNotEnableSnapshotWhenNotLatest.xml [new file with mode: 0644]

index 8f3040d55b47e1fad1eec48bdae50e11dfc4302d..cc742bdc0d459e1a7527574b0dce9179b6040529 100644 (file)
@@ -23,10 +23,12 @@ import org.slf4j.LoggerFactory;
 import org.sonar.api.BatchComponent;
 import org.sonar.api.database.DatabaseSession;
 import org.sonar.api.database.model.Snapshot;
+import org.sonar.api.resources.Scopes;
 import org.sonar.batch.ServerMetadata;
 import org.sonar.batch.index.ResourcePersister;
 
 import javax.persistence.Query;
+import java.util.List;
 
 public class UpdateStatusJob implements BatchComponent {
 
@@ -43,17 +45,28 @@ public class UpdateStatusJob implements BatchComponent {
   }
 
   public void execute() {
-    Snapshot previousLastSnapshot = resourcePersister.getLastSnapshot(snapshot, false);
-    updateFlags(snapshot, previousLastSnapshot);
+    disablePreviousSnapshot();
+    enableCurrentSnapshot();
   }
 
-  private void updateFlags(Snapshot rootSnapshot, Snapshot previousLastSnapshot) {
-    if (previousLastSnapshot != null && previousLastSnapshot.getCreatedAt().before(rootSnapshot.getCreatedAt())) {
-      setFlags(previousLastSnapshot, false, null);
+  private void disablePreviousSnapshot() {
+    // disable on all modules
+    Query query = session.createQuery("FROM " + Snapshot.class.getSimpleName() + " WHERE (root_snapshot_id=:rootId OR id=:rootId) AND scope=:scope");
+    query.setParameter("rootId", snapshot.getId());
+    query.setParameter("scope", Scopes.PROJECT);
+    List<Snapshot> moduleSnapshots = query.getResultList();
+    for (Snapshot moduleSnapshot : moduleSnapshots) {
+      Snapshot previousLastSnapshot = resourcePersister.getLastSnapshot(moduleSnapshot, true);
+      if (previousLastSnapshot != null) {
+        setFlags(previousLastSnapshot, false, null);
+      }
     }
+  }
 
-    boolean isLast = (previousLastSnapshot == null || previousLastSnapshot.getCreatedAt().before(rootSnapshot.getCreatedAt()));
-    setFlags(rootSnapshot, isLast, Snapshot.STATUS_PROCESSED);
+  private void enableCurrentSnapshot() {
+    Snapshot previousLastSnapshot = resourcePersister.getLastSnapshot(snapshot, false);
+    boolean isLast = (previousLastSnapshot == null || previousLastSnapshot.getCreatedAt().before(snapshot.getCreatedAt()));
+    setFlags(snapshot, isLast, Snapshot.STATUS_PROCESSED);
     LoggerFactory.getLogger(getClass()).info("ANALYSIS SUCCESSFUL, you can browse {}", server.getURL());
   }
 
index e6680f5fb3b10af1f8ccba2052c4947e3af2ad6e..320db8e9608ce7df62ccb20636a5887cdcfe177a 100644 (file)
@@ -43,8 +43,8 @@ public class UpdateStatusJobTest extends AbstractDbUnitTestCase {
   }
 
   @Test
-  public void lastSnapshotIsNotUpdatedWhenAnalyzingPastSnapshot() {
-    assertAnalysis(6, "lastSnapshotIsNotUpdatedWhenAnalyzingPastSnapshot");
+  public void shouldNotEnableSnapshotWhenNotLatest() {
+    assertAnalysis(6, "shouldNotEnableSnapshotWhenNotLatest");
   }
 
   private void assertAnalysis(int snapshotId, String fixture) {
diff --git a/sonar-batch/src/test/resources/org/sonar/batch/phases/UpdateStatusJobTest/lastSnapshotIsNotUpdatedWhenAnalyzingPastSnapshot-result.xml b/sonar-batch/src/test/resources/org/sonar/batch/phases/UpdateStatusJobTest/lastSnapshotIsNotUpdatedWhenAnalyzingPastSnapshot-result.xml
deleted file mode 100644 (file)
index ef665b1..0000000
+++ /dev/null
@@ -1,173 +0,0 @@
-<dataset>
-
-  <!-- last snapshot : is always last, and not purged -->
-  <snapshots period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]" depth="[null]" id="1" scope="PRJ" qualifier="TRK" created_at="2008-12-02 13:58:00.00" version="[null]"
-             project_id="1"
-              parent_snapshot_id="[null]" root_project_id="[null]" root_snapshot_id="[null]" status="P" islast="true"
-             path="[null]"/>
-
-  <snapshots period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]" depth="[null]" id="2" scope="PRJ" qualifier="TRK" created_at="2008-12-02 13:58:00.00" version="[null]"
-             project_id="2"
-              parent_snapshot_id="1" root_project_id="[null]" root_snapshot_id="1" status="P" islast="true"
-             path="[null]"/>
-
-  <snapshots period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]" depth="[null]" id="3" scope="DIR" qualifier="PAC" created_at="2008-12-02 13:58:00.00" version="[null]"
-             project_id="3"
-              parent_snapshot_id="2" root_project_id="[null]" root_snapshot_id="1" status="P" islast="true"
-             path="[null]"/>
-
-  <snapshots period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]" depth="[null]" id="4" scope="FIL" qualifier="CLA" created_at="2008-12-02 13:58:00.00" version="[null]"
-             project_id="4"
-              parent_snapshot_id="3" root_project_id="[null]" root_snapshot_id="1" status="P" islast="true"
-             path="[null]"/>
-
-  <snapshots period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]" depth="[null]" id="5" scope="FIL" qualifier="CLA" created_at="2008-12-02 13:58:00.00" version="[null]"
-             project_id="5"
-              parent_snapshot_id="3" root_project_id="[null]" root_snapshot_id="1" status="P" islast="true"
-             path="[null]"/>
-
-
-  <!-- the snapshot to process : not set as last-->
-  <snapshots period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]" depth="[null]" id="6" scope="PRJ" qualifier="TRK" created_at="2005-10-01 00:00:00.00" version="[null]"
-             project_id="1"
-              parent_snapshot_id="[null]" root_project_id="[null]" root_snapshot_id="[null]" status="P" islast="false"
-             path="[null]"/>
-
-  <snapshots period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]" depth="[null]" id="7" scope="PRJ" qualifier="TRK" created_at="2005-10-01 00:00:00.00" version="[null]"
-             project_id="2"
-              parent_snapshot_id="6" root_project_id="[null]" root_snapshot_id="6" status="P" islast="false"
-             path="[null]"/>
-
-  <snapshots period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]" depth="[null]" id="8" scope="DIR" qualifier="PAC" created_at="2005-10-01 00:00:00.00" version="[null]"
-             project_id="3"
-              parent_snapshot_id="7" root_project_id="[null]" root_snapshot_id="6" status="P" islast="false"
-             path="[null]"/>
-
-  <snapshots period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]" depth="[null]" id="9" scope="FIL" qualifier="CLA" created_at="2005-10-01 00:00:00.00" version="[null]"
-             project_id="4"
-              parent_snapshot_id="8" root_project_id="[null]" root_snapshot_id="6" status="P" islast="false"
-             path="[null]"/>
-
-  <snapshots period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]" depth="[null]" id="10" scope="FIL" qualifier="CLA" created_at="2005-10-01 00:00:00.00" version="[null]"
-             project_id="5"
-              parent_snapshot_id="9" root_project_id="[null]" root_snapshot_id="6" status="P" islast="false"
-             path="[null]"/>
-
-
-  <SNAPSHOT_SOURCES ID="1" SNAPSHOT_ID="4" DATA="source code of Class1"/>
-  <SNAPSHOT_SOURCES ID="2" SNAPSHOT_ID="5" DATA="source code of Class2"/>
-
-  <rule_failures switched_off="[null]" permanent_id="[null]" ID="1" SNAPSHOT_ID="4" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg1" COST="[null]"/>
-  <rule_failures switched_off="[null]" permanent_id="[null]" ID="2" SNAPSHOT_ID="4" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg2" COST="[null]"/>
-  <rule_failures switched_off="[null]" permanent_id="[null]" ID="3" SNAPSHOT_ID="4" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg3" COST="[null]"/>
-  <rule_failures switched_off="[null]" permanent_id="[null]" ID="4" SNAPSHOT_ID="4" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg4" COST="[null]"/>
-
-  <rule_failures switched_off="[null]" permanent_id="[null]" ID="5" SNAPSHOT_ID="5" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg5" COST="[null]"/>
-  <rule_failures switched_off="[null]" permanent_id="[null]" ID="6" SNAPSHOT_ID="5" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg6" COST="[null]"/>
-
-  <!-- measures at project level -->
-  <project_measures characteristic_id="[null]" 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]" ID="1" VALUE="10.0" METRIC_ID="1" SNAPSHOT_ID="1" rules_category_id="[null]"
-                    RULE_ID="1"
-                    text_value="[null]" tendency="[null]" measure_date="[null]" project_id="[null]"
-                    alert_status="[null]" description="[null]"/>
-  <project_measures characteristic_id="[null]" 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]" ID="2" VALUE="20.0" METRIC_ID="2" SNAPSHOT_ID="1" rules_category_id="[null]"
-                    RULE_ID="[null]"
-                    text_value="[null]" tendency="[null]" measure_date="[null]" project_id="[null]"
-                    alert_status="[null]" description="[null]"/>
-  <project_measures characteristic_id="[null]" 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]" ID="3" VALUE="30.0" METRIC_ID="3" SNAPSHOT_ID="1" RULES_CATEGORY_ID="[null]"
-                    RULE_ID="[null]"
-                    text_value="[null]" tendency="[null]" measure_date="[null]" project_id="[null]"
-                    alert_status="[null]" description="[null]"/>
-
-  <!-- measures at module level -->
-  <project_measures characteristic_id="[null]" 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]" ID="4" VALUE="10.0" METRIC_ID="1" SNAPSHOT_ID="2" rules_category_id="[null]"
-                    RULE_ID="1"
-                    text_value="[null]" tendency="[null]" measure_date="[null]" project_id="[null]"
-                    alert_status="[null]" description="[null]"/>
-  <project_measures characteristic_id="[null]" 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]" ID="5" VALUE="20.0" METRIC_ID="2" SNAPSHOT_ID="2" rules_category_id="[null]"
-                    RULE_ID="[null]"
-                    text_value="[null]" tendency="[null]" measure_date="[null]" project_id="[null]"
-                    alert_status="[null]" description="[null]"/>
-  <project_measures characteristic_id="[null]" 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]" ID="6" VALUE="30.0" METRIC_ID="3" SNAPSHOT_ID="2" RULES_CATEGORY_ID="[null]"
-                    RULE_ID="[null]"
-                    text_value="[null]" tendency="[null]" measure_date="[null]" project_id="[null]"
-                    alert_status="[null]" description="[null]"/>
-
-  <!-- measures at package level -->
-  <project_measures characteristic_id="[null]" 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]" ID="7" VALUE="40.0" METRIC_ID="1" SNAPSHOT_ID="3" RULES_CATEGORY_ID="[null]"
-                    RULE_ID="1"
-                    text_value="[null]" tendency="[null]" measure_date="[null]" project_id="[null]"
-                    alert_status="[null]" description="[null]"/>
-  <project_measures characteristic_id="[null]" 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]" ID="8" VALUE="50.0" METRIC_ID="2" SNAPSHOT_ID="3" rules_category_id="[null]"
-                    RULE_ID="[null]"
-                    text_value="[null]" tendency="[null]" measure_date="[null]" project_id="[null]"
-                    alert_status="[null]" description="[null]"/>
-  <project_measures characteristic_id="[null]" 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]" ID="9" VALUE="60.0" METRIC_ID="3" SNAPSHOT_ID="3" RULES_CATEGORY_ID="[null]"
-                    RULE_ID="[null]"
-                    text_value="[null]" tendency="[null]" measure_date="[null]" project_id="[null]"
-                    alert_status="[null]" description="[null]"/>
-  <project_measures characteristic_id="[null]" 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]" ID="10" VALUE="60.0" METRIC_ID="3" SNAPSHOT_ID="3" RULES_CATEGORY_ID="[null]"
-                    RULE_ID="[null]"
-                    text_value="[null]" tendency="[null]" measure_date="[null]" project_id="[null]"
-                    alert_status="[null]" description="[null]"/>
-
-  <!-- measures at class level -->
-  <project_measures characteristic_id="[null]" 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]" ID="11" VALUE="40.0" METRIC_ID="1" SNAPSHOT_ID="4" rules_category_id="[null]"
-                    RULE_ID="1"
-                    text_value="[null]" tendency="[null]" measure_date="[null]" project_id="[null]"
-                    alert_status="[null]" description="[null]"/>
-  <project_measures characteristic_id="[null]" 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]" ID="12" VALUE="50.0" METRIC_ID="2" SNAPSHOT_ID="4" rules_category_id="[null]"
-                    RULE_ID="[null]"
-                    text_value="[null]" tendency="[null]" measure_date="[null]" project_id="[null]"
-                    alert_status="[null]" description="[null]"/>
-  <project_measures characteristic_id="[null]" 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]" ID="13" VALUE="60.0" METRIC_ID="3" SNAPSHOT_ID="4" RULES_CATEGORY_ID="[null]"
-                    RULE_ID="[null]"
-                    text_value="[null]" tendency="[null]" measure_date="[null]" project_id="[null]"
-                    alert_status="[null]" description="[null]"/>
-
-  <project_measures characteristic_id="[null]" 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]" ID="14" VALUE="40.0" METRIC_ID="1" SNAPSHOT_ID="5" rules_category_id="[null]"
-                    RULE_ID="1"
-                    text_value="[null]" tendency="[null]" measure_date="[null]" project_id="[null]"
-                    alert_status="[null]" description="[null]"/>
-  <project_measures characteristic_id="[null]" 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]" ID="15" VALUE="50.0" METRIC_ID="2" SNAPSHOT_ID="5" rules_category_id="[null]"
-                    RULE_ID="[null]"
-                    text_value="[null]" tendency="[null]" measure_date="[null]" project_id="[null]"
-                    alert_status="[null]" description="[null]"/>
-  <project_measures characteristic_id="[null]" 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]" ID="16" VALUE="60.0" METRIC_ID="3" SNAPSHOT_ID="5" RULES_CATEGORY_ID="[null]"
-                    RULE_ID="[null]"
-                    text_value="[null]" tendency="[null]" measure_date="[null]" project_id="[null]"
-                    alert_status="[null]" description="[null]"/>
-
-</dataset>
\ No newline at end of file
diff --git a/sonar-batch/src/test/resources/org/sonar/batch/phases/UpdateStatusJobTest/lastSnapshotIsNotUpdatedWhenAnalyzingPastSnapshot.xml b/sonar-batch/src/test/resources/org/sonar/batch/phases/UpdateStatusJobTest/lastSnapshotIsNotUpdatedWhenAnalyzingPastSnapshot.xml
deleted file mode 100644 (file)
index 2315b5d..0000000
+++ /dev/null
@@ -1,174 +0,0 @@
-<dataset>
-
-  <!-- last snapshot -->
-  <snapshots period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]" depth="[null]" id="1" scope="PRJ" qualifier="TRK" created_at="2008-12-02 13:58:00.00" version="[null]"
-             project_id="1"
-              parent_snapshot_id="[null]" root_project_id="[null]" root_snapshot_id="[null]" status="P" islast="true"
-             path="[null]"/>
-
-  <snapshots period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]" depth="[null]" id="2" scope="PRJ" qualifier="TRK" created_at="2008-12-02 13:58:00.00" version="[null]"
-             project_id="2"
-              parent_snapshot_id="1" root_project_id="[null]" root_snapshot_id="1" status="P" islast="true"
-             path="[null]"/>
-
-  <snapshots period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]" depth="[null]" id="3" scope="DIR" qualifier="PAC" created_at="2008-12-02 13:58:00.00" version="[null]"
-             project_id="3"
-              parent_snapshot_id="2" root_project_id="[null]" root_snapshot_id="1" status="P" islast="true"
-             path="[null]"/>
-
-  <snapshots period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]" depth="[null]" id="4" scope="FIL" qualifier="CLA" created_at="2008-12-02 13:58:00.00" version="[null]"
-             project_id="4"
-              parent_snapshot_id="3" root_project_id="[null]" root_snapshot_id="1" status="P" islast="true"
-             path="[null]"/>
-
-  <snapshots period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]" depth="[null]" id="5" scope="FIL" qualifier="CLA" created_at="2008-12-02 13:58:00.00" version="[null]"
-             project_id="5"
-              parent_snapshot_id="3" root_project_id="[null]" root_snapshot_id="1" status="P" islast="true"
-             path="[null]"/>
-
-
-  <!-- the snapshot to process : before last snapshot -->
-  <snapshots period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]" depth="[null]" id="6" scope="PRJ" qualifier="TRK" created_at="2005-10-01 00:00:00.00" version="[null]"
-             project_id="1"
-              parent_snapshot_id="[null]" root_project_id="[null]" root_snapshot_id="[null]" status="[null]"
-             islast="false"
-             path="[null]"/>
-
-  <snapshots period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]" depth="[null]" id="7" scope="PRJ" qualifier="TRK" created_at="2005-10-01 00:00:00.00" version="[null]"
-             project_id="2"
-              parent_snapshot_id="6" root_project_id="[null]" root_snapshot_id="6" status="[null]" islast="false"
-             path="[null]"/>
-
-  <snapshots period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]" depth="[null]" id="8" scope="DIR" qualifier="PAC" created_at="2005-10-01 00:00:00.00" version="[null]"
-             project_id="3"
-              parent_snapshot_id="7" root_project_id="[null]" root_snapshot_id="6" status="[null]" islast="false"
-             path="[null]"/>
-
-  <snapshots period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]" depth="[null]" id="9" scope="FIL" qualifier="CLA" created_at="2005-10-01 00:00:00.00" version="[null]"
-             project_id="4"
-              parent_snapshot_id="8" root_project_id="[null]" root_snapshot_id="6" status="[null]" islast="false"
-             path="[null]"/>
-
-  <snapshots period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]" depth="[null]" id="10" scope="FIL" qualifier="CLA" created_at="2005-10-01 00:00:00.00" version="[null]"
-             project_id="5"
-              parent_snapshot_id="9" root_project_id="[null]" root_snapshot_id="6" status="[null]" islast="false"
-             path="[null]"/>
-
-
-  <SNAPSHOT_SOURCES ID="1" SNAPSHOT_ID="4" DATA="source code of Class1"/>
-  <SNAPSHOT_SOURCES ID="2" SNAPSHOT_ID="5" DATA="source code of Class2"/>
-
-  <rule_failures switched_off="[null]" permanent_id="[null]" ID="1" SNAPSHOT_ID="4" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg1" COST="[null]"/>
-  <rule_failures switched_off="[null]" permanent_id="[null]" ID="2" SNAPSHOT_ID="4" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg2" COST="[null]"/>
-  <rule_failures switched_off="[null]" permanent_id="[null]" ID="3" SNAPSHOT_ID="4" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg3" COST="[null]"/>
-  <rule_failures switched_off="[null]" permanent_id="[null]" ID="4" SNAPSHOT_ID="4" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg4" COST="[null]"/>
-
-  <rule_failures switched_off="[null]" permanent_id="[null]" ID="5" SNAPSHOT_ID="5" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg5" COST="[null]"/>
-  <rule_failures switched_off="[null]" permanent_id="[null]" ID="6" SNAPSHOT_ID="5" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg6" COST="[null]"/>
-
-  <!-- measures at project level -->
-  <project_measures characteristic_id="[null]" 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]" ID="1" VALUE="10.0" METRIC_ID="1" SNAPSHOT_ID="1" rules_category_id="[null]"
-                    RULE_ID="1"
-                    text_value="[null]" tendency="[null]" measure_date="[null]" project_id="[null]"
-                    alert_status="[null]" description="[null]"/>
-  <project_measures characteristic_id="[null]" 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]" ID="2" VALUE="20.0" METRIC_ID="2" SNAPSHOT_ID="1" rules_category_id="[null]"
-                    RULE_ID="[null]"
-                    text_value="[null]" tendency="[null]" measure_date="[null]" project_id="[null]"
-                    alert_status="[null]" description="[null]"/>
-  <project_measures characteristic_id="[null]" 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]" ID="3" VALUE="30.0" METRIC_ID="3" SNAPSHOT_ID="1" RULES_CATEGORY_ID="[null]"
-                    RULE_ID="[null]"
-                    text_value="[null]" tendency="[null]" measure_date="[null]" project_id="[null]"
-                    alert_status="[null]" description="[null]"/>
-
-  <!-- measures at module level -->
-  <project_measures characteristic_id="[null]" 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]" ID="4" VALUE="10.0" METRIC_ID="1" SNAPSHOT_ID="2" rules_category_id="[null]"
-                    RULE_ID="1"
-                    text_value="[null]" tendency="[null]" measure_date="[null]" project_id="[null]"
-                    alert_status="[null]" description="[null]"/>
-  <project_measures characteristic_id="[null]" 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]" ID="5" VALUE="20.0" METRIC_ID="2" SNAPSHOT_ID="2" rules_category_id="[null]"
-                    RULE_ID="[null]"
-                    text_value="[null]" tendency="[null]" measure_date="[null]" project_id="[null]"
-                    alert_status="[null]" description="[null]"/>
-  <project_measures characteristic_id="[null]" 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]" ID="6" VALUE="30.0" METRIC_ID="3" SNAPSHOT_ID="2" RULES_CATEGORY_ID="[null]"
-                    RULE_ID="[null]"
-                    text_value="[null]" tendency="[null]" measure_date="[null]" project_id="[null]"
-                    alert_status="[null]" description="[null]"/>
-
-  <!-- measures at package level -->
-  <project_measures characteristic_id="[null]" 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]" ID="7" VALUE="40.0" METRIC_ID="1" SNAPSHOT_ID="3" RULES_CATEGORY_ID="[null]"
-                    RULE_ID="1"
-                    text_value="[null]" tendency="[null]" measure_date="[null]" project_id="[null]"
-                    alert_status="[null]" description="[null]"/>
-  <project_measures characteristic_id="[null]" 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]" ID="8" VALUE="50.0" METRIC_ID="2" SNAPSHOT_ID="3" rules_category_id="[null]"
-                    RULE_ID="[null]"
-                    text_value="[null]" tendency="[null]" measure_date="[null]" project_id="[null]"
-                    alert_status="[null]" description="[null]"/>
-  <project_measures characteristic_id="[null]" 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]" ID="9" VALUE="60.0" METRIC_ID="3" SNAPSHOT_ID="3" RULES_CATEGORY_ID="[null]"
-                    RULE_ID="[null]"
-                    text_value="[null]" tendency="[null]" measure_date="[null]" project_id="[null]"
-                    alert_status="[null]" description="[null]"/>
-  <project_measures characteristic_id="[null]" 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]" ID="10" VALUE="60.0" METRIC_ID="3" SNAPSHOT_ID="3" RULES_CATEGORY_ID="[null]"
-                    RULE_ID="[null]"
-                    text_value="[null]" tendency="[null]" measure_date="[null]" project_id="[null]"
-                    alert_status="[null]" description="[null]"/>
-
-  <!-- measures at class level -->
-  <project_measures characteristic_id="[null]" 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]" ID="11" VALUE="40.0" METRIC_ID="1" SNAPSHOT_ID="4" rules_category_id="[null]"
-                    RULE_ID="1"
-                    text_value="[null]" tendency="[null]" measure_date="[null]" project_id="[null]"
-                    alert_status="[null]" description="[null]"/>
-  <project_measures characteristic_id="[null]" 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]" ID="12" VALUE="50.0" METRIC_ID="2" SNAPSHOT_ID="4" rules_category_id="[null]"
-                    RULE_ID="[null]"
-                    text_value="[null]" tendency="[null]" measure_date="[null]" project_id="[null]"
-                    alert_status="[null]" description="[null]"/>
-  <project_measures characteristic_id="[null]" 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]" ID="13" VALUE="60.0" METRIC_ID="3" SNAPSHOT_ID="4" RULES_CATEGORY_ID="[null]"
-                    RULE_ID="[null]"
-                    text_value="[null]" tendency="[null]" measure_date="[null]" project_id="[null]"
-                    alert_status="[null]" description="[null]"/>
-
-  <project_measures characteristic_id="[null]" 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]" ID="14" VALUE="40.0" METRIC_ID="1" SNAPSHOT_ID="5" rules_category_id="[null]"
-                    RULE_ID="1"
-                    text_value="[null]" tendency="[null]" measure_date="[null]" project_id="[null]"
-                    alert_status="[null]" description="[null]"/>
-  <project_measures characteristic_id="[null]" 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]" ID="15" VALUE="50.0" METRIC_ID="2" SNAPSHOT_ID="5" rules_category_id="[null]"
-                    RULE_ID="[null]"
-                    text_value="[null]" tendency="[null]" measure_date="[null]" project_id="[null]"
-                    alert_status="[null]" description="[null]"/>
-  <project_measures characteristic_id="[null]" 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]" ID="16" VALUE="60.0" METRIC_ID="3" SNAPSHOT_ID="5" RULES_CATEGORY_ID="[null]"
-                    RULE_ID="[null]"
-                    text_value="[null]" tendency="[null]" measure_date="[null]" project_id="[null]"
-                    alert_status="[null]" description="[null]"/>
-
-</dataset>
\ No newline at end of file
diff --git a/sonar-batch/src/test/resources/org/sonar/batch/phases/UpdateStatusJobTest/shouldNotEnableSnapshotWhenNotLatest-result.xml b/sonar-batch/src/test/resources/org/sonar/batch/phases/UpdateStatusJobTest/shouldNotEnableSnapshotWhenNotLatest-result.xml
new file mode 100644 (file)
index 0000000..ef665b1
--- /dev/null
@@ -0,0 +1,173 @@
+<dataset>
+
+  <!-- last snapshot : is always last, and not purged -->
+  <snapshots period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]" depth="[null]" id="1" scope="PRJ" qualifier="TRK" created_at="2008-12-02 13:58:00.00" version="[null]"
+             project_id="1"
+              parent_snapshot_id="[null]" root_project_id="[null]" root_snapshot_id="[null]" status="P" islast="true"
+             path="[null]"/>
+
+  <snapshots period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]" depth="[null]" id="2" scope="PRJ" qualifier="TRK" created_at="2008-12-02 13:58:00.00" version="[null]"
+             project_id="2"
+              parent_snapshot_id="1" root_project_id="[null]" root_snapshot_id="1" status="P" islast="true"
+             path="[null]"/>
+
+  <snapshots period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]" depth="[null]" id="3" scope="DIR" qualifier="PAC" created_at="2008-12-02 13:58:00.00" version="[null]"
+             project_id="3"
+              parent_snapshot_id="2" root_project_id="[null]" root_snapshot_id="1" status="P" islast="true"
+             path="[null]"/>
+
+  <snapshots period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]" depth="[null]" id="4" scope="FIL" qualifier="CLA" created_at="2008-12-02 13:58:00.00" version="[null]"
+             project_id="4"
+              parent_snapshot_id="3" root_project_id="[null]" root_snapshot_id="1" status="P" islast="true"
+             path="[null]"/>
+
+  <snapshots period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]" depth="[null]" id="5" scope="FIL" qualifier="CLA" created_at="2008-12-02 13:58:00.00" version="[null]"
+             project_id="5"
+              parent_snapshot_id="3" root_project_id="[null]" root_snapshot_id="1" status="P" islast="true"
+             path="[null]"/>
+
+
+  <!-- the snapshot to process : not set as last-->
+  <snapshots period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]" depth="[null]" id="6" scope="PRJ" qualifier="TRK" created_at="2005-10-01 00:00:00.00" version="[null]"
+             project_id="1"
+              parent_snapshot_id="[null]" root_project_id="[null]" root_snapshot_id="[null]" status="P" islast="false"
+             path="[null]"/>
+
+  <snapshots period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]" depth="[null]" id="7" scope="PRJ" qualifier="TRK" created_at="2005-10-01 00:00:00.00" version="[null]"
+             project_id="2"
+              parent_snapshot_id="6" root_project_id="[null]" root_snapshot_id="6" status="P" islast="false"
+             path="[null]"/>
+
+  <snapshots period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]" depth="[null]" id="8" scope="DIR" qualifier="PAC" created_at="2005-10-01 00:00:00.00" version="[null]"
+             project_id="3"
+              parent_snapshot_id="7" root_project_id="[null]" root_snapshot_id="6" status="P" islast="false"
+             path="[null]"/>
+
+  <snapshots period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]" depth="[null]" id="9" scope="FIL" qualifier="CLA" created_at="2005-10-01 00:00:00.00" version="[null]"
+             project_id="4"
+              parent_snapshot_id="8" root_project_id="[null]" root_snapshot_id="6" status="P" islast="false"
+             path="[null]"/>
+
+  <snapshots period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]" depth="[null]" id="10" scope="FIL" qualifier="CLA" created_at="2005-10-01 00:00:00.00" version="[null]"
+             project_id="5"
+              parent_snapshot_id="9" root_project_id="[null]" root_snapshot_id="6" status="P" islast="false"
+             path="[null]"/>
+
+
+  <SNAPSHOT_SOURCES ID="1" SNAPSHOT_ID="4" DATA="source code of Class1"/>
+  <SNAPSHOT_SOURCES ID="2" SNAPSHOT_ID="5" DATA="source code of Class2"/>
+
+  <rule_failures switched_off="[null]" permanent_id="[null]" ID="1" SNAPSHOT_ID="4" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg1" COST="[null]"/>
+  <rule_failures switched_off="[null]" permanent_id="[null]" ID="2" SNAPSHOT_ID="4" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg2" COST="[null]"/>
+  <rule_failures switched_off="[null]" permanent_id="[null]" ID="3" SNAPSHOT_ID="4" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg3" COST="[null]"/>
+  <rule_failures switched_off="[null]" permanent_id="[null]" ID="4" SNAPSHOT_ID="4" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg4" COST="[null]"/>
+
+  <rule_failures switched_off="[null]" permanent_id="[null]" ID="5" SNAPSHOT_ID="5" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg5" COST="[null]"/>
+  <rule_failures switched_off="[null]" permanent_id="[null]" ID="6" SNAPSHOT_ID="5" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg6" COST="[null]"/>
+
+  <!-- measures at project level -->
+  <project_measures characteristic_id="[null]" 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]" ID="1" VALUE="10.0" METRIC_ID="1" SNAPSHOT_ID="1" rules_category_id="[null]"
+                    RULE_ID="1"
+                    text_value="[null]" tendency="[null]" measure_date="[null]" project_id="[null]"
+                    alert_status="[null]" description="[null]"/>
+  <project_measures characteristic_id="[null]" 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]" ID="2" VALUE="20.0" METRIC_ID="2" SNAPSHOT_ID="1" rules_category_id="[null]"
+                    RULE_ID="[null]"
+                    text_value="[null]" tendency="[null]" measure_date="[null]" project_id="[null]"
+                    alert_status="[null]" description="[null]"/>
+  <project_measures characteristic_id="[null]" 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]" ID="3" VALUE="30.0" METRIC_ID="3" SNAPSHOT_ID="1" RULES_CATEGORY_ID="[null]"
+                    RULE_ID="[null]"
+                    text_value="[null]" tendency="[null]" measure_date="[null]" project_id="[null]"
+                    alert_status="[null]" description="[null]"/>
+
+  <!-- measures at module level -->
+  <project_measures characteristic_id="[null]" 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]" ID="4" VALUE="10.0" METRIC_ID="1" SNAPSHOT_ID="2" rules_category_id="[null]"
+                    RULE_ID="1"
+                    text_value="[null]" tendency="[null]" measure_date="[null]" project_id="[null]"
+                    alert_status="[null]" description="[null]"/>
+  <project_measures characteristic_id="[null]" 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]" ID="5" VALUE="20.0" METRIC_ID="2" SNAPSHOT_ID="2" rules_category_id="[null]"
+                    RULE_ID="[null]"
+                    text_value="[null]" tendency="[null]" measure_date="[null]" project_id="[null]"
+                    alert_status="[null]" description="[null]"/>
+  <project_measures characteristic_id="[null]" 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]" ID="6" VALUE="30.0" METRIC_ID="3" SNAPSHOT_ID="2" RULES_CATEGORY_ID="[null]"
+                    RULE_ID="[null]"
+                    text_value="[null]" tendency="[null]" measure_date="[null]" project_id="[null]"
+                    alert_status="[null]" description="[null]"/>
+
+  <!-- measures at package level -->
+  <project_measures characteristic_id="[null]" 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]" ID="7" VALUE="40.0" METRIC_ID="1" SNAPSHOT_ID="3" RULES_CATEGORY_ID="[null]"
+                    RULE_ID="1"
+                    text_value="[null]" tendency="[null]" measure_date="[null]" project_id="[null]"
+                    alert_status="[null]" description="[null]"/>
+  <project_measures characteristic_id="[null]" 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]" ID="8" VALUE="50.0" METRIC_ID="2" SNAPSHOT_ID="3" rules_category_id="[null]"
+                    RULE_ID="[null]"
+                    text_value="[null]" tendency="[null]" measure_date="[null]" project_id="[null]"
+                    alert_status="[null]" description="[null]"/>
+  <project_measures characteristic_id="[null]" 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]" ID="9" VALUE="60.0" METRIC_ID="3" SNAPSHOT_ID="3" RULES_CATEGORY_ID="[null]"
+                    RULE_ID="[null]"
+                    text_value="[null]" tendency="[null]" measure_date="[null]" project_id="[null]"
+                    alert_status="[null]" description="[null]"/>
+  <project_measures characteristic_id="[null]" 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]" ID="10" VALUE="60.0" METRIC_ID="3" SNAPSHOT_ID="3" RULES_CATEGORY_ID="[null]"
+                    RULE_ID="[null]"
+                    text_value="[null]" tendency="[null]" measure_date="[null]" project_id="[null]"
+                    alert_status="[null]" description="[null]"/>
+
+  <!-- measures at class level -->
+  <project_measures characteristic_id="[null]" 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]" ID="11" VALUE="40.0" METRIC_ID="1" SNAPSHOT_ID="4" rules_category_id="[null]"
+                    RULE_ID="1"
+                    text_value="[null]" tendency="[null]" measure_date="[null]" project_id="[null]"
+                    alert_status="[null]" description="[null]"/>
+  <project_measures characteristic_id="[null]" 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]" ID="12" VALUE="50.0" METRIC_ID="2" SNAPSHOT_ID="4" rules_category_id="[null]"
+                    RULE_ID="[null]"
+                    text_value="[null]" tendency="[null]" measure_date="[null]" project_id="[null]"
+                    alert_status="[null]" description="[null]"/>
+  <project_measures characteristic_id="[null]" 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]" ID="13" VALUE="60.0" METRIC_ID="3" SNAPSHOT_ID="4" RULES_CATEGORY_ID="[null]"
+                    RULE_ID="[null]"
+                    text_value="[null]" tendency="[null]" measure_date="[null]" project_id="[null]"
+                    alert_status="[null]" description="[null]"/>
+
+  <project_measures characteristic_id="[null]" 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]" ID="14" VALUE="40.0" METRIC_ID="1" SNAPSHOT_ID="5" rules_category_id="[null]"
+                    RULE_ID="1"
+                    text_value="[null]" tendency="[null]" measure_date="[null]" project_id="[null]"
+                    alert_status="[null]" description="[null]"/>
+  <project_measures characteristic_id="[null]" 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]" ID="15" VALUE="50.0" METRIC_ID="2" SNAPSHOT_ID="5" rules_category_id="[null]"
+                    RULE_ID="[null]"
+                    text_value="[null]" tendency="[null]" measure_date="[null]" project_id="[null]"
+                    alert_status="[null]" description="[null]"/>
+  <project_measures characteristic_id="[null]" 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]" ID="16" VALUE="60.0" METRIC_ID="3" SNAPSHOT_ID="5" RULES_CATEGORY_ID="[null]"
+                    RULE_ID="[null]"
+                    text_value="[null]" tendency="[null]" measure_date="[null]" project_id="[null]"
+                    alert_status="[null]" description="[null]"/>
+
+</dataset>
\ No newline at end of file
diff --git a/sonar-batch/src/test/resources/org/sonar/batch/phases/UpdateStatusJobTest/shouldNotEnableSnapshotWhenNotLatest.xml b/sonar-batch/src/test/resources/org/sonar/batch/phases/UpdateStatusJobTest/shouldNotEnableSnapshotWhenNotLatest.xml
new file mode 100644 (file)
index 0000000..2315b5d
--- /dev/null
@@ -0,0 +1,174 @@
+<dataset>
+
+  <!-- last snapshot -->
+  <snapshots period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]" depth="[null]" id="1" scope="PRJ" qualifier="TRK" created_at="2008-12-02 13:58:00.00" version="[null]"
+             project_id="1"
+              parent_snapshot_id="[null]" root_project_id="[null]" root_snapshot_id="[null]" status="P" islast="true"
+             path="[null]"/>
+
+  <snapshots period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]" depth="[null]" id="2" scope="PRJ" qualifier="TRK" created_at="2008-12-02 13:58:00.00" version="[null]"
+             project_id="2"
+              parent_snapshot_id="1" root_project_id="[null]" root_snapshot_id="1" status="P" islast="true"
+             path="[null]"/>
+
+  <snapshots period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]" depth="[null]" id="3" scope="DIR" qualifier="PAC" created_at="2008-12-02 13:58:00.00" version="[null]"
+             project_id="3"
+              parent_snapshot_id="2" root_project_id="[null]" root_snapshot_id="1" status="P" islast="true"
+             path="[null]"/>
+
+  <snapshots period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]" depth="[null]" id="4" scope="FIL" qualifier="CLA" created_at="2008-12-02 13:58:00.00" version="[null]"
+             project_id="4"
+              parent_snapshot_id="3" root_project_id="[null]" root_snapshot_id="1" status="P" islast="true"
+             path="[null]"/>
+
+  <snapshots period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]" depth="[null]" id="5" scope="FIL" qualifier="CLA" created_at="2008-12-02 13:58:00.00" version="[null]"
+             project_id="5"
+              parent_snapshot_id="3" root_project_id="[null]" root_snapshot_id="1" status="P" islast="true"
+             path="[null]"/>
+
+
+  <!-- the snapshot to process : before last snapshot -->
+  <snapshots period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]" depth="[null]" id="6" scope="PRJ" qualifier="TRK" created_at="2005-10-01 00:00:00.00" version="[null]"
+             project_id="1"
+              parent_snapshot_id="[null]" root_project_id="[null]" root_snapshot_id="[null]" status="[null]"
+             islast="false"
+             path="[null]"/>
+
+  <snapshots period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]" depth="[null]" id="7" scope="PRJ" qualifier="TRK" created_at="2005-10-01 00:00:00.00" version="[null]"
+             project_id="2"
+              parent_snapshot_id="6" root_project_id="[null]" root_snapshot_id="6" status="[null]" islast="false"
+             path="[null]"/>
+
+  <snapshots period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]" depth="[null]" id="8" scope="DIR" qualifier="PAC" created_at="2005-10-01 00:00:00.00" version="[null]"
+             project_id="3"
+              parent_snapshot_id="7" root_project_id="[null]" root_snapshot_id="6" status="[null]" islast="false"
+             path="[null]"/>
+
+  <snapshots period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]" depth="[null]" id="9" scope="FIL" qualifier="CLA" created_at="2005-10-01 00:00:00.00" version="[null]"
+             project_id="4"
+              parent_snapshot_id="8" root_project_id="[null]" root_snapshot_id="6" status="[null]" islast="false"
+             path="[null]"/>
+
+  <snapshots period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]" depth="[null]" id="10" scope="FIL" qualifier="CLA" created_at="2005-10-01 00:00:00.00" version="[null]"
+             project_id="5"
+              parent_snapshot_id="9" root_project_id="[null]" root_snapshot_id="6" status="[null]" islast="false"
+             path="[null]"/>
+
+
+  <SNAPSHOT_SOURCES ID="1" SNAPSHOT_ID="4" DATA="source code of Class1"/>
+  <SNAPSHOT_SOURCES ID="2" SNAPSHOT_ID="5" DATA="source code of Class2"/>
+
+  <rule_failures switched_off="[null]" permanent_id="[null]" ID="1" SNAPSHOT_ID="4" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg1" COST="[null]"/>
+  <rule_failures switched_off="[null]" permanent_id="[null]" ID="2" SNAPSHOT_ID="4" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg2" COST="[null]"/>
+  <rule_failures switched_off="[null]" permanent_id="[null]" ID="3" SNAPSHOT_ID="4" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg3" COST="[null]"/>
+  <rule_failures switched_off="[null]" permanent_id="[null]" ID="4" SNAPSHOT_ID="4" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg4" COST="[null]"/>
+
+  <rule_failures switched_off="[null]" permanent_id="[null]" ID="5" SNAPSHOT_ID="5" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg5" COST="[null]"/>
+  <rule_failures switched_off="[null]" permanent_id="[null]" ID="6" SNAPSHOT_ID="5" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg6" COST="[null]"/>
+
+  <!-- measures at project level -->
+  <project_measures characteristic_id="[null]" 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]" ID="1" VALUE="10.0" METRIC_ID="1" SNAPSHOT_ID="1" rules_category_id="[null]"
+                    RULE_ID="1"
+                    text_value="[null]" tendency="[null]" measure_date="[null]" project_id="[null]"
+                    alert_status="[null]" description="[null]"/>
+  <project_measures characteristic_id="[null]" 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]" ID="2" VALUE="20.0" METRIC_ID="2" SNAPSHOT_ID="1" rules_category_id="[null]"
+                    RULE_ID="[null]"
+                    text_value="[null]" tendency="[null]" measure_date="[null]" project_id="[null]"
+                    alert_status="[null]" description="[null]"/>
+  <project_measures characteristic_id="[null]" 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]" ID="3" VALUE="30.0" METRIC_ID="3" SNAPSHOT_ID="1" RULES_CATEGORY_ID="[null]"
+                    RULE_ID="[null]"
+                    text_value="[null]" tendency="[null]" measure_date="[null]" project_id="[null]"
+                    alert_status="[null]" description="[null]"/>
+
+  <!-- measures at module level -->
+  <project_measures characteristic_id="[null]" 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]" ID="4" VALUE="10.0" METRIC_ID="1" SNAPSHOT_ID="2" rules_category_id="[null]"
+                    RULE_ID="1"
+                    text_value="[null]" tendency="[null]" measure_date="[null]" project_id="[null]"
+                    alert_status="[null]" description="[null]"/>
+  <project_measures characteristic_id="[null]" 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]" ID="5" VALUE="20.0" METRIC_ID="2" SNAPSHOT_ID="2" rules_category_id="[null]"
+                    RULE_ID="[null]"
+                    text_value="[null]" tendency="[null]" measure_date="[null]" project_id="[null]"
+                    alert_status="[null]" description="[null]"/>
+  <project_measures characteristic_id="[null]" 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]" ID="6" VALUE="30.0" METRIC_ID="3" SNAPSHOT_ID="2" RULES_CATEGORY_ID="[null]"
+                    RULE_ID="[null]"
+                    text_value="[null]" tendency="[null]" measure_date="[null]" project_id="[null]"
+                    alert_status="[null]" description="[null]"/>
+
+  <!-- measures at package level -->
+  <project_measures characteristic_id="[null]" 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]" ID="7" VALUE="40.0" METRIC_ID="1" SNAPSHOT_ID="3" RULES_CATEGORY_ID="[null]"
+                    RULE_ID="1"
+                    text_value="[null]" tendency="[null]" measure_date="[null]" project_id="[null]"
+                    alert_status="[null]" description="[null]"/>
+  <project_measures characteristic_id="[null]" 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]" ID="8" VALUE="50.0" METRIC_ID="2" SNAPSHOT_ID="3" rules_category_id="[null]"
+                    RULE_ID="[null]"
+                    text_value="[null]" tendency="[null]" measure_date="[null]" project_id="[null]"
+                    alert_status="[null]" description="[null]"/>
+  <project_measures characteristic_id="[null]" 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]" ID="9" VALUE="60.0" METRIC_ID="3" SNAPSHOT_ID="3" RULES_CATEGORY_ID="[null]"
+                    RULE_ID="[null]"
+                    text_value="[null]" tendency="[null]" measure_date="[null]" project_id="[null]"
+                    alert_status="[null]" description="[null]"/>
+  <project_measures characteristic_id="[null]" 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]" ID="10" VALUE="60.0" METRIC_ID="3" SNAPSHOT_ID="3" RULES_CATEGORY_ID="[null]"
+                    RULE_ID="[null]"
+                    text_value="[null]" tendency="[null]" measure_date="[null]" project_id="[null]"
+                    alert_status="[null]" description="[null]"/>
+
+  <!-- measures at class level -->
+  <project_measures characteristic_id="[null]" 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]" ID="11" VALUE="40.0" METRIC_ID="1" SNAPSHOT_ID="4" rules_category_id="[null]"
+                    RULE_ID="1"
+                    text_value="[null]" tendency="[null]" measure_date="[null]" project_id="[null]"
+                    alert_status="[null]" description="[null]"/>
+  <project_measures characteristic_id="[null]" 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]" ID="12" VALUE="50.0" METRIC_ID="2" SNAPSHOT_ID="4" rules_category_id="[null]"
+                    RULE_ID="[null]"
+                    text_value="[null]" tendency="[null]" measure_date="[null]" project_id="[null]"
+                    alert_status="[null]" description="[null]"/>
+  <project_measures characteristic_id="[null]" 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]" ID="13" VALUE="60.0" METRIC_ID="3" SNAPSHOT_ID="4" RULES_CATEGORY_ID="[null]"
+                    RULE_ID="[null]"
+                    text_value="[null]" tendency="[null]" measure_date="[null]" project_id="[null]"
+                    alert_status="[null]" description="[null]"/>
+
+  <project_measures characteristic_id="[null]" 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]" ID="14" VALUE="40.0" METRIC_ID="1" SNAPSHOT_ID="5" rules_category_id="[null]"
+                    RULE_ID="1"
+                    text_value="[null]" tendency="[null]" measure_date="[null]" project_id="[null]"
+                    alert_status="[null]" description="[null]"/>
+  <project_measures characteristic_id="[null]" 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]" ID="15" VALUE="50.0" METRIC_ID="2" SNAPSHOT_ID="5" rules_category_id="[null]"
+                    RULE_ID="[null]"
+                    text_value="[null]" tendency="[null]" measure_date="[null]" project_id="[null]"
+                    alert_status="[null]" description="[null]"/>
+  <project_measures characteristic_id="[null]" 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]" ID="16" VALUE="60.0" METRIC_ID="3" SNAPSHOT_ID="5" RULES_CATEGORY_ID="[null]"
+                    RULE_ID="[null]"
+                    text_value="[null]" tendency="[null]" measure_date="[null]" project_id="[null]"
+                    alert_status="[null]" description="[null]"/>
+
+</dataset>
\ No newline at end of file