diff options
author | Julien Lancelot <julien.lancelot@sonarsource.com> | 2015-01-05 13:15:38 +0100 |
---|---|---|
committer | Julien Lancelot <julien.lancelot@sonarsource.com> | 2015-01-05 13:25:37 +0100 |
commit | 186d57c4cae6a2e72bd0ad207886bdf2f851e2f0 (patch) | |
tree | 61bfa420c8b82b0d4ccf93c42c3f83dc3039f3ef /sonar-core | |
parent | c74e4c417bee0260b07ba90a36ebc67ecd06e057 (diff) | |
parent | 57c683d7042fb519aeacb77362e8da268dbfc5ee (diff) | |
download | sonarqube-186d57c4cae6a2e72bd0ad207886bdf2f851e2f0.tar.gz sonarqube-186d57c4cae6a2e72bd0ad207886bdf2f851e2f0.zip |
Merge remote-tracking branch 'origin/branch-5.0'
Diffstat (limited to 'sonar-core')
4 files changed, 11 insertions, 6 deletions
diff --git a/sonar-core/src/main/java/org/sonar/core/resource/ResourceDao.java b/sonar-core/src/main/java/org/sonar/core/resource/ResourceDao.java index b26f6ff465e..26de7532558 100644 --- a/sonar-core/src/main/java/org/sonar/core/resource/ResourceDao.java +++ b/sonar-core/src/main/java/org/sonar/core/resource/ResourceDao.java @@ -158,6 +158,7 @@ public class ResourceDao implements DaoComponent { String uuid = Uuids.create(); resource.setUuid(uuid); resource.setProjectUuid(uuid); + resource.setModuleUuidPath(""); } resource.setCreatedAt(now); resource.setAuthorizationUpdatedAt(now.getTime()); diff --git a/sonar-core/src/main/resources/org/sonar/core/resource/ResourceMapper.xml b/sonar-core/src/main/resources/org/sonar/core/resource/ResourceMapper.xml index c8fd624cb6e..9b29c8f5f70 100644 --- a/sonar-core/src/main/resources/org/sonar/core/resource/ResourceMapper.xml +++ b/sonar-core/src/main/resources/org/sonar/core/resource/ResourceMapper.xml @@ -209,9 +209,11 @@ <insert id="insert" parameterType="Resource" keyColumn="id" useGeneratedKeys="true" keyProperty="id" > insert into projects - (uuid, project_uuid, name, long_name, description, scope, qualifier, kee, deprecated_kee, path, language, root_id, copy_resource_id, person_id, enabled, authorization_updated_at, created_at) + (uuid, project_uuid, module_uuid, module_uuid_path, name, long_name, description, scope, qualifier, kee, deprecated_kee, path, language, root_id, copy_resource_id, person_id, + enabled, authorization_updated_at, created_at) values ( - #{uuid,jdbcType=VARCHAR}, #{projectUuid,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{longName,jdbcType=VARCHAR}, #{description,jdbcType=VARCHAR}, #{scope,jdbcType=VARCHAR}, #{qualifier,jdbcType=VARCHAR}, + #{uuid,jdbcType=VARCHAR}, #{projectUuid,jdbcType=VARCHAR}, #{moduleUuid,jdbcType=VARCHAR}, #{moduleUuidPath,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, + #{longName,jdbcType=VARCHAR}, #{description,jdbcType=VARCHAR}, #{scope,jdbcType=VARCHAR}, #{qualifier,jdbcType=VARCHAR}, #{key,jdbcType=VARCHAR}, #{deprecatedKey,jdbcType=VARCHAR}, #{path,jdbcType=VARCHAR}, #{language,jdbcType=VARCHAR}, #{rootId,jdbcType=INTEGER}, #{copyResourceId,jdbcType=INTEGER}, #{personId,jdbcType=INTEGER}, #{enabled,jdbcType=BOOLEAN}, #{authorizationUpdatedAt,jdbcType=BIGINT}, #{createdAt,jdbcType=TIMESTAMP} ) diff --git a/sonar-core/src/test/java/org/sonar/core/resource/ResourceDaoTest.java b/sonar-core/src/test/java/org/sonar/core/resource/ResourceDaoTest.java index b5fdb0c48ac..a071e054929 100644 --- a/sonar-core/src/test/java/org/sonar/core/resource/ResourceDaoTest.java +++ b/sonar-core/src/test/java/org/sonar/core/resource/ResourceDaoTest.java @@ -251,12 +251,12 @@ public class ResourceDaoTest extends AbstractDaoTestCase { setupData("insert"); ResourceDto file1 = new ResourceDto() - .setUuid("ABCD").setProjectUuid("EFGH") + .setUuid("ABCD").setProjectUuid("EFGH").setModuleUuid("EFGH").setModuleUuidPath("EFGH") .setKey("org.struts:struts:/src/main/java/org/struts/Action.java") .setDeprecatedKey("org.struts:struts:org.struts.Action").setScope(Scopes.FILE).setQualifier(Qualifiers.FILE) .setLanguage("java").setName("Action").setLongName("org.struts.Action").setPath("/foo/bar"); ResourceDto file2 = new ResourceDto() - .setUuid("BCDE").setProjectUuid("FGHI") + .setUuid("BCDE").setProjectUuid("FGHI").setModuleUuid("FGHI").setModuleUuidPath("FGHI") .setKey("org.struts:struts:/src/main/java/org/struts/Filter.java") .setDeprecatedKey("org.struts:struts:org.struts.Filter").setScope(Scopes.FILE).setQualifier(Qualifiers.FILE) .setLanguage("java").setName("Filter").setLongName("org.struts.Filter"); @@ -314,9 +314,11 @@ public class ResourceDaoTest extends AbstractDaoTestCase { assertThat(project.getUuid()).isNotNull(); assertThat(project.getProjectUuid()).isEqualTo(project.getUuid()); + assertThat(project.getModuleUuidPath()).isEmpty(); assertThat(file.getUuid()).isNull(); assertThat(file.getProjectUuid()).isNull(); + assertThat(file.getModuleUuidPath()).isNull(); } @Test diff --git a/sonar-core/src/test/resources/org/sonar/core/resource/ResourceDaoTest/insert-result.xml b/sonar-core/src/test/resources/org/sonar/core/resource/ResourceDaoTest/insert-result.xml index 08cef5638d4..bbaa53ea1a3 100644 --- a/sonar-core/src/test/resources/org/sonar/core/resource/ResourceDaoTest/insert-result.xml +++ b/sonar-core/src/test/resources/org/sonar/core/resource/ResourceDaoTest/insert-result.xml @@ -1,12 +1,12 @@ <dataset> - <projects id="1" root_id="[null]" uuid="ABCD" project_uuid="EFGH" module_uuid="[null]" module_uuid_path="[null]" + <projects id="1" root_id="[null]" uuid="ABCD" project_uuid="EFGH" module_uuid="EFGH" module_uuid_path="EFGH" scope="FIL" qualifier="FIL" kee="org.struts:struts:/src/main/java/org/struts/Action.java" name="Action" description="[null]" long_name="org.struts.Action" enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" created_at="2014-09-03" path="/foo/bar" deprecated_kee="org.struts:struts:org.struts.Action" authorization_updated_at="123456789"/> - <projects id="2" root_id="[null]" uuid="BCDE" project_uuid="FGHI" module_uuid="[null]" module_uuid_path="[null]" + <projects id="2" root_id="[null]" uuid="BCDE" project_uuid="FGHI" module_uuid="FGHI" module_uuid_path="FGHI" scope="FIL" qualifier="FIL" kee="org.struts:struts:/src/main/java/org/struts/Filter.java" name="Filter" description="[null]" long_name="org.struts.Filter" enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" created_at="2014-09-03" path="[null]" deprecated_kee="org.struts:struts:org.struts.Filter" |