]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-3636 Add and feed a new column projects.created_at
authorFabrice Bellingard <fabrice.bellingard@sonarsource.com>
Thu, 27 Sep 2012 08:41:48 +0000 (10:41 +0200)
committerFabrice Bellingard <fabrice.bellingard@sonarsource.com>
Thu, 27 Sep 2012 08:41:48 +0000 (10:41 +0200)
=> Update tests

sonar-batch/src/test/java/org/sonar/batch/index/DefaultResourcePersisterTest.java
sonar-batch/src/test/resources/org/sonar/batch/index/DefaultResourcePersisterTest/shared.xml
sonar-batch/src/test/resources/org/sonar/batch/index/DefaultResourcePersisterTest/shouldRemoveRootIndexIfResourceIsProject-result.xml
sonar-batch/src/test/resources/org/sonar/batch/index/DefaultResourcePersisterTest/shouldRemoveRootIndexIfResourceIsProject.xml
sonar-batch/src/test/resources/org/sonar/batch/index/DefaultResourcePersisterTest/shouldSaveNewDirectory-result.xml
sonar-batch/src/test/resources/org/sonar/batch/index/DefaultResourcePersisterTest/shouldSaveNewLibrary-result.xml
sonar-batch/src/test/resources/org/sonar/batch/index/DefaultResourcePersisterTest/shouldSaveNewMultiModulesProject-result.xml
sonar-batch/src/test/resources/org/sonar/batch/index/DefaultResourcePersisterTest/shouldSaveNewProject-result.xml
sonar-batch/src/test/resources/org/sonar/batch/index/DefaultResourcePersisterTest/shouldUpdateExistingResource-result.xml
sonar-batch/src/test/resources/org/sonar/batch/index/DefaultResourcePersisterTest/shouldUpdateExistingResource.xml

index 8b34120b9f0250d7e76c31082a6a9aafbe7c5b89..2068dbee67df42e6d136695d92d174908d336686 100644 (file)
@@ -67,7 +67,7 @@ public class DefaultResourcePersisterTest extends AbstractDbUnitTestCase {
     ResourcePersister persister = new DefaultResourcePersister(getSession());
     persister.saveProject(singleProject, null);
 
-    checkTables("shouldSaveNewProject", new String[] {"build_date"}, "projects", "snapshots");
+    checkTables("shouldSaveNewProject", new String[] {"build_date", "created_at"}, "projects", "snapshots");
   }
 
   @Test
@@ -80,7 +80,7 @@ public class DefaultResourcePersisterTest extends AbstractDbUnitTestCase {
     persister.saveProject(moduleB, multiModuleProject);
     persister.saveProject(moduleB1, moduleB);
 
-    checkTables("shouldSaveNewMultiModulesProject", new String[] {"build_date"}, "projects", "snapshots");
+    checkTables("shouldSaveNewMultiModulesProject", new String[] {"build_date", "created_at"}, "projects", "snapshots");
   }
 
   @Test
@@ -92,7 +92,7 @@ public class DefaultResourcePersisterTest extends AbstractDbUnitTestCase {
     persister.saveResource(singleProject, new JavaPackage("org.foo").setEffectiveKey("foo:org.foo"));
 
     // check that the directory is attached to the project
-    checkTables("shouldSaveNewDirectory", new String[] {"build_date"}, "projects", "snapshots");
+    checkTables("shouldSaveNewDirectory", new String[] {"build_date", "created_at"}, "projects", "snapshots");
   }
 
   @Test
@@ -105,7 +105,7 @@ public class DefaultResourcePersisterTest extends AbstractDbUnitTestCase {
     persister.saveResource(singleProject, new Library("junit:junit", "4.8.2").setEffectiveKey("junit:junit"));// do nothing, already saved
     persister.saveResource(singleProject, new Library("junit:junit", "3.2").setEffectiveKey("junit:junit"));
 
-    checkTables("shouldSaveNewLibrary", new String[] {"build_date"}, "projects", "snapshots");
+    checkTables("shouldSaveNewLibrary", new String[] {"build_date", "created_at"}, "projects", "snapshots");
   }
 
   @Test
@@ -133,7 +133,7 @@ public class DefaultResourcePersisterTest extends AbstractDbUnitTestCase {
     singleProject.setDescription("new description");
     persister.saveProject(singleProject, null);
 
-    checkTables("shouldUpdateExistingResource", new String[] {"build_date"}, "projects", "snapshots");
+    checkTables("shouldUpdateExistingResource", new String[] {"build_date", "created_at"}, "projects", "snapshots");
   }
 
   // SONAR-1700
@@ -144,7 +144,7 @@ public class DefaultResourcePersisterTest extends AbstractDbUnitTestCase {
     ResourcePersister persister = new DefaultResourcePersister(getSession());
     persister.saveProject(singleProject, null);
 
-    checkTables("shouldRemoveRootIndexIfResourceIsProject", new String[] {"build_date"}, "projects", "snapshots");
+    checkTables("shouldRemoveRootIndexIfResourceIsProject", new String[] {"build_date", "created_at"}, "projects", "snapshots");
   }
 
 }
index b0d3176964bd655ce8820eeafc28b310767e2ffc..cff08ac82fe7784a9bb115e0e14ce0c1edc4a1f4 100644 (file)
@@ -3,7 +3,7 @@
   <!-- other project -->
   <projects id="1000" scope="PRJ" qualifier="TRK" kee="my:key" root_id="[null]"
             name="Other project" long_name="Other" description="[null]"
-            enabled="true" language="java" copy_resource_id="[null]" person_id="[null]" profile_id="[null]"/>
+            enabled="true" language="java" copy_resource_id="[null]" person_id="[null]" profile_id="[null]" created_at="[null]"/>
 
   <snapshots 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]" id="3000" project_id="1000" parent_snapshot_id="[null]" root_project_id="1000" root_snapshot_id="[null]"
              scope="PRJ" qualifier="TRK" created_at="2008-11-01 13:58:00.00" build_date="2008-11-01 13:58:00.00" version="[null]" path=""
index 147b3c37abfe1a8e426e38e289c8c362f82258f3..475dc3fe89b35667b3be0c620bb0555853d7ec95 100644 (file)
@@ -2,7 +2,7 @@
 
   <projects id="1001" scope="PRJ" qualifier="TRK" kee="foo" root_id="[null]"
             name="Foo" long_name="Foo" description="some description"
-            enabled="true" language="java" copy_resource_id="[null]" person_id="[null]" profile_id="[null]"/>
+            enabled="true" language="java" copy_resource_id="[null]" person_id="[null]" profile_id="[null]" created_at="[null]"/>
 
   <!-- old snapshot -->
   <snapshots 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]" id="3001" project_id="1001" parent_snapshot_id="[null]" root_project_id="1001" root_snapshot_id="[null]"
index 56b2ab204d2db5d0a2d36036e1a31991240174bc..a8e44dd6f86d01221af734e61f1e4c889fdce904 100644 (file)
@@ -3,7 +3,7 @@
   <!-- This project has a root_id which should be set to NULL (SONAR-1700) -->
   <projects id="1001" scope="PRJ" qualifier="TRK" kee="foo" root_id="12345"
             name="name" long_name="long name" description="description"
-            enabled="true" language="java" copy_resource_id="[null]" person_id="[null]" profile_id="[null]"/>
+            enabled="true" language="java" copy_resource_id="[null]" person_id="[null]" profile_id="[null]" created_at="[null]"/>
 
   <snapshots 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]" id="3001" project_id="1001" parent_snapshot_id="[null]" root_project_id="1001" root_snapshot_id="[null]"
              scope="PRJ" qualifier="TRK" created_at="2010-12-23 00:00:00.00" build_date="2010-12-23 00:00:00.00" version="[null]" path=""
index 7ce78e742c1333bd35420ff0e183f8ea82daed8e..b78bd590b186f35514972dfe035f291c9a3c7fb9 100644 (file)
@@ -3,7 +3,7 @@
   <!-- other project -->
   <projects id="1000" scope="PRJ" qualifier="TRK" kee="my:key" root_id="[null]"
             name="Other project" long_name="Other" description="[null]"
-            enabled="true" language="java" copy_resource_id="[null]" person_id="[null]" profile_id="[null]"/>
+            enabled="true" language="java" copy_resource_id="[null]" person_id="[null]" profile_id="[null]" created_at="[null]"/>
 
   <snapshots 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]" id="3000" project_id="1000" parent_snapshot_id="[null]" root_project_id="1000" root_snapshot_id="[null]"
              scope="PRJ" qualifier="TRK" created_at="2008-11-01 13:58:00.00" build_date="2008-11-01 13:58:00.00" version="[null]" path=""
   <!-- new project -->
   <projects id="1001" scope="PRJ" qualifier="TRK" kee="foo" root_id="[null]"
             name="Foo" long_name="Foo" description="some description"
-            enabled="true" language="java" copy_resource_id="[null]" person_id="[null]" profile_id="[null]"/>
+            enabled="true" language="java" copy_resource_id="[null]" person_id="[null]" profile_id="[null]" created_at="[null]"/>
 
   <projects id="1002" scope="DIR" qualifier="PAC" kee="foo:org.foo" root_id="1001"
             name="org.foo" long_name="org.foo" description="[null]"
-            enabled="true" language="java" copy_resource_id="[null]" person_id="[null]" profile_id="[null]"/>
+            enabled="true" language="java" copy_resource_id="[null]" person_id="[null]" profile_id="[null]" created_at="[null]"/>
 
   <snapshots 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]" id="3001" project_id="1001" parent_snapshot_id="[null]" root_project_id="1001" root_snapshot_id="[null]"
              scope="PRJ" qualifier="TRK" created_at="2010-12-25 00:00:00.00" build_date="2010-12-25 00:00:00.00" version="[null]" path=""
index 00654ab48df6c44d9dd756789c205537962feeca..bfc203efeeaf97a5f9261bae26e8b7522b234834 100644 (file)
@@ -3,7 +3,7 @@
   <!-- other project -->
   <projects id="1000" scope="PRJ" qualifier="TRK" kee="my:key" root_id="[null]"
             name="Other project" long_name="Other" description="[null]"
-            enabled="true" language="java" copy_resource_id="[null]" person_id="[null]" profile_id="[null]"/>
+            enabled="true" language="java" copy_resource_id="[null]" person_id="[null]" profile_id="[null]" created_at="[null]"/>
 
   <snapshots 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]" id="3000" project_id="1000" parent_snapshot_id="[null]" root_project_id="1000" root_snapshot_id="[null]"
              scope="PRJ" qualifier="TRK" created_at="2008-11-01 13:58:00.00" build_date="2008-11-01 13:58:00.00" version="[null]" path=""
   <!-- new project -->
   <projects id="1001" scope="PRJ" qualifier="TRK" kee="foo" root_id="[null]"
             name="Foo" long_name="Foo" description="some description"
-            enabled="true" language="java" copy_resource_id="[null]" person_id="[null]" profile_id="[null]"/>
+            enabled="true" language="java" copy_resource_id="[null]" person_id="[null]" profile_id="[null]" created_at="[null]"/>
 
   <projects id="1002" scope="PRJ" qualifier="LIB" kee="junit:junit" root_id="[null]"
             name="junit:junit" long_name="junit:junit" description="[null]"
-            enabled="true" language="[null]" copy_resource_id="[null]" person_id="[null]" profile_id="[null]"/>
+            enabled="true" language="[null]" copy_resource_id="[null]" person_id="[null]" profile_id="[null]" created_at="[null]"/>
 
   <snapshots 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]" id="3001" project_id="1001" parent_snapshot_id="[null]" root_project_id="1001" root_snapshot_id="[null]"
              scope="PRJ" qualifier="TRK" created_at="2010-12-25 00:00:00.00" build_date="2010-12-25 00:00:00.00" version="[null]" path=""
index d4d5128df0d54ee21917e54c567e8ace092482fd..5e9999e6488ec80670a927a7b4d09d701a608e25 100644 (file)
@@ -3,7 +3,7 @@
   <!-- other project -->
   <projects id="1000" scope="PRJ" qualifier="TRK" kee="my:key" root_id="[null]"
             name="Other project" long_name="Other" description="[null]"
-            enabled="true" language="java" copy_resource_id="[null]" person_id="[null]" profile_id="[null]"/>
+            enabled="true" language="java" copy_resource_id="[null]" person_id="[null]" profile_id="[null]" created_at="[null]"/>
 
   <snapshots 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]" id="3000" project_id="1000" parent_snapshot_id="[null]" root_project_id="1000" root_snapshot_id="[null]"
              scope="PRJ" qualifier="TRK" created_at="2008-11-01 13:58:00.00" build_date="2008-11-01 13:58:00.00" version="[null]" path=""
   <!-- new project -->
   <projects id="1001" scope="PRJ" qualifier="TRK" kee="root" root_id="[null]"
             name="Root" long_name="Root" description="[null]"
-            enabled="true" language="java" copy_resource_id="[null]" person_id="[null]" profile_id="[null]"/>
+            enabled="true" language="java" copy_resource_id="[null]" person_id="[null]" profile_id="[null]" created_at="[null]"/>
 
   <projects id="1002" scope="PRJ" qualifier="BRC" kee="a" root_id="1001"
             name="A" long_name="A" description="[null]"
-            enabled="true" language="java" copy_resource_id="[null]" person_id="[null]" profile_id="[null]"/>
+            enabled="true" language="java" copy_resource_id="[null]" person_id="[null]" profile_id="[null]" created_at="[null]"/>
 
   <projects id="1003" scope="PRJ" qualifier="BRC" kee="b" root_id="1001"
             name="B" long_name="B" description="[null]"
-            enabled="true" language="java" copy_resource_id="[null]" person_id="[null]" profile_id="[null]"/>
+            enabled="true" language="java" copy_resource_id="[null]" person_id="[null]" profile_id="[null]" created_at="[null]"/>
 
   <projects id="1004" scope="PRJ" qualifier="BRC" kee="b1" root_id="1001"
             name="B1" long_name="B1" description="[null]"
-            enabled="true" language="java" copy_resource_id="[null]" person_id="[null]" profile_id="[null]"/>
+            enabled="true" language="java" copy_resource_id="[null]" person_id="[null]" profile_id="[null]" created_at="[null]"/>
 
 
   <snapshots 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]" id="3001" project_id="1001" root_project_id="1001" parent_snapshot_id="[null]"  root_snapshot_id="[null]"
index 2eebe8f7ce279e0d9f634731393082dc859d45bf..e78b1d113568897ef2bd49315de2750606639fdc 100644 (file)
@@ -3,7 +3,7 @@
   <!-- other project -->
   <projects id="1000" scope="PRJ" qualifier="TRK" kee="my:key" root_id="[null]"
             name="Other project" long_name="Other" description="[null]"
-            enabled="true" language="java" copy_resource_id="[null]" person_id="[null]" profile_id="[null]"/>
+            enabled="true" language="java" copy_resource_id="[null]" person_id="[null]" profile_id="[null]" created_at="[null]"/>
 
   <snapshots 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]" id="3000" project_id="1000" parent_snapshot_id="[null]" root_project_id="1000" root_snapshot_id="[null]"
              scope="PRJ" qualifier="TRK" created_at="2008-11-01 13:58:00.00" build_date="2008-11-01 13:58:00.00" version="[null]" path=""
@@ -13,7 +13,7 @@
   <!-- new project -->
   <projects id="1001" scope="PRJ" qualifier="TRK" kee="foo" root_id="[null]"
             name="Foo" long_name="Foo" description="some description"
-            enabled="true" language="java" copy_resource_id="[null]" person_id="[null]" profile_id="[null]"/>
+            enabled="true" language="java" copy_resource_id="[null]" person_id="[null]" profile_id="[null]" created_at="[null]"/>
 
   <snapshots 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]" id="3001" project_id="1001" parent_snapshot_id="[null]" root_project_id="1001" root_snapshot_id="[null]"
              scope="PRJ" qualifier="TRK" created_at="2010-12-25 00:00:00.00" build_date="2010-12-25 00:00:00.00" version="[null]" path=""
index dee68cf4db9293e8e92c6fae0b0bcb89859fbef4..4114dac7b8e13969700761596a84b03fb411e2fc 100644 (file)
@@ -2,7 +2,7 @@
 
   <projects id="1001" scope="PRJ" qualifier="TRK" kee="foo" root_id="[null]"
             name="new name" long_name="new name" description="new description"
-            enabled="true" language="java" copy_resource_id="[null]" person_id="[null]" profile_id="[null]"/>
+            enabled="true" language="java" copy_resource_id="[null]" person_id="[null]" profile_id="[null]" created_at="[null]"/>
 
   <!-- old snapshot -->
   <snapshots 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]" id="3001" project_id="1001" parent_snapshot_id="[null]" root_project_id="1001" root_snapshot_id="[null]"
index 3e6ecc1bf927f3964b8cefb0c38b9da220a98ccf..95efadf881b3101723ebfa4641c1ec910ddaf72e 100644 (file)
@@ -2,7 +2,7 @@
 
   <projects id="1001" scope="PRJ" qualifier="TRK" kee="foo" root_id="[null]"
             name="old name" long_name="old name" description="old description"
-            enabled="true" language="java" copy_resource_id="[null]" person_id="[null]" profile_id="[null]"/>
+            enabled="true" language="java" copy_resource_id="[null]" person_id="[null]" profile_id="[null]" created_at="[null]"/>
 
   <snapshots 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]" id="3001" project_id="1001" parent_snapshot_id="[null]" root_project_id="1001" root_snapshot_id="[null]"
              scope="PRJ" qualifier="TRK" created_at="2010-12-23 00:00:00.00" build_date="2010-12-23 00:00:00.00" version="[null]" path=""