diff options
author | Sébastien Lesaint <sebastien.lesaint@sonarsource.com> | 2019-01-16 14:19:36 +0100 |
---|---|---|
committer | sonartech <sonartech@sonarsource.com> | 2019-02-11 09:11:46 +0100 |
commit | 47ebff25c379b9162943121a49278553967f2dfe (patch) | |
tree | 4d5bf3e095021ce397261f97c5d9113c76225bc9 /sonar-plugin-api/src/test/java/org/sonar/api/batch | |
parent | 3373e5778af7c9e5b02aa23b07c7c2c8592e5da5 (diff) | |
download | sonarqube-47ebff25c379b9162943121a49278553967f2dfe.tar.gz sonarqube-47ebff25c379b9162943121a49278553967f2dfe.zip |
SONAR-11631 replace Component.version by Metadata.projectVersion
in scanner report
Diffstat (limited to 'sonar-plugin-api/src/test/java/org/sonar/api/batch')
3 files changed, 5 insertions, 8 deletions
diff --git a/sonar-plugin-api/src/test/java/org/sonar/api/batch/bootstrap/ProjectBuilderTest.java b/sonar-plugin-api/src/test/java/org/sonar/api/batch/bootstrap/ProjectBuilderTest.java index 2272df4a304..48f3746bd35 100644 --- a/sonar-plugin-api/src/test/java/org/sonar/api/batch/bootstrap/ProjectBuilderTest.java +++ b/sonar-plugin-api/src/test/java/org/sonar/api/batch/bootstrap/ProjectBuilderTest.java @@ -66,7 +66,7 @@ public class ProjectBuilderTest { subProject.setBaseDir(baseDir); subProject.setWorkDir(new File(baseDir, "target/.sonar")); subProject.setKey("groupId:parentProjectId"); - subProject.setVersion(root.getOriginalVersion()); + subProject.setProjectVersion(root.getOriginalVersion()); subProject.setName("Sub Project"); subProject.setSources("src"); root.addSubProject(subProject); diff --git a/sonar-plugin-api/src/test/java/org/sonar/api/batch/bootstrap/ProjectDefinitionTest.java b/sonar-plugin-api/src/test/java/org/sonar/api/batch/bootstrap/ProjectDefinitionTest.java index 7120ff49d47..a69dad61ada 100644 --- a/sonar-plugin-api/src/test/java/org/sonar/api/batch/bootstrap/ProjectDefinitionTest.java +++ b/sonar-plugin-api/src/test/java/org/sonar/api/batch/bootstrap/ProjectDefinitionTest.java @@ -37,14 +37,14 @@ public class ProjectDefinitionTest { @Test public void shouldSetVersion() { ProjectDefinition def = ProjectDefinition.create(); - def.setVersion("2.0-SNAPSHOT"); + def.setProjectVersion("2.0-SNAPSHOT"); assertThat(def.getVersion()).isEqualTo("2.0-SNAPSHOT"); } @Test public void shouldSupportNoVersion() { ProjectDefinition def = ProjectDefinition.create(); - def.setVersion(null); + def.setProjectVersion(null); assertThat(def.getVersion()).isEqualTo("not provided"); assertThat(def.getOriginalVersion()).isEqualTo(""); } diff --git a/sonar-plugin-api/src/test/java/org/sonar/api/batch/fs/internal/DefaultInputProjectTest.java b/sonar-plugin-api/src/test/java/org/sonar/api/batch/fs/internal/DefaultInputProjectTest.java index 33751cd6151..8a4a33bdce3 100644 --- a/sonar-plugin-api/src/test/java/org/sonar/api/batch/fs/internal/DefaultInputProjectTest.java +++ b/sonar-plugin-api/src/test/java/org/sonar/api/batch/fs/internal/DefaultInputProjectTest.java @@ -42,7 +42,6 @@ public class DefaultInputProjectTest { def.setName("projectName"); File baseDir = temp.newFolder(); def.setBaseDir(baseDir); - def.setVersion("version"); def.setDescription("desc"); File workDir = temp.newFolder(); def.setWorkDir(workDir); @@ -57,13 +56,11 @@ public class DefaultInputProjectTest { assertThat(project.getBranch()).isNull(); assertThat(project.getBaseDir()).isEqualTo(baseDir.toPath()); assertThat(project.getKeyWithBranch()).isEqualTo("projectKey"); - assertThat(project.getVersion()).isEqualTo("version"); - assertThat(project.getOriginalVersion()).isEqualTo("version"); assertThat(project.getDescription()).isEqualTo("desc"); assertThat(project.getWorkDir()).isEqualTo(workDir.toPath()); assertThat(project.getEncoding()).isEqualTo(Charset.defaultCharset()); - assertThat(project.properties()).hasSize(6); + assertThat(project.properties()).hasSize(5); assertThat(project.isFile()).isFalse(); } @@ -75,7 +72,7 @@ public class DefaultInputProjectTest { def.setName("projectName"); File baseDir = temp.newFolder(); def.setBaseDir(baseDir); - def.setVersion("version"); + def.setProjectVersion("version"); def.setDescription("desc"); File workDir = temp.newFolder(); def.setWorkDir(workDir); |