diff options
author | Julien Lancelot <julien.lancelot@sonarsource.com> | 2015-07-16 13:57:59 +0200 |
---|---|---|
committer | Julien Lancelot <julien.lancelot@sonarsource.com> | 2015-07-16 13:57:59 +0200 |
commit | a1ea8a8353579113d944c8d980fdde6973c3c6a5 (patch) | |
tree | 797cf82f4139a05ae55230c2f3557dbfaed4d0d1 /sonar-db/src | |
parent | 309871615f7bbb2fe10b07f5eb30ddf01cae20d1 (diff) | |
download | sonarqube-a1ea8a8353579113d944c8d980fdde6973c3c6a5.tar.gz sonarqube-a1ea8a8353579113d944c8d980fdde6973c3c6a5.zip |
SONAR-6702 Fix UT on MsSQL when projects.kee is null
Diffstat (limited to 'sonar-db/src')
8 files changed, 28 insertions, 26 deletions
diff --git a/sonar-db/src/test/java/org/sonar/db/user/AuthorDaoTest.java b/sonar-db/src/test/java/org/sonar/db/user/AuthorDaoTest.java index 0a11e469394..c3ec351c257 100644 --- a/sonar-db/src/test/java/org/sonar/db/user/AuthorDaoTest.java +++ b/sonar-db/src/test/java/org/sonar/db/user/AuthorDaoTest.java @@ -56,7 +56,7 @@ public class AuthorDaoTest { dao.insertAuthor("godin", 13L); - dbTester.assertDbUnit(getClass(), "shouldInsertAuthor-result.xml", new String[]{"created_at", "updated_at"}, "authors"); + dbTester.assertDbUnit(getClass(), "shouldInsertAuthor-result.xml", new String[] {"created_at", "updated_at"}, "authors"); } @Test @@ -76,7 +76,7 @@ public class AuthorDaoTest { dao.insertAuthorAndDeveloper(login, resourceDto); dbTester.assertDbUnit(getClass(), "shouldInsertAuthorAndDeveloper-result.xml", - new String[]{"created_at", "updated_at", "copy_resource_id", "description", "enabled", "kee", "deprecated_kee", "path", "language", "long_name", "person_id", "root_id", + new String[] {"created_at", "updated_at", "copy_resource_id", "description", "enabled", "kee", "deprecated_kee", "path", "language", "long_name", "person_id", "root_id", "scope", "authorization_updated_at"}, "authors", "projects"); } @@ -85,12 +85,14 @@ public class AuthorDaoTest { public void add_missing_module_uuid_path() { dbTester.prepareDbUnit(getClass(), "add_missing_module_uuid_path.xml"); - dao.insertAuthorAndDeveloper("developer@company.net", new ResourceDto().setName("developer@company.net").setQualifier("DEV").setUuid("ABCD").setProjectUuid("ABCD") + dao.insertAuthorAndDeveloper("developer@company.net", new ResourceDto().setKey("developer").setName("developer@company.net").setQualifier("DEV").setUuid("ABCD") + .setProjectUuid("ABCD") .setModuleUuidPath("")); - dao.insertAuthorAndDeveloper("developer2@company.net", new ResourceDto().setName("developer2@company.net").setQualifier("DEV").setUuid("BCDE").setProjectUuid("BCDE")); + dao.insertAuthorAndDeveloper("developer2@company.net", new ResourceDto().setKey("developer2").setName("developer2@company.net").setQualifier("DEV").setUuid("BCDE") + .setProjectUuid("BCDE")); dbTester.assertDbUnit(getClass(), "add_missing_module_uuid_path-result.xml", - new String[]{"created_at", "updated_at", "copy_resource_id", "description", "enabled", "kee", "deprecated_kee", "path", "language", "long_name", "person_id", "root_id", + new String[] {"created_at", "updated_at", "copy_resource_id", "description", "enabled", "kee", "deprecated_kee", "path", "language", "long_name", "person_id", "root_id", "scope", "authorization_updated_at"}, "authors", "projects"); } @@ -105,7 +107,7 @@ public class AuthorDaoTest { } catch (RuntimeException ex) { } - dbTester.assertDbUnit(getClass(), "shouldPreventAuthorsDuplication-result.xml", new String[]{"created_at", "updated_at"}, "authors"); + dbTester.assertDbUnit(getClass(), "shouldPreventAuthorsDuplication-result.xml", new String[] {"created_at", "updated_at"}, "authors"); } @Test @@ -122,7 +124,7 @@ public class AuthorDaoTest { } dbTester.assertDbUnit(getClass(), "shouldPreventAuthorsAndDevelopersDuplication-result.xml", - new String[]{"created_at", "updated_at", "copy_resource_id", "description", "enabled", "kee", "deprecated_kee", "path", "language", "long_name", "person_id", "root_id", + new String[] {"created_at", "updated_at", "copy_resource_id", "description", "enabled", "kee", "deprecated_kee", "path", "language", "long_name", "person_id", "root_id", "scope", "authorization_updated_at"}, "authors", "projects"); } diff --git a/sonar-db/src/test/resources/org/sonar/db/component/ResourceIndexDaoTest/select_project_ids_from_query_and_view_or_sub_view_uuid.xml b/sonar-db/src/test/resources/org/sonar/db/component/ResourceIndexDaoTest/select_project_ids_from_query_and_view_or_sub_view_uuid.xml index aff69473ce1..bdb7aa44055 100644 --- a/sonar-db/src/test/resources/org/sonar/db/component/ResourceIndexDaoTest/select_project_ids_from_query_and_view_or_sub_view_uuid.xml +++ b/sonar-db/src/test/resources/org/sonar/db/component/ResourceIndexDaoTest/select_project_ids_from_query_and_view_or_sub_view_uuid.xml @@ -1,15 +1,15 @@ <dataset> <!-- Real projects --> - <projects id="1" uuid="ABCD" project_uuid="ABCD" module_uuid_path=".ABCD." copy_resource_id="[null]" name="Project One" qualifier="TRK" scope="PRJ"/> - <projects id="2" uuid="BCDE" project_uuid="BCDE" module_uuid_path=".BCDE." copy_resource_id="[null]" name="Project Two" qualifier="TRK" scope="PRJ"/> + <projects id="1" uuid="ABCD" project_uuid="ABCD" module_uuid_path=".ABCD." kee="project-one" copy_resource_id="[null]" name="Project One" qualifier="TRK" scope="PRJ"/> + <projects id="2" uuid="BCDE" project_uuid="BCDE" module_uuid_path=".BCDE." kee="project-two" copy_resource_id="[null]" name="Project Two" qualifier="TRK" scope="PRJ"/> <!-- Copy projects --> - <projects id="3" uuid="CDEF" project_uuid="EFGH" module_uuid_path=".EFGH." copy_resource_id="1" name="Copy Project One" qualifier="TRK" scope="FIL"/> - <projects id="4" uuid="DEFG" project_uuid="EFGH" module_uuid_path=".EFGH." copy_resource_id="2" name="Copy Project One" qualifier="TRK" scope="FIL"/> + <projects id="3" uuid="CDEF" project_uuid="EFGH" module_uuid_path=".EFGH." kee="copy-project-one" copy_resource_id="1" name="Copy Project One" qualifier="TRK" scope="FIL"/> + <projects id="4" uuid="DEFG" project_uuid="EFGH" module_uuid_path=".EFGH." kee="copy-project-two" copy_resource_id="2" name="Copy Project One" qualifier="TRK" scope="FIL"/> <!-- View containing all projects --> - <projects id="5" uuid="EFGH" project_uuid="EFGH" module_uuid_path=".EFGH." copy_resource_id="[null]" name="All projects" qualifier="VW" scope="PRJ"/> + <projects id="5" uuid="EFGH" project_uuid="EFGH" module_uuid_path=".EFGH." kee="all-projects" copy_resource_id="[null]" name="All projects" qualifier="VW" scope="PRJ"/> <resource_index id="1" kee="project one" resource_id="1" root_project_id="1" position="0" name_size="11" qualifier="TRK"/> <resource_index id="2" kee="roject one" resource_id="1" root_project_id="1" position="1" name_size="11" qualifier="TRK"/> diff --git a/sonar-db/src/test/resources/org/sonar/db/property/PropertiesDaoTest/shouldFindUsersForNotification.xml b/sonar-db/src/test/resources/org/sonar/db/property/PropertiesDaoTest/shouldFindUsersForNotification.xml index 891d895d7f2..63c723d4f57 100644 --- a/sonar-db/src/test/resources/org/sonar/db/property/PropertiesDaoTest/shouldFindUsersForNotification.xml +++ b/sonar-db/src/test/resources/org/sonar/db/property/PropertiesDaoTest/shouldFindUsersForNotification.xml @@ -1,7 +1,7 @@ <dataset> - <projects id="45" uuid="uuid_45"/> - <projects id="56" uuid="uuid_56"/> + <projects id="45" uuid="uuid_45" kee="45"/> + <projects id="56" uuid="uuid_56" kee="46"/> <properties id="1" diff --git a/sonar-db/src/test/resources/org/sonar/db/qualitygate/ProjectQgateAssociationDaoTest/shared.xml b/sonar-db/src/test/resources/org/sonar/db/qualitygate/ProjectQgateAssociationDaoTest/shared.xml index 9fb6b533775..48410ec3321 100644 --- a/sonar-db/src/test/resources/org/sonar/db/qualitygate/ProjectQgateAssociationDaoTest/shared.xml +++ b/sonar-db/src/test/resources/org/sonar/db/qualitygate/ProjectQgateAssociationDaoTest/shared.xml @@ -3,13 +3,13 @@ <quality_gates id="42" name="Golden"/> <quality_gates id="43" name="Ninth"/> - <projects id="1" uuid="A" name="Project One" qualifier="TRK" scope="PRJ"/> - <projects id="2" uuid="B" name="Project Two" qualifier="TRK" scope="PRJ"/> - <projects id="3" uuid="C" name="Project Three" qualifier="TRK" scope="PRJ"/> - <projects id="4" uuid="D" name="Project Four" qualifier="TRK" scope="PRJ"/> - <projects id="5" uuid="E" name="Project Five" qualifier="TRK" scope="PRJ"/> - <projects id="6" uuid="F" name="View Six" qualifier="VW" scope="PRJ"/> - <projects id="7" uuid="G" name="Project One" qualifier="TRK" scope="FIL"/> + <projects id="1" uuid="A" kee="project-one" name="Project One" qualifier="TRK" scope="PRJ"/> + <projects id="2" uuid="B" kee="project-two" name="Project Two" qualifier="TRK" scope="PRJ"/> + <projects id="3" uuid="C" kee="project-three" name="Project Three" qualifier="TRK" scope="PRJ"/> + <projects id="4" uuid="D" kee="project-four" name="Project Four" qualifier="TRK" scope="PRJ"/> + <projects id="5" uuid="E" kee="project-five" name="Project Five" qualifier="TRK" scope="PRJ"/> + <projects id="6" uuid="F" kee="view-six" name="View Six" qualifier="VW" scope="PRJ"/> + <projects id="7" uuid="G" kee="file-one" name="File One" qualifier="TRK" scope="FIL"/> <resource_index id="1" kee="project one" resource_id="1" root_project_id="1" position="0" name_size="11" qualifier="TRK"/> diff --git a/sonar-db/src/test/resources/org/sonar/db/user/AuthorDaoTest/add_missing_module_uuid_path-result.xml b/sonar-db/src/test/resources/org/sonar/db/user/AuthorDaoTest/add_missing_module_uuid_path-result.xml index 912c502b3f9..72100ecc2a0 100644 --- a/sonar-db/src/test/resources/org/sonar/db/user/AuthorDaoTest/add_missing_module_uuid_path-result.xml +++ b/sonar-db/src/test/resources/org/sonar/db/user/AuthorDaoTest/add_missing_module_uuid_path-result.xml @@ -1,9 +1,9 @@ <dataset> - <projects id="1" name="developer@company.net" qualifier="DEV" uuid="ABCD" project_uuid="ABCD" module_uuid="[null]" + <projects id="1" kee="developer" name="developer@company.net" qualifier="DEV" uuid="ABCD" project_uuid="ABCD" module_uuid="[null]" module_uuid_path=".ABCD."/> <authors id="1" person_id="1" login="developer@company.net"/> - <projects id="2" name="developer2@company.net" qualifier="DEV" uuid="BCDE" project_uuid="BCDE" module_uuid="[null]" + <projects id="2" kee="developer2" name="developer2@company.net" qualifier="DEV" uuid="BCDE" project_uuid="BCDE" module_uuid="[null]" module_uuid_path=".BCDE."/> <authors id="2" person_id="2" login="developer2@company.net"/> </dataset> diff --git a/sonar-db/src/test/resources/org/sonar/db/user/AuthorDaoTest/shouldInsertAuthorAndDeveloper-result.xml b/sonar-db/src/test/resources/org/sonar/db/user/AuthorDaoTest/shouldInsertAuthorAndDeveloper-result.xml index c7c3436d390..894ab330a68 100644 --- a/sonar-db/src/test/resources/org/sonar/db/user/AuthorDaoTest/shouldInsertAuthorAndDeveloper-result.xml +++ b/sonar-db/src/test/resources/org/sonar/db/user/AuthorDaoTest/shouldInsertAuthorAndDeveloper-result.xml @@ -1,5 +1,5 @@ <dataset> - <projects id="1" name="developer@company.net" qualifier="DEV" uuid="ABCD" project_uuid="ABCD" module_uuid="[null]" + <projects id="1" kee="developer" name="developer@company.net" qualifier="DEV" uuid="ABCD" project_uuid="ABCD" module_uuid="[null]" module_uuid_path="."/> <authors id="1" person_id="1" login="developer@company.net"/> </dataset> diff --git a/sonar-db/src/test/resources/org/sonar/db/user/AuthorDaoTest/shouldPreventAuthorsAndDevelopersDuplication-result.xml b/sonar-db/src/test/resources/org/sonar/db/user/AuthorDaoTest/shouldPreventAuthorsAndDevelopersDuplication-result.xml index ddca7b45c66..d82ea489b98 100644 --- a/sonar-db/src/test/resources/org/sonar/db/user/AuthorDaoTest/shouldPreventAuthorsAndDevelopersDuplication-result.xml +++ b/sonar-db/src/test/resources/org/sonar/db/user/AuthorDaoTest/shouldPreventAuthorsAndDevelopersDuplication-result.xml @@ -1,6 +1,6 @@ <dataset> - <projects id="1" name="developer@company.net" qualifier="DEV" uuid="[null]" project_uuid="[null]" module_uuid="[null]" + <projects id="1" kee="developer" name="developer@company.net" qualifier="DEV" uuid="[null]" project_uuid="[null]" module_uuid="[null]" module_uuid_path="."/> <authors id="1" person_id="1" login="developer@company.net"/> diff --git a/sonar-db/src/test/resources/org/sonar/db/user/AuthorDaoTest/shouldPreventAuthorsAndDevelopersDuplication.xml b/sonar-db/src/test/resources/org/sonar/db/user/AuthorDaoTest/shouldPreventAuthorsAndDevelopersDuplication.xml index ddca7b45c66..d82ea489b98 100644 --- a/sonar-db/src/test/resources/org/sonar/db/user/AuthorDaoTest/shouldPreventAuthorsAndDevelopersDuplication.xml +++ b/sonar-db/src/test/resources/org/sonar/db/user/AuthorDaoTest/shouldPreventAuthorsAndDevelopersDuplication.xml @@ -1,6 +1,6 @@ <dataset> - <projects id="1" name="developer@company.net" qualifier="DEV" uuid="[null]" project_uuid="[null]" module_uuid="[null]" + <projects id="1" kee="developer" name="developer@company.net" qualifier="DEV" uuid="[null]" project_uuid="[null]" module_uuid="[null]" module_uuid_path="."/> <authors id="1" person_id="1" login="developer@company.net"/> |