diff options
author | Duarte Meneses <duarte.meneses@sonarsource.com> | 2023-01-24 09:05:09 -0600 |
---|---|---|
committer | sonartech <sonartech@sonarsource.com> | 2023-02-02 20:03:39 +0000 |
commit | 3d33985aa46148329696d0955e32563273f1a7a2 (patch) | |
tree | 371baae5d4131500f579f034a84135e102af372c /sonar-scanner-protocol/src/test/java/org/sonar | |
parent | 6d6ce351677a037bbbd49d0ed0f64f1fdd9eb1ec (diff) | |
download | sonarqube-3d33985aa46148329696d0955e32563273f1a7a2.tar.gz sonarqube-3d33985aa46148329696d0955e32563273f1a7a2.zip |
SONAR-17706 Drop support for modules in WS
Diffstat (limited to 'sonar-scanner-protocol/src/test/java/org/sonar')
-rw-r--r-- | sonar-scanner-protocol/src/test/java/org/sonar/scanner/protocol/input/MultiModuleProjectRepositoryTest.java | 68 | ||||
-rw-r--r-- | sonar-scanner-protocol/src/test/java/org/sonar/scanner/protocol/input/ProjectRepositoriesTest.java (renamed from sonar-scanner-protocol/src/test/java/org/sonar/scanner/protocol/input/SingleProjectRepositoryTest.java) | 9 |
2 files changed, 2 insertions, 75 deletions
diff --git a/sonar-scanner-protocol/src/test/java/org/sonar/scanner/protocol/input/MultiModuleProjectRepositoryTest.java b/sonar-scanner-protocol/src/test/java/org/sonar/scanner/protocol/input/MultiModuleProjectRepositoryTest.java deleted file mode 100644 index d10d479ef82..00000000000 --- a/sonar-scanner-protocol/src/test/java/org/sonar/scanner/protocol/input/MultiModuleProjectRepositoryTest.java +++ /dev/null @@ -1,68 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2023 SonarSource SA - * mailto:info AT sonarsource DOT com - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -package org.sonar.scanner.protocol.input; - -import org.junit.Before; -import org.junit.Test; - -import static org.assertj.core.api.Assertions.assertThat; - -public class MultiModuleProjectRepositoryTest { - - private MultiModuleProjectRepository repository; - - @Before - public void setUp() { - repository = new MultiModuleProjectRepository(); - } - - @Test - public void add_file_data_to_nodule() { - FileData fileData1 = new FileData("123", "456"); - FileData fileData2 = new FileData("153", "6432"); - FileData fileData3 = new FileData("987", "6343"); - - repository.addFileDataToModule("Module1", "/Abc.java", fileData1); - repository.addFileDataToModule("Module1", "/Xyz.java", fileData2); - repository.addFileDataToModule("Module2", "/Def.java", fileData3); - - assertThat(repository.repositoriesByModule()).hasSize(2); - assertThat(repository.fileData("Module1", "/Xyz.java")).isEqualTo(fileData2); - assertThat(repository.fileData("Module2", "/Def.java")).isEqualTo(fileData3); - } - - @Test - public void add_file_does_not_add_the_file_without_path() { - FileData fileData = new FileData("123", "456"); - - repository.addFileDataToModule("module1", null, fileData); - - assertThat(repository.repositoriesByModule()).isEmpty(); - } - - @Test - public void add_file_does_not_add_the_file_without_revision_and_hash() { - FileData fileData = new FileData(null, null); - - repository.addFileDataToModule("module2", "/Abc.java", fileData); - - assertThat(repository.repositoriesByModule()).isEmpty(); - } -} diff --git a/sonar-scanner-protocol/src/test/java/org/sonar/scanner/protocol/input/SingleProjectRepositoryTest.java b/sonar-scanner-protocol/src/test/java/org/sonar/scanner/protocol/input/ProjectRepositoriesTest.java index eb2185faa00..2918a438acc 100644 --- a/sonar-scanner-protocol/src/test/java/org/sonar/scanner/protocol/input/SingleProjectRepositoryTest.java +++ b/sonar-scanner-protocol/src/test/java/org/sonar/scanner/protocol/input/ProjectRepositoriesTest.java @@ -25,13 +25,8 @@ import org.junit.Test; import static org.assertj.core.api.Assertions.assertThat; -public class SingleProjectRepositoryTest { - private SingleProjectRepository repository; - - @Before - public void setUp() { - repository = new SingleProjectRepository(); - } +public class ProjectRepositoriesTest { + private final ProjectRepositories repository = new ProjectRepositories(); @Test public void add_file_data() { |