]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-7700 re-enable ignored UTs on PurgeDao 1095/head
authorSébastien Lesaint <sebastien.lesaint@sonarsource.com>
Mon, 11 Jul 2016 16:23:29 +0000 (18:23 +0200)
committerSébastien Lesaint <sebastien.lesaint@sonarsource.com>
Mon, 11 Jul 2016 16:45:29 +0000 (18:45 +0200)
sonar-db/src/test/java/org/sonar/db/purge/PurgeDaoTest.java
sonar-db/src/test/resources/org/sonar/db/purge/PurgeDaoTest/close_issues_clean_index_and_files_sources_of_specified_components-result.xml [new file with mode: 0644]
sonar-db/src/test/resources/org/sonar/db/purge/PurgeDaoTest/close_issues_clean_index_and_files_sources_of_specified_components.xml [new file with mode: 0644]
sonar-db/src/test/resources/org/sonar/db/purge/PurgeDaoTest/delete_file_sources_of_disabled_resources-result.xml [deleted file]
sonar-db/src/test/resources/org/sonar/db/purge/PurgeDaoTest/delete_file_sources_of_disabled_resources.xml [deleted file]
sonar-db/src/test/resources/org/sonar/db/purge/PurgeDaoTest/disable_resources_without_last_snapshot-result.xml [deleted file]
sonar-db/src/test/resources/org/sonar/db/purge/PurgeDaoTest/disable_resources_without_last_snapshot.xml [deleted file]

index 5870c075dca54e84e446db9a2e3c70423152e42e..c49dff51a20c755b27b3eb60c18bee85b47e0a51 100644 (file)
@@ -21,9 +21,9 @@ package org.sonar.db.purge;
 
 import com.google.common.collect.ImmutableList;
 import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.Collections;
 import java.util.List;
-import org.junit.Ignore;
 import org.junit.Rule;
 import org.junit.Test;
 import org.mockito.ArgumentCaptor;
@@ -76,15 +76,6 @@ public class PurgeDaoTest {
     dbTester.assertDbUnit(getClass(), "shouldPurgeProject-result.xml", "projects", "snapshots");
   }
 
-  @Test
-  @Ignore("TODO")
-  public void delete_file_sources_of_disabled_resources() {
-    dbTester.prepareDbUnit(getClass(), "delete_file_sources_of_disabled_resources.xml");
-    underTest.purge(dbSession, newConfigurationWith30Days(system2), PurgeListener.EMPTY, new PurgeProfiler());
-    dbSession.commit();
-    dbTester.assertDbUnit(getClass(), "delete_file_sources_of_disabled_resources-result.xml", "file_sources");
-  }
-
   @Test
   public void shouldDeleteHistoricalDataOfDirectoriesAndFiles() {
     dbTester.prepareDbUnit(getClass(), "shouldDeleteHistoricalDataOfDirectoriesAndFiles.xml");
@@ -98,13 +89,12 @@ public class PurgeDaoTest {
   }
 
   @Test
-  @Ignore("TODO")
-  public void disable_resources_without_last_snapshot() {
-    dbTester.prepareDbUnit(getClass(), "disable_resources_without_last_snapshot.xml");
+  public void close_issues_clean_index_and_file_sources_of_disabled_components_specified_by_uuid_in_configuration() {
+    dbTester.prepareDbUnit(getClass(), "close_issues_clean_index_and_files_sources_of_specified_components.xml");
     when(system2.now()).thenReturn(1450000000000L);
-    underTest.purge(dbSession, newConfigurationWith30Days(system2), PurgeListener.EMPTY, new PurgeProfiler());
+    underTest.purge(dbSession, newConfigurationWith30Days(system2, "P1", "EFGH", "GHIJ"), PurgeListener.EMPTY, new PurgeProfiler());
     dbSession.commit();
-    dbTester.assertDbUnit(getClass(), "disable_resources_without_last_snapshot-result.xml",
+    dbTester.assertDbUnit(getClass(), "close_issues_clean_index_and_files_sources_of_specified_components-result.xml",
       new String[] {"issue_close_date", "issue_update_date"},
       "projects", "snapshots", "issues");
   }
@@ -245,7 +235,7 @@ public class PurgeDaoTest {
     return new PurgeConfiguration(new IdUuidPair(THE_PROJECT_ID, THE_PROJECT_UUID), new String[0], 30, System2.INSTANCE, Collections.emptyList());
   }
 
-  private static PurgeConfiguration newConfigurationWith30Days(System2 system2) {
-    return new PurgeConfiguration(new IdUuidPair(THE_PROJECT_ID, THE_PROJECT_UUID), new String[0], 30, system2, Collections.emptyList());
+  private static PurgeConfiguration newConfigurationWith30Days(System2 system2, String... disabledComponentUuids) {
+    return new PurgeConfiguration(new IdUuidPair(THE_PROJECT_ID, THE_PROJECT_UUID), new String[0], 30, system2, Arrays.asList(disabledComponentUuids));
   }
 }
diff --git a/sonar-db/src/test/resources/org/sonar/db/purge/PurgeDaoTest/close_issues_clean_index_and_files_sources_of_specified_components-result.xml b/sonar-db/src/test/resources/org/sonar/db/purge/PurgeDaoTest/close_issues_clean_index_and_files_sources_of_specified_components-result.xml
new file mode 100644 (file)
index 0000000..6cfae33
--- /dev/null
@@ -0,0 +1,256 @@
+<!--
+
+What has been changed :
+* enabled=false on projects
+* purge_status=1 on snapshots
+* resolve not already resolved issues on all components
+
+-->
+<dataset>
+
+  <!-- the project -->
+  <projects uuid="P1"
+            uuid_path="NOT_USED"
+            project_uuid="P1"
+            module_uuid="[null]"
+            module_uuid_path="."
+            created_at="[null]"
+            long_name="[null]"
+            scope="PRJ"
+            qualifier="TRK"
+            kee="project"
+            name="project"
+            description="[null]"
+            language="java"
+            copy_component_uuid="[null]"
+            developer_uuid="[null]"
+            path="[null]"
+            deprecated_kee="[null]"
+            authorization_updated_at="[null]"
+            id="1"
+            enabled="[false]"
+            root_uuid="P1"
+            b_changed="[false]"
+            b_copy_component_uuid="[null]"
+            b_description="[null]"
+            b_enabled="[false]"
+            b_language="[null]"
+            b_long_name="[null]"
+            b_module_uuid="[null]"
+            b_module_uuid_path="[null]"
+            b_name="[null]"
+            b_path="[null]"
+            b_qualifier="[null]"/>
+
+  <!-- the directory -->
+  <projects uuid="EFGH"
+            uuid_path="NOT_USED"
+            project_uuid="P1"
+            module_uuid="P1"
+            module_uuid_path="."
+            created_at="[null]"
+            long_name="[null]"
+            scope="DIR"
+            qualifier="DIR"
+            kee="project:my/dir"
+            name="my/dir"
+            description="[null]"
+            language="java"
+            copy_component_uuid="[null]"
+            developer_uuid="[null]"
+            path="[null]"
+            deprecated_kee="[null]"
+            authorization_updated_at="[null]"
+            id="2"
+            enabled="[false]"
+            root_uuid="P1"
+            b_changed="[false]"
+            b_copy_component_uuid="[null]"
+            b_description="[null]"
+            b_enabled="[false]"
+            b_language="[null]"
+            b_long_name="[null]"
+            b_module_uuid="[null]"
+            b_module_uuid_path="[null]"
+            b_name="[null]"
+            b_path="[null]"
+            b_qualifier="[null]"/>
+
+  <!-- the file -->
+  <projects uuid="GHIJ"
+            uuid_path="NOT_USED"
+            project_uuid="P1"
+            module_uuid="P1"
+            module_uuid_path=".P1."
+            created_at="[null]"
+            long_name="[null]"
+            scope="FIL"
+            qualifier="FIL"
+            kee="project:my/dir/File.java"
+            name="my/dir/File.java"
+            description="[null]"
+            language="java"
+            copy_component_uuid="[null]"
+            developer_uuid="[null]"
+            path="[null]"
+            deprecated_kee="[null]"
+            authorization_updated_at="[null]"
+            id="3"
+            enabled="[false]"
+            root_uuid="P1"
+            b_changed="[false]"
+            b_copy_component_uuid="[null]"
+            b_description="[null]"
+            b_enabled="[false]"
+            b_language="[null]"
+            b_long_name="[null]"
+            b_module_uuid="[null]"
+            b_module_uuid_path="[null]"
+            b_name="[null]"
+            b_path="[null]"
+            b_qualifier="[null]"/>
+
+  <snapshots id="1"
+             uuid="u1"
+             component_uuid="P1"
+             status="P"
+             islast="[false]"
+             purge_status="1"
+             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]"
+             created_at="1228222680000"
+             build_date="1228222680000"
+             version="[null]"
+      />
+
+  <!-- Open issue on file -->
+  <issues id="1"
+          kee="ISSUE-1"
+          component_uuid="GHIJ"
+          project_uuid="P1"
+          status="CLOSED"
+          issue_close_date="1396994400000"
+          resolution="REMOVED"
+          line="200"
+          severity="BLOCKER"
+          reporter="[null]"
+          assignee="arthur"
+          rule_id="500"
+          manual_severity="[false]"
+          message="[null]"
+          action_plan_key="[null]"
+          gap="[null]"
+          effort="[null]"
+          issue_attributes="[null]"
+          checksum="[null]"
+          author_login="[null]"
+          updated_at="1450000000000"
+          issue_creation_date="1366063200000"
+          issue_update_date="1396994400000"
+          created_at="1450000000000"
+          tags="[null]"
+          locations="[null]"
+          issue_type="[null]"
+      />
+
+  <!-- Open issue on directory -->
+  <issues id="2"
+          kee="ISSUE-2"
+          component_uuid="EFGH"
+          project_uuid="P1"
+          status="CLOSED"
+          issue_close_date="1396994400000"
+          resolution="REMOVED"
+          line="[null]"
+          severity="BLOCKER"
+          reporter="[null]"
+          assignee="arthur"
+          rule_id="500"
+          manual_severity="[false]"
+          message="[null]"
+          action_plan_key="[null]"
+          gap="[null]"
+          effort="[null]"
+          issue_attributes="[null]"
+          checksum="[null]"
+          author_login="[null]"
+          updated_at="1450000000000"
+          issue_creation_date="1366063200000"
+          issue_update_date="1396994400000"
+          created_at="1450000000000"
+          tags="[null]"
+          locations="[null]"
+          issue_type="[null]"/>
+
+  <!-- Open issue on project -->
+  <issues id="3"
+          kee="ISSUE-3"
+          component_uuid="P1"
+          project_uuid="P1"
+          status="CLOSED"
+          issue_close_date="1396994400000"
+          resolution="REMOVED"
+          line="[null]"
+          severity="BLOCKER"
+          reporter="[null]"
+          assignee="arthur"
+          rule_id="500"
+          manual_severity="[false]"
+          message="[null]"
+          action_plan_key="[null]"
+          gap="[null]"
+          effort="[null]"
+          issue_attributes="[null]"
+          checksum="[null]"
+          author_login="[null]"
+          updated_at="1450000000000"
+          issue_creation_date="1366063200000"
+          issue_update_date="1396994400000"
+          created_at="1450000000000"
+          tags="[null]"
+          locations="[null]"
+          issue_type="[null]"/>
+
+  <!-- Resolved issue on file -> not to be updated -->
+  <issues id="4"
+          kee="ISSUE-4"
+          component_uuid="GHIJ"
+          project_uuid="P1"
+          status="CLOSED"
+          issue_close_date="1449529200000"
+          resolution="FIXED"
+          line="200"
+          severity="BLOCKER"
+          reporter="[null]"
+          assignee="arthur"
+          rule_id="500"
+          manual_severity="[false]"
+          message="[null]"
+          action_plan_key="[null]"
+          gap="[null]"
+          effort="[null]"
+          issue_attributes="[null]"
+          checksum="[null]"
+          author_login="[null]"
+          updated_at="1450000000000"
+          issue_creation_date="1366063200000"
+          issue_update_date="1396908000000"
+          created_at="1450000000000"
+          tags="[null]"
+          locations="[null]"
+          issue_type="[null]"/>
+
+</dataset>
diff --git a/sonar-db/src/test/resources/org/sonar/db/purge/PurgeDaoTest/close_issues_clean_index_and_files_sources_of_specified_components.xml b/sonar-db/src/test/resources/org/sonar/db/purge/PurgeDaoTest/close_issues_clean_index_and_files_sources_of_specified_components.xml
new file mode 100644 (file)
index 0000000..a2b5374
--- /dev/null
@@ -0,0 +1,303 @@
+<dataset>
+
+  <!-- the project -->
+  <projects uuid="P1"
+            uuid_path="NOT_USED"
+            project_uuid="P1"
+            module_uuid="[null]"
+            module_uuid_path="."
+            created_at="[null]"
+            long_name="[null]"
+            scope="PRJ"
+            qualifier="TRK"
+            kee="project"
+            name="project"
+            description="[null]"
+            language="java"
+            copy_component_uuid="[null]"
+            developer_uuid="[null]"
+            path="[null]"
+            deprecated_kee="[null]"
+            authorization_updated_at="[null]"
+            id="1"
+            enabled="[false]"
+            root_uuid="P1"
+            b_changed="[false]"
+            b_copy_component_uuid="[null]"
+            b_description="[null]"
+            b_enabled="[false]"
+            b_language="[null]"
+            b_long_name="[null]"
+            b_module_uuid="[null]"
+            b_module_uuid_path="[null]"
+            b_name="[null]"
+            b_path="[null]"
+            b_qualifier="[null]"/>
+
+  <!-- the directory -->
+  <projects uuid="EFGH"
+            uuid_path="NOT_USED"
+            project_uuid="P1"
+            module_uuid="P1"
+            module_uuid_path="."
+            created_at="[null]"
+            long_name="[null]"
+            scope="DIR"
+            qualifier="DIR"
+            kee="project:my/dir"
+            name="my/dir"
+            description="[null]"
+            language="java"
+            copy_component_uuid="[null]"
+            developer_uuid="[null]"
+            path="[null]"
+            deprecated_kee="[null]"
+            authorization_updated_at="[null]"
+            id="2"
+            enabled="[false]"
+            root_uuid="P1"
+            b_changed="[false]"
+            b_copy_component_uuid="[null]"
+            b_description="[null]"
+            b_enabled="[false]"
+            b_language="[null]"
+            b_long_name="[null]"
+            b_module_uuid="[null]"
+            b_module_uuid_path="[null]"
+            b_name="[null]"
+            b_path="[null]"
+            b_qualifier="[null]"/>
+
+  <!-- the file -->
+  <projects uuid="GHIJ"
+            uuid_path="NOT_USED"
+            project_uuid="P1"
+            module_uuid="P1"
+            module_uuid_path=".P1."
+            created_at="[null]"
+            long_name="[null]"
+            scope="FIL"
+            qualifier="FIL"
+            kee="project:my/dir/File.java"
+            name="my/dir/File.java"
+            description="[null]"
+            language="java"
+            copy_component_uuid="[null]"
+            developer_uuid="[null]"
+            path="[null]"
+            deprecated_kee="[null]"
+            authorization_updated_at="[null]"
+            id="3"
+            enabled="[false]"
+            root_uuid="P1"
+            b_changed="[false]"
+            b_copy_component_uuid="[null]"
+            b_description="[null]"
+            b_enabled="[false]"
+            b_language="[null]"
+            b_long_name="[null]"
+            b_module_uuid="[null]"
+            b_module_uuid_path="[null]"
+            b_name="[null]"
+            b_path="[null]"
+            b_qualifier="[null]"/>
+
+  <snapshots id="1"
+             uuid="u1"
+             component_uuid="P1"
+             status="P"
+             islast="[false]"
+             purge_status="[null]"
+             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]"
+             created_at="1228222680000"
+             build_date="1228222680000"
+             version="[null]"
+  />
+
+  <!-- Open issue on file -->
+  <issues id="1"
+          kee="ISSUE-1"
+          component_uuid="GHIJ"
+          project_uuid="P1"
+          status="OPEN"
+          issue_close_date="[null]"
+          resolution="[null]"
+          line="200"
+          severity="BLOCKER"
+          reporter="[null]"
+          assignee="arthur"
+          rule_id="500"
+          manual_severity="[false]"
+          message="[null]"
+          action_plan_key="[null]"
+          gap="[null]"
+          effort="[null]"
+          issue_attributes="[null]"
+          checksum="[null]"
+          author_login="[null]"
+          updated_at="[null]"
+          issue_creation_date="1366063200000"
+          issue_update_date="1366063200000"
+          created_at="1450000000000"
+          locations="[null]"
+          issue_type="[null]"/>
+
+  <!-- Open issue on directory -->
+  <issues id="2"
+          kee="ISSUE-2"
+          component_uuid="EFGH"
+          project_uuid="P1"
+          status="OPEN"
+          issue_close_date="[null]"
+          resolution="[null]"
+          line="[null]"
+          severity="BLOCKER"
+          reporter="[null]"
+          assignee="arthur"
+          rule_id="500"
+          manual_severity="[false]"
+          message="[null]"
+          action_plan_key="[null]"
+          gap="[null]"
+          effort="[null]"
+          issue_attributes="[null]"
+          checksum="[null]"
+          author_login="[null]"
+          updated_at="[null]"
+          issue_creation_date="1366063200000"
+          issue_update_date="1366063200000"
+          created_at="1450000000000"
+          locations="[null]"
+          issue_type="[null]"/>
+
+  <!-- Open issue on project -->
+  <issues id="3"
+          kee="ISSUE-3"
+          component_uuid="P1"
+          project_uuid="P1"
+          status="CONFIRM"
+          issue_close_date="[null]"
+          resolution="[null]"
+          line="[null]"
+          severity="BLOCKER"
+          reporter="[null]"
+          assignee="arthur"
+          rule_id="500"
+          manual_severity="[false]"
+          message="[null]"
+          action_plan_key="[null]"
+          gap="[null]"
+          effort="[null]"
+          issue_attributes="[null]"
+          checksum="[null]"
+          author_login="[null]"
+          updated_at="[null]"
+          issue_creation_date="1366063200000"
+          issue_update_date="1366063200000"
+          created_at="1450000000000"
+          locations="[null]"
+          issue_type="[null]"/>
+
+  <!-- Resolved issue on file -> not to be updated -->
+  <issues id="4"
+          kee="ISSUE-4"
+          component_uuid="GHIJ"
+          project_uuid="P1"
+          status="CLOSED"
+          issue_close_date="1449529200000"
+          resolution="FIXED"
+          line="200"
+          severity="BLOCKER"
+          reporter="[null]"
+          assignee="arthur"
+          rule_id="500"
+          manual_severity="[false]"
+          message="[null]"
+          action_plan_key="[null]"
+          gap="[null]"
+          effort="[null]"
+          issue_attributes="[null]"
+          checksum="[null]"
+          author_login="[null]"
+          updated_at="1450000000000"
+          issue_creation_date="1366063200000"
+          issue_update_date="1396908000000"
+          created_at="1450000000000"
+          locations="[null]"
+          issue_type="[null]"/>
+
+  <file_sources id="1"
+                project_uuid="P1"
+                file_uuid="GHIJ"
+                binary_data="[null]"
+                line_hashes="[null]"
+                data_hash="321654987"
+                revision="123456789"
+                created_at="123456789"
+                updated_at="123456789"
+                src_hash="12345"
+                data_type="SOURCE"/>
+  <file_sources id="2"
+                project_uuid="P1"
+                file_uuid="KLMN"
+                binary_data="[null]"
+                line_hashes="[null]"
+                data_hash="321654988"
+                revision="123456789"
+                created_at="123456789"
+                updated_at="123456789"
+                src_hash="123456"
+                data_type="SOURCE"/>
+  <file_sources id="3"
+                project_uuid="P1"
+                file_uuid="GHIJ"
+                binary_data="[null]"
+                line_hashes="[null]"
+                data_hash="321654987"
+                revision="123456789"
+                created_at="123456789"
+                updated_at="123456789"
+                src_hash="12345"
+                data_type="TEST"/>
+  <file_sources id="4"
+                project_uuid="P1"
+                file_uuid="KLMN"
+                binary_data="[null]"
+                line_hashes="[null]"
+                data_hash="321654988"
+                revision="123456789"
+                created_at="123456789"
+                updated_at="123456789"
+                src_hash="123456"
+                data_type="TEST"/>
+
+  <resource_index id="1"
+                  kee="project one"
+                  component_uuid="P1"
+                  root_component_uuid="P1"
+                  position="0"
+                  name_size="11"
+                  qualifier="TRK"/>
+  <resource_index id="2"
+                  kee="roject one"
+                  component_uuid="P1"
+                  root_component_uuid="P1"
+                  position="1"
+                  name_size="11"
+                  qualifier="TRK"/>
+
+</dataset>
diff --git a/sonar-db/src/test/resources/org/sonar/db/purge/PurgeDaoTest/delete_file_sources_of_disabled_resources-result.xml b/sonar-db/src/test/resources/org/sonar/db/purge/PurgeDaoTest/delete_file_sources_of_disabled_resources-result.xml
deleted file mode 100644 (file)
index 2deaffe..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-<dataset>
-
-  <file_sources id="2"
-                project_uuid="P1"
-                file_uuid="KLMN"
-                binary_data="[null]"
-                line_hashes="[null]"
-                data_hash="321654988"
-                revision="123456789"
-                created_at="123456789"
-                updated_at="123456789"
-                src_hash="123456"
-                data_type="SOURCE"/>
-  <file_sources id="4"
-                project_uuid="P1"
-                file_uuid="KLMN"
-                binary_data="[null]"
-                line_hashes="[null]"
-                data_hash="321654988"
-                revision="123456789"
-                created_at="123456789"
-                updated_at="123456789"
-                src_hash="123456"
-                data_type="TEST"/>
-</dataset>
diff --git a/sonar-db/src/test/resources/org/sonar/db/purge/PurgeDaoTest/delete_file_sources_of_disabled_resources.xml b/sonar-db/src/test/resources/org/sonar/db/purge/PurgeDaoTest/delete_file_sources_of_disabled_resources.xml
deleted file mode 100644 (file)
index 8ea101b..0000000
+++ /dev/null
@@ -1,163 +0,0 @@
-<dataset>
-
-  <!-- the project -->
-  <projects uuid="P1"
-            uuid_path="."
-            project_uuid="P1"
-            module_uuid="[null]"
-            module_uuid_path="."
-            created_at="[null]"
-            long_name="[null]"
-            scope="PRJ"
-            qualifier="TRK"
-            kee="project"
-            name="project"
-            description="[null]"
-            language="java"
-            copy_component_uuid="[null]"
-            developer_uuid="[null]"
-            path="[null]"
-            deprecated_kee="[null]"
-            authorization_updated_at="[null]"
-            id="1"
-            enabled="[true]"
-            root_uuid="P1"/>
-
-  <!-- the directory -->
-  <projects uuid="EFGH"
-            uuid_path=".P1."
-            project_uuid="P1"
-            module_uuid="P1"
-            module_uuid_path="."
-            created_at="[null]"
-            long_name="[null]"
-            scope="DIR"
-            qualifier="DIR"
-            kee="project:my/dir"
-            name="my/dir"
-            description="[null]"
-            language="java"
-            copy_component_uuid="[null]"
-            developer_uuid="[null]"
-            path="[null]"
-            deprecated_kee="[null]"
-            authorization_updated_at="[null]"
-            id="2"
-            enabled="[true]"
-            root_uuid="P1"/>
-
-  <!-- the files -->
-  <projects uuid="GHIJ"
-            uuid_path=".P1.EFGH."
-            project_uuid="P1"
-            module_uuid="P1"
-            module_uuid_path=".P1."
-            created_at="[null]"
-            long_name="[null]"
-            scope="FIL"
-            qualifier="FIL"
-            kee="project:my/dir/File.java"
-            name="my/dir/File.java"
-            description="[null]"
-            language="java"
-            copy_component_uuid="[null]"
-            developer_uuid="[null]"
-            path="[null]"
-            deprecated_kee="[null]"
-            authorization_updated_at="[null]"
-            id="3"
-            enabled="[true]"
-            root_uuid="P1"/>
-  <projects uuid="KLMN"
-            uuid_path=".P1.EFGH."
-            project_uuid="P1"
-            module_uuid="P1"
-            module_uuid_path=".P1."
-            created_at="[null]"
-            long_name="[null]"
-            scope="FIL"
-            qualifier="FIL"
-            kee="project:my/dir/DeletedFile.java"
-            name="my/dir/DeletedFile.java"
-            description="[null]"
-            language="java"
-            copy_component_uuid="[null]"
-            developer_uuid="[null]"
-            path="[null]"
-            deprecated_kee="[null]"
-            authorization_updated_at="[null]"
-            id="4"
-            enabled="[true]"
-            root_uuid="P1"/>
-
-  <snapshots id="1"
-             uuid="u1"
-             component_uuid="P1"
-             status="P"
-             islast="[false]"
-             purge_status="[null]"
-             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]"
-             created_at="1228222680000"
-             build_date="1228222680000"
-             version="[null]"
-  />
-
-  <file_sources id="1"
-                project_uuid="P1"
-                file_uuid="GHIJ"
-                binary_data="[null]"
-                line_hashes="[null]"
-                data_hash="321654987"
-                revision="123456789"
-                created_at="123456789"
-                updated_at="123456789"
-                src_hash="12345"
-                data_type="SOURCE"/>
-  <file_sources id="2"
-                project_uuid="P1"
-                file_uuid="KLMN"
-                binary_data="[null]"
-                line_hashes="[null]"
-                data_hash="321654988"
-                revision="123456789"
-                created_at="123456789"
-                updated_at="123456789"
-                src_hash="123456"
-                data_type="SOURCE"/>
-  <file_sources id="3"
-                project_uuid="P1"
-                file_uuid="GHIJ"
-                binary_data="[null]"
-                line_hashes="[null]"
-                data_hash="321654987"
-                revision="123456789"
-                created_at="123456789"
-                updated_at="123456789"
-                src_hash="12345"
-                data_type="TEST"/>
-  <file_sources id="4"
-                project_uuid="P1"
-                file_uuid="KLMN"
-                binary_data="[null]"
-                line_hashes="[null]"
-                data_hash="321654988"
-                revision="123456789"
-                created_at="123456789"
-                updated_at="123456789"
-                src_hash="123456"
-                data_type="TEST"/>
-</dataset>
diff --git a/sonar-db/src/test/resources/org/sonar/db/purge/PurgeDaoTest/disable_resources_without_last_snapshot-result.xml b/sonar-db/src/test/resources/org/sonar/db/purge/PurgeDaoTest/disable_resources_without_last_snapshot-result.xml
deleted file mode 100644 (file)
index 4b60f0b..0000000
+++ /dev/null
@@ -1,223 +0,0 @@
-<!--
-
-What has been changed :
-* enabled=false on projects
-* purge_status=1 on snapshots
-* resolve not already resolved issues on all components
-
--->
-<dataset>
-
-  <!-- the project -->
-  <projects uuid="P1"
-            uuid_path="NOT_USED"
-            project_uuid="P1"
-            module_uuid="[null]"
-            module_uuid_path="."
-            created_at="[null]"
-            long_name="[null]"
-            scope="PRJ"
-            qualifier="TRK"
-            kee="project"
-            name="project"
-            description="[null]"
-            language="java"
-            copy_component_uuid="[null]"
-            developer_uuid="[null]"
-            path="[null]"
-            deprecated_kee="[null]"
-            authorization_updated_at="[null]"
-            id="1"
-            enabled="[false]"
-            root_uuid="P1"/>
-
-  <!-- the directory -->
-  <projects uuid="EFGH"
-            uuid_path="NOT_USED"
-            project_uuid="P1"
-            module_uuid="P1"
-            module_uuid_path="."
-            created_at="[null]"
-            long_name="[null]"
-            scope="DIR"
-            qualifier="DIR"
-            kee="project:my/dir"
-            name="my/dir"
-            description="[null]"
-            language="java"
-            copy_component_uuid="[null]"
-            developer_uuid="[null]"
-            path="[null]"
-            deprecated_kee="[null]"
-            authorization_updated_at="[null]"
-            id="2"
-            enabled="[false]"
-            root_uuid="P1"/>
-
-  <!-- the file -->
-  <projects uuid="GHIJ"
-            uuid_path="NOT_USED"
-            project_uuid="P1"
-            module_uuid="P1"
-            module_uuid_path=".P1."
-            created_at="[null]"
-            long_name="[null]"
-            scope="FIL"
-            qualifier="FIL"
-            kee="project:my/dir/File.java"
-            name="my/dir/File.java"
-            description="[null]"
-            language="java"
-            copy_component_uuid="[null]"
-            developer_uuid="[null]"
-            path="[null]"
-            deprecated_kee="[null]"
-            authorization_updated_at="[null]"
-            id="3"
-            enabled="[false]"
-            root_uuid="P1"/>
-
-  <snapshots id="1"
-             uuid="u1"
-             component_uuid="P1"
-             status="P"
-             islast="[false]"
-             purge_status="1"
-             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]"
-             created_at="1228222680000"
-             build_date="1228222680000"
-             version="[null]"
-  />
-
-  <!-- Open issue on file -->
-  <issues id="1"
-          kee="ISSUE-1"
-          component_uuid="GHIJ"
-          project_uuid="P1"
-          status="CLOSED"
-          issue_close_date="1396994400000"
-          resolution="REMOVED"
-          line="200"
-          severity="BLOCKER"
-          reporter="[null]"
-          assignee="arthur"
-          rule_id="500"
-          manual_severity="[false]"
-          message="[null]"
-          action_plan_key="[null]"
-          gap="[null]"
-          effort="[null]"
-          issue_attributes="[null]"
-          checksum="[null]"
-          author_login="[null]"
-          updated_at="1450000000000"
-          issue_creation_date="1366063200000"
-          issue_update_date="1396994400000"
-          created_at="1450000000000"
-          tags="[null]"
-          locations="[null]"
-          issue_type="[null]"
-  />
-
-  <!-- Open issue on directory -->
-  <issues id="2"
-          kee="ISSUE-2"
-          component_uuid="EFGH"
-          project_uuid="P1"
-          status="CLOSED"
-          issue_close_date="1396994400000"
-          resolution="REMOVED"
-          line="[null]"
-          severity="BLOCKER"
-          reporter="[null]"
-          assignee="arthur"
-          rule_id="500"
-          manual_severity="[false]"
-          message="[null]"
-          action_plan_key="[null]"
-          gap="[null]"
-          effort="[null]"
-          issue_attributes="[null]"
-          checksum="[null]"
-          author_login="[null]"
-          updated_at="1450000000000"
-          issue_creation_date="1366063200000"
-          issue_update_date="1396994400000"
-          created_at="1450000000000"
-          tags="[null]"
-          locations="[null]"
-          issue_type="[null]"/>
-
-  <!-- Open issue on project -->
-  <issues id="3"
-          kee="ISSUE-3"
-          component_uuid="P1"
-          project_uuid="P1"
-          status="CLOSED"
-          issue_close_date="1396994400000"
-          resolution="REMOVED"
-          line="[null]"
-          severity="BLOCKER"
-          reporter="[null]"
-          assignee="arthur"
-          rule_id="500"
-          manual_severity="[false]"
-          message="[null]"
-          action_plan_key="[null]"
-          gap="[null]"
-          effort="[null]"
-          issue_attributes="[null]"
-          checksum="[null]"
-          author_login="[null]"
-          updated_at="1450000000000"
-          issue_creation_date="1366063200000"
-          issue_update_date="1396994400000"
-          created_at="1450000000000"
-          tags="[null]"
-          locations="[null]"
-          issue_type="[null]"/>
-
-  <!-- Resolved issue on file -> not to be updated -->
-  <issues id="4"
-          kee="ISSUE-4"
-          component_uuid="GHIJ"
-          project_uuid="P1"
-          status="CLOSED"
-          issue_close_date="1449529200000"
-          resolution="FIXED"
-          line="200"
-          severity="BLOCKER"
-          reporter="[null]"
-          assignee="arthur"
-          rule_id="500"
-          manual_severity="[false]"
-          message="[null]"
-          action_plan_key="[null]"
-          gap="[null]"
-          effort="[null]"
-          issue_attributes="[null]"
-          checksum="[null]"
-          author_login="[null]"
-          updated_at="1450000000000"
-          issue_creation_date="1366063200000"
-          issue_update_date="1396908000000"
-          created_at="1450000000000"
-          tags="[null]"
-          locations="[null]"
-          issue_type="[null]"/>
-
-</dataset>
diff --git a/sonar-db/src/test/resources/org/sonar/db/purge/PurgeDaoTest/disable_resources_without_last_snapshot.xml b/sonar-db/src/test/resources/org/sonar/db/purge/PurgeDaoTest/disable_resources_without_last_snapshot.xml
deleted file mode 100644 (file)
index 3d6ad34..0000000
+++ /dev/null
@@ -1,210 +0,0 @@
-<dataset>
-
-  <!-- the project -->
-  <projects uuid="P1"
-            uuid_path="NOT_USED"
-            project_uuid="P1"
-            module_uuid="[null]"
-            module_uuid_path="."
-            created_at="[null]"
-            long_name="[null]"
-            scope="PRJ"
-            qualifier="TRK"
-            kee="project"
-            name="project"
-            description="[null]"
-            language="java"
-            copy_component_uuid="[null]"
-            developer_uuid="[null]"
-            path="[null]"
-            deprecated_kee="[null]"
-            authorization_updated_at="[null]"
-            id="1"
-            enabled="[true]"
-            root_uuid="P1"/>
-
-  <!-- the directory -->
-  <projects uuid="EFGH"
-            uuid_path="NOT_USED"
-            project_uuid="P1"
-            module_uuid="P1"
-            module_uuid_path="."
-            created_at="[null]"
-            long_name="[null]"
-            scope="DIR"
-            qualifier="DIR"
-            kee="project:my/dir"
-            name="my/dir"
-            description="[null]"
-            language="java"
-            copy_component_uuid="[null]"
-            developer_uuid="[null]"
-            path="[null]"
-            deprecated_kee="[null]"
-            authorization_updated_at="[null]"
-            id="2"
-            enabled="[true]"
-            root_uuid="P1"/>
-
-  <!-- the file -->
-  <projects uuid="GHIJ"
-            uuid_path="NOT_USED"
-            project_uuid="P1"
-            module_uuid="P1"
-            module_uuid_path=".P1."
-            created_at="[null]"
-            long_name="[null]"
-            scope="FIL"
-            qualifier="FIL"
-            kee="project:my/dir/File.java"
-            name="my/dir/File.java"
-            description="[null]"
-            language="java"
-            copy_component_uuid="[null]"
-            developer_uuid="[null]"
-            path="[null]"
-            deprecated_kee="[null]"
-            authorization_updated_at="[null]"
-            id="3"
-            enabled="[true]"
-            root_uuid="P1"/>
-
-  <snapshots id="1"
-             uuid="u1"
-             component_uuid="P1"
-             status="P"
-             islast="[false]"
-             purge_status="[null]"
-             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]"
-             created_at="1228222680000"
-             build_date="1228222680000"
-             version="[null]"
-  />
-
-  <!-- Open issue on file -->
-  <issues id="1"
-          kee="ISSUE-1"
-          component_uuid="GHIJ"
-          project_uuid="P1"
-          status="OPEN"
-          issue_close_date="[null]"
-          resolution="[null]"
-          line="200"
-          severity="BLOCKER"
-          reporter="[null]"
-          assignee="arthur"
-          rule_id="500"
-          manual_severity="[false]"
-          message="[null]"
-          action_plan_key="[null]"
-          gap="[null]"
-          effort="[null]"
-          issue_attributes="[null]"
-          checksum="[null]"
-          author_login="[null]"
-          updated_at="[null]"
-          issue_creation_date="1366063200000"
-          issue_update_date="1366063200000"
-          created_at="1450000000000"
-          locations="[null]"
-          issue_type="[null]"/>
-
-  <!-- Open issue on directory -->
-  <issues id="2"
-          kee="ISSUE-2"
-          component_uuid="EFGH"
-          project_uuid="P1"
-          status="OPEN"
-          issue_close_date="[null]"
-          resolution="[null]"
-          line="[null]"
-          severity="BLOCKER"
-          reporter="[null]"
-          assignee="arthur"
-          rule_id="500"
-          manual_severity="[false]"
-          message="[null]"
-          action_plan_key="[null]"
-          gap="[null]"
-          effort="[null]"
-          issue_attributes="[null]"
-          checksum="[null]"
-          author_login="[null]"
-          updated_at="[null]"
-          issue_creation_date="1366063200000"
-          issue_update_date="1366063200000"
-          created_at="1450000000000"
-          locations="[null]"
-          issue_type="[null]"/>
-
-  <!-- Open issue on project -->
-  <issues id="3"
-          kee="ISSUE-3"
-          component_uuid="P1"
-          project_uuid="P1"
-          status="CONFIRM"
-          issue_close_date="[null]"
-          resolution="[null]"
-          line="[null]"
-          severity="BLOCKER"
-          reporter="[null]"
-          assignee="arthur"
-          rule_id="500"
-          manual_severity="[false]"
-          message="[null]"
-          action_plan_key="[null]"
-          gap="[null]"
-          effort="[null]"
-          issue_attributes="[null]"
-          checksum="[null]"
-          author_login="[null]"
-          updated_at="[null]"
-          issue_creation_date="1366063200000"
-          issue_update_date="1366063200000"
-          created_at="1450000000000"
-          locations="[null]"
-          issue_type="[null]"/>
-
-  <!-- Resolved issue on file -> not to be updated -->
-  <issues id="4"
-          kee="ISSUE-4"
-          component_uuid="GHIJ"
-          project_uuid="P1"
-          status="CLOSED"
-          issue_close_date="1449529200000"
-          resolution="FIXED"
-          line="200"
-          severity="BLOCKER"
-          reporter="[null]"
-          assignee="arthur"
-          rule_id="500"
-          manual_severity="[false]"
-          message="[null]"
-          action_plan_key="[null]"
-          gap="[null]"
-          effort="[null]"
-          issue_attributes="[null]"
-          checksum="[null]"
-          author_login="[null]"
-          updated_at="1450000000000"
-          issue_creation_date="1366063200000"
-          issue_update_date="1396908000000"
-          created_at="1450000000000"
-          locations="[null]"
-          issue_type="[null]"/>
-
-</dataset>