diff options
Diffstat (limited to 'it')
4 files changed, 36 insertions, 0 deletions
diff --git a/it/it-projects/batch/multi-module-repeated-names/modules/module1/module1/sources/Fake.java b/it/it-projects/batch/multi-module-repeated-names/modules/module1/module1/sources/Fake.java new file mode 100644 index 00000000000..e67004defc5 --- /dev/null +++ b/it/it-projects/batch/multi-module-repeated-names/modules/module1/module1/sources/Fake.java @@ -0,0 +1 @@ +class Fake {} diff --git a/it/it-projects/batch/multi-module-repeated-names/modules/module1/sources/Fake.java b/it/it-projects/batch/multi-module-repeated-names/modules/module1/sources/Fake.java new file mode 100644 index 00000000000..e67004defc5 --- /dev/null +++ b/it/it-projects/batch/multi-module-repeated-names/modules/module1/sources/Fake.java @@ -0,0 +1 @@ +class Fake {} diff --git a/it/it-projects/batch/multi-module-repeated-names/sonar-project.properties b/it/it-projects/batch/multi-module-repeated-names/sonar-project.properties new file mode 100644 index 00000000000..b1816be030b --- /dev/null +++ b/it/it-projects/batch/multi-module-repeated-names/sonar-project.properties @@ -0,0 +1,19 @@ +sonar.projectKey=com.foo.project +sonar.projectName=Foo Project +sonar.projectVersion=1.0-SNAPSHOT +sonar.projectDescription=Description of Foo Project + +sonar.sources=sources +sonar.tests=tests +sonar.binaries=target/classes + +sonar.modules=module1 + +module1.sonar.projectBaseDir=modules/module1 +module1.sonar.projectKey=com.foo.project.module1 +module1.sonar.projectName=Foo Module 1 +module1.sonar.modules=module1 + +module1.module1.sonar.projectBaseDir=module1 +module1.module1.sonar.projectKey=com.foo.project.module1.module1 +module1.module1.sonar.projectName=Foo Sub Module 1 diff --git a/it/it-tests/src/test/java/batch/suite/ProjectBuilderTest.java b/it/it-tests/src/test/java/batch/suite/ProjectBuilderTest.java index d0e9bad2dc9..f76e61414e3 100644 --- a/it/it-tests/src/test/java/batch/suite/ProjectBuilderTest.java +++ b/it/it-tests/src/test/java/batch/suite/ProjectBuilderTest.java @@ -7,6 +7,9 @@ package batch.suite; import static org.assertj.core.api.Assertions.assertThat; +import com.sonar.orchestrator.build.BuildFailureException; + +import com.sonar.orchestrator.build.SonarRunner; import util.ItUtils; import com.sonar.orchestrator.Orchestrator; import com.sonar.orchestrator.build.MavenBuild; @@ -44,6 +47,18 @@ public class ProjectBuilderTest { assertThat(getResource("com.sonarsource.it.projects.batch:project-builder-module-b:src/IgnoredFile.java")).isNull(); } + @Test + // SONAR-6665 + public void errorSubModuleSameName() { + SonarRunner build = SonarRunner.create(ItUtils.projectDir("batch/multi-module-repeated-names")); + + try { + orchestrator.executeBuild(build); + } catch (BuildFailureException e) { + assertThat(e.getResult().getLogs()).contains("Two modules have the same name: module1"); + } + } + private void checkProject() { Resource project = getResource("com.sonarsource.it.projects.batch:project-builder"); |