]> source.dussan.org Git - sonarqube.git/commitdiff
Fix unit test on Postgresql
authorSimon Brandhof <simon.brandhof@gmail.com>
Tue, 10 Jul 2012 12:33:49 +0000 (14:33 +0200)
committerSimon Brandhof <simon.brandhof@gmail.com>
Tue, 10 Jul 2012 12:33:49 +0000 (14:33 +0200)
sonar-core/src/main/resources/org/sonar/core/resource/ResourceMapper-oracle.xml
sonar-core/src/test/java/org/sonar/core/resource/ResourceDaoTest.java
sonar-core/src/test/resources/org/sonar/core/resource/ResourceDaoTest/insertOrUpdate-result.xml
sonar-core/src/test/resources/org/sonar/core/resource/ResourceDaoTest/insertOrUpdate.xml

index 558e4a3577af36e4fc05d693d130756e4120f986..b2be3b7858df3f4e8f530a8fd52449c7f291f612 100644 (file)
@@ -87,7 +87,6 @@
     <selectKey order="BEFORE" resultType="Long" keyProperty="id">
       select projects_seq.NEXTVAL from DUAL
     </selectKey>
-
     insert into projects
     (id, name, long_name, description, scope, qualifier, kee, language, root_id, copy_resource_id, person_id, profile_id, enabled)
     values (
index 26f8513367ac5bdfd0c1100c5553e2e1f9f4c9c0..503056ee7946877237dd805a2fff18e4b6f03551 100644 (file)
@@ -144,13 +144,13 @@ public class ResourceDaoTest extends AbstractDaoTestCase {
   public void insertOrUpdate() {
     setupData("insertOrUpdate");
 
-    // update because already persisted
+    // to be updated
     ResourceDto project = new ResourceDto()
       .setKey("org.struts:struts").setScope(Scopes.PROJECT).setQualifier(Qualifiers.PROJECT)
       .setName("Struts").setLongName("Apache Struts").setLanguage("java").setDescription("MVC Framework")
-      .setId(1L);
+      .setId(100L);
 
-    // insert
+    // to be inserted
     ResourceDto file1 = new ResourceDto()
       .setKey("org.struts:struts:org.struts.Action").setScope(Scopes.FILE).setQualifier(Qualifiers.FILE)
       .setLanguage("java").setName("Action").setLongName("org.struts.Action");
@@ -163,7 +163,7 @@ public class ResourceDaoTest extends AbstractDaoTestCase {
     assertThat(project.getId()).isNotNull();
     assertThat(file1.getId()).isNotNull();
     assertThat(file2.getId()).isNotNull();
-    checkTables("insertOrUpdate", "projects");
+    checkTables("insertOrUpdate", new String[]{"id"}, "projects");
   }
 
 }
index 668f78eed164352e6df1d933e730c0334039b5a3..a1cae231f15e412c26ea18494eb4eb61bb707197 100644 (file)
@@ -1,14 +1,14 @@
 <dataset>
 
-  <projects id="1" root_id="[null]" scope="PRJ" qualifier="TRK" kee="org.struts:struts" name="Struts"
+  <projects root_id="[null]" scope="PRJ" qualifier="TRK" kee="org.struts:struts" name="Struts"
             description="MVC Framework" long_name="Apache Struts"
             enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" profile_id="[null]"/>
 
-  <projects id="2" root_id="[null]" scope="FIL" qualifier="FIL" kee="org.struts:struts:org.struts.Action" name="Action"
+  <projects root_id="[null]" scope="FIL" qualifier="FIL" kee="org.struts:struts:org.struts.Action" name="Action"
             description="[null]" long_name="org.struts.Action"
             enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" profile_id="[null]"/>
 
-  <projects id="3" root_id="[null]" scope="FIL" qualifier="FIL" kee="org.struts:struts:org.struts.Filter" name="Filter"
+  <projects root_id="[null]" scope="FIL" qualifier="FIL" kee="org.struts:struts:org.struts.Filter" name="Filter"
             description="[null]" long_name="org.struts.Filter"
             enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" profile_id="[null]"/>
 
index 10fdddc66ff5d328edbe9e7e6348053a2aa9b1f9..1a5e2978a07924d68c326b3a87f7243df537e4f5 100644 (file)
@@ -1,6 +1,6 @@
 <dataset>
 
-  <projects id="1" root_id="200" scope="PRJ" qualifier="TRK" kee="old key" name="old name"
+  <projects id="100" root_id="200" scope="PRJ" qualifier="TRK" kee="old key" name="old name"
             description="old name" long_name="old long name"
             enabled="[false]" language="old" copy_resource_id="2" person_id="3" profile_id="4"/>