]> source.dussan.org Git - sonarqube.git/commitdiff
Remove setup data from DuplicationsParserTest
authorJulien Lancelot <julien.lancelot@sonarsource.com>
Thu, 24 Aug 2017 08:16:31 +0000 (10:16 +0200)
committerJulien Lancelot <julien.lancelot@sonarsource.com>
Thu, 24 Aug 2017 09:22:25 +0000 (11:22 +0200)
server/sonar-server/src/main/java/org/sonar/server/duplication/ws/DuplicationsParser.java
server/sonar-server/src/main/java/org/sonar/server/duplication/ws/ShowAction.java
server/sonar-server/src/test/java/org/sonar/server/duplication/ws/DuplicationsParserTest.java
server/sonar-server/src/test/java/org/sonar/server/duplication/ws/DuplicationsWsTest.java [deleted file]
server/sonar-server/src/test/java/org/sonar/server/duplication/ws/ShowActionTest.java
server/sonar-server/src/test/resources/org/sonar/server/duplication/ws/DuplicationsParserTest/complex_duplication.xml [deleted file]
server/sonar-server/src/test/resources/org/sonar/server/duplication/ws/DuplicationsParserTest/duplication_on_removed_file.xml [deleted file]
server/sonar-server/src/test/resources/org/sonar/server/duplication/ws/DuplicationsParserTest/duplication_on_same_file.xml [deleted file]
server/sonar-server/src/test/resources/org/sonar/server/duplication/ws/DuplicationsParserTest/duplication_on_same_project.xml [deleted file]
server/sonar-server/src/test/resources/org/sonar/server/duplication/ws/DuplicationsParserTest/duplications_on_different_project.xml [deleted file]
server/sonar-server/src/test/resources/org/sonar/server/duplication/ws/DuplicationsParserTest/duplications_on_many_blocks.xml [deleted file]

index d752d3912c19a326c1fecd78fcb6dd2da8e63c13..09714a7fdc7caf940e770e2a9836adb026c020af 100644 (file)
@@ -52,7 +52,7 @@ public class DuplicationsParser {
     this.componentDao = componentDao;
   }
 
-  public List<Block> parse(ComponentDto component, @Nullable String duplicationsData, DbSession session) {
+  public List<Block> parse(DbSession session, ComponentDto component, @Nullable String duplicationsData) {
     Map<String, ComponentDto> componentsByKey = newHashMap();
     List<Block> blocks = newArrayList();
     if (duplicationsData != null) {
index 31e5fa771a000c4addf997ec8bfe035d60713bc9..0c8deadd27c4ca22ee94130afad3971170dca07a 100644 (file)
@@ -83,8 +83,7 @@ public class ShowAction implements DuplicationsWsAction {
       ComponentDto component = componentFinder.getByUuidOrKey(dbSession, request.param("uuid"), request.param("key"), UUID_AND_KEY);
       userSession.checkComponentPermission(UserRole.CODEVIEWER, component);
       String duplications = findDataFromComponent(dbSession, component);
-      List<DuplicationsParser.Block> blocks = parser.parse(component, duplications, dbSession);
-
+      List<DuplicationsParser.Block> blocks = parser.parse(dbSession, component, duplications);
       writeProtobuf(responseBuilder.build(blocks, dbSession), request, response);
     }
   }
index c7411e97adf99453344238b0841228b86f1e3d33..3af65ff51a0ed492ed644b82a1546ee22636cd6b 100644 (file)
@@ -21,82 +21,43 @@ package org.sonar.server.duplication.ws;
 
 import com.google.common.base.Predicate;
 import com.google.common.collect.Iterables;
-import com.google.common.io.Files;
-import com.google.common.io.Resources;
-import java.io.File;
-import java.io.IOException;
-import java.nio.charset.StandardCharsets;
 import java.util.List;
 import javax.annotation.Nullable;
-import org.junit.Before;
 import org.junit.Rule;
 import org.junit.Test;
-import org.sonar.api.utils.System2;
-import org.sonar.db.DbSession;
 import org.sonar.db.DbTester;
-import org.sonar.db.component.ComponentDao;
 import org.sonar.db.component.ComponentDto;
-import org.sonar.db.component.ComponentTesting;
-import org.sonar.db.organization.OrganizationDto;
 
+import static java.lang.String.format;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.sonar.db.component.ComponentTesting.newFileDto;
 
-
 public class DuplicationsParserTest {
 
   @Rule
-  public DbTester db = DbTester.create(System2.INSTANCE);
-
-  final DbSession dbSession = db.getSession();
-
-  ComponentDao componentDao = db.getDbClient().componentDao();
-
-  OrganizationDto organizationDto;
-
-  ComponentDto currentFile;
-  ComponentDto fileOnSameProject;
-  ComponentDto fileOnDifferentProject;
-
-  ComponentDto project1;
-  ComponentDto project2;
-
-  DuplicationsParser parser = new DuplicationsParser(componentDao);
-
-  @Before
-  public void setUp() {
-    organizationDto = db.organizations().insert();
-    project1 = ComponentTesting.newPrivateProjectDto(organizationDto)
-      .setName("SonarQube")
-      .setLongName("SonarQube")
-      .setDbKey("org.codehaus.sonar:sonar");
-    project2 = ComponentTesting.newPrivateProjectDto(organizationDto);
-    componentDao.insert(dbSession, project1, project2);
+  public DbTester db = DbTester.create();
 
-    // Current file
-    String key1 = "org.codehaus.sonar:sonar-plugin-api:src/main/java/org/sonar/api/utils/command/CommandExecutor.java";
-    currentFile = newFileDto(project1, null).setDbKey(key1).setLongName("CommandExecutor");
-
-    // File on same project
-    String key2 = "org.codehaus.sonar:sonar-plugin-api:src/main/java/com/sonar/orchestrator/util/CommandExecutor.java";
-    fileOnSameProject = newFileDto(project1, null).setDbKey(key2).setLongName("CommandExecutor");
-
-    // File on different project
-    String key3 = "com.sonarsource.orchestrator:sonar-orchestrator:src/main/java/com/sonar/orchestrator/util/CommandExecutor.java";
-    fileOnDifferentProject = newFileDto(project2, null).setDbKey(key3).setLongName("CommandExecutor");
-
-    componentDao.insert(dbSession, currentFile, fileOnSameProject, fileOnDifferentProject);
-    dbSession.commit();
-  }
+  DuplicationsParser parser = new DuplicationsParser(db.getDbClient().componentDao());
 
   @Test
   public void empty_list_when_no_data() {
-    assertThat(parser.parse(currentFile, null, dbSession)).isEmpty();
+    ComponentDto project = db.components().insertPrivateProject();
+    ComponentDto file = db.components().insertComponent(newFileDto(project));
+
+    assertThat(parser.parse(db.getSession(), file, null)).isEmpty();
   }
 
   @Test
   public void duplication_on_same_file() throws Exception {
-    List<DuplicationsParser.Block> blocks = parser.parse(currentFile, getData("duplication_on_same_file.xml"), dbSession);
+    ComponentDto project = db.components().insertPrivateProject();
+    ComponentDto file = db.components().insertComponent(newFileDto(project));
+    List<DuplicationsParser.Block> blocks = parser.parse(db.getSession(), file,
+      format("<duplications>\n" +
+        "  <g>\n" +
+        "    <b s=\"31\" l=\"5\" r=\"%s\"/>\n" +
+        "    <b s=\"20\" l=\"5\" r=\"%s\"/>\n" +
+        "  </g>\n" +
+        "</duplications>", file.getDbKey(), file.getDbKey()));
     assertThat(blocks).hasSize(1);
 
     List<DuplicationsParser.Duplication> duplications = blocks.get(0).getDuplications();
@@ -104,19 +65,28 @@ public class DuplicationsParserTest {
 
     // Smallest line comes first
     DuplicationsParser.Duplication duplication1 = duplications.get(0);
-    assertThat(duplication1.file()).isEqualTo(currentFile);
+    assertThat(duplication1.file()).isEqualTo(file);
     assertThat(duplication1.from()).isEqualTo(20);
     assertThat(duplication1.size()).isEqualTo(5);
 
     DuplicationsParser.Duplication duplication2 = duplications.get(1);
-    assertThat(duplication2.file()).isEqualTo(currentFile);
+    assertThat(duplication2.file()).isEqualTo(file);
     assertThat(duplication2.from()).isEqualTo(31);
     assertThat(duplication2.size()).isEqualTo(5);
   }
 
   @Test
   public void duplication_on_same_project() throws Exception {
-    List<DuplicationsParser.Block> blocks = parser.parse(currentFile, getData("duplication_on_same_project.xml"), dbSession);
+    ComponentDto project = db.components().insertPrivateProject();
+    ComponentDto file1 = db.components().insertComponent(newFileDto(project));
+    ComponentDto file2 = db.components().insertComponent(newFileDto(project));
+    List<DuplicationsParser.Block> blocks = parser.parse(db.getSession(), file1,
+      format("<duplications>\n" +
+        "  <g>\n" +
+        "    <b s=\"20\" l=\"5\" r=\"%s\"/>\n" +
+        "    <b s=\"31\" l=\"5\" r=\"%s\"/>\n" +
+        "  </g>\n" +
+        "</duplications>", file2.getDbKey(), file1.getDbKey()));
     assertThat(blocks).hasSize(1);
 
     List<DuplicationsParser.Duplication> duplications = blocks.get(0).getDuplications();
@@ -124,19 +94,31 @@ public class DuplicationsParserTest {
 
     // Current file comes first
     DuplicationsParser.Duplication duplication1 = duplications.get(0);
-    assertThat(duplication1.file()).isEqualTo(currentFile);
+    assertThat(duplication1.file()).isEqualTo(file1);
     assertThat(duplication1.from()).isEqualTo(31);
     assertThat(duplication1.size()).isEqualTo(5);
 
     DuplicationsParser.Duplication duplication2 = duplications.get(1);
-    assertThat(duplication2.file()).isEqualTo(fileOnSameProject);
+    assertThat(duplication2.file()).isEqualTo(file2);
     assertThat(duplication2.from()).isEqualTo(20);
     assertThat(duplication2.size()).isEqualTo(5);
   }
 
   @Test
   public void duplications_on_different_project() throws Exception {
-    List<DuplicationsParser.Block> blocks = parser.parse(currentFile, getData("duplications_on_different_project.xml"), dbSession);
+    ComponentDto project1 = db.components().insertPrivateProject();
+    ComponentDto file1 = db.components().insertComponent(newFileDto(project1));
+    ComponentDto file2 = db.components().insertComponent(newFileDto(project1));
+    ComponentDto project2 = db.components().insertPrivateProject();
+    ComponentDto fileOnProject2 = db.components().insertComponent(newFileDto(project2));
+    List<DuplicationsParser.Block> blocks = parser.parse(db.getSession(), file1,
+      format("<duplications>\n" +
+        "  <g>\n" +
+        "    <b s=\"148\" l=\"24\" r=\"%s\"/>\n" +
+        "    <b s=\"137\" l=\"24\" r=\"%s\"/>\n" +
+        "    <b s=\"111\" l=\"24\" r=\"%s\"/>\n" +
+        "  </g>\n" +
+        "</duplications>", file1.getDbKey(), fileOnProject2.getDbKey(), file2.getDbKey()));
     assertThat(blocks).hasSize(1);
 
     List<DuplicationsParser.Duplication> duplications = blocks.get(0).getDuplications();
@@ -145,40 +127,66 @@ public class DuplicationsParserTest {
     // Current file's project comes first
 
     DuplicationsParser.Duplication duplication1 = duplications.get(0);
-    assertThat(duplication1.file()).isEqualTo(currentFile);
+    assertThat(duplication1.file()).isEqualTo(file1);
     assertThat(duplication1.from()).isEqualTo(148);
     assertThat(duplication1.size()).isEqualTo(24);
 
     DuplicationsParser.Duplication duplication2 = duplications.get(1);
-    assertThat(duplication2.file()).isEqualTo(fileOnSameProject);
+    assertThat(duplication2.file()).isEqualTo(file2);
     assertThat(duplication2.from()).isEqualTo(111);
     assertThat(duplication2.size()).isEqualTo(24);
 
     // Other project comes last
 
     DuplicationsParser.Duplication duplication3 = duplications.get(2);
-    assertThat(duplication3.file()).isEqualTo(fileOnDifferentProject);
+    assertThat(duplication3.file()).isEqualTo(fileOnProject2);
     assertThat(duplication3.from()).isEqualTo(137);
     assertThat(duplication3.size()).isEqualTo(24);
   }
 
   @Test
   public void duplications_on_many_blocks() throws Exception {
-    List<DuplicationsParser.Block> blocks = parser.parse(currentFile, getData("duplications_on_many_blocks.xml"), dbSession);
+    ComponentDto project1 = db.components().insertPrivateProject();
+    ComponentDto file1 = db.components().insertComponent(newFileDto(project1)
+      .setDbKey("org.codehaus.sonar:sonar-plugin-api:src/main/java/org/sonar/api/utils/command/CommandExecutor.java")
+      .setLongName("CommandExecutor"));
+    ComponentDto project2 = db.components().insertPrivateProject();
+    ComponentDto file2 = db.components().insertComponent(newFileDto(project2)
+      .setDbKey("com.sonarsource.orchestrator:sonar-orchestrator:src/main/java/com/sonar/orchestrator/util/CommandExecutor.java")
+      .setLongName("CommandExecutor"));
+    List<DuplicationsParser.Block> blocks = parser.parse(db.getSession(), file1,
+      format("<duplications>\n" +
+        "  <g>\n" +
+        "    <b s=\"94\" l=\"101\" r=\"%s\"/>\n" +
+        "    <b s=\"83\" l=\"101\" r=\"%s\"/>\n" +
+        "  </g>\n" +
+        "  <g>\n" +
+        "    <b s=\"38\" l=\"40\" r=\"%s\"/>\n" +
+        "    <b s=\"29\" l=\"39\" r=\"%s\"/>\n" +
+        "  </g>\n" +
+        "</duplications>\n", file2.getDbKey(), file1.getDbKey(), file2.getDbKey(), file1.getDbKey()));
     assertThat(blocks).hasSize(2);
 
     // Block with smaller line should come first
 
-    assertThat(blocks.get(0).getDuplications().get(0).from()).isEqualTo(38);
-    assertThat(blocks.get(0).getDuplications().get(1).from()).isEqualTo(29);
+    assertThat(blocks.get(0).getDuplications().get(0).from()).isEqualTo(29);
+    assertThat(blocks.get(0).getDuplications().get(1).from()).isEqualTo(38);
 
-    assertThat(blocks.get(1).getDuplications().get(0).from()).isEqualTo(94);
-    assertThat(blocks.get(1).getDuplications().get(1).from()).isEqualTo(83);
+    assertThat(blocks.get(1).getDuplications().get(0).from()).isEqualTo(83);
+    assertThat(blocks.get(1).getDuplications().get(1).from()).isEqualTo(94);
   }
 
   @Test
-  public void duplication_on_removed_file() throws Exception {
-    List<DuplicationsParser.Block> blocks = parser.parse(currentFile, getData("duplication_on_removed_file.xml"), dbSession);
+  public void duplication_on_not_existing_file() throws Exception {
+    ComponentDto project = db.components().insertPrivateProject();
+    ComponentDto file = db.components().insertComponent(newFileDto(project));
+    List<DuplicationsParser.Block> blocks = parser.parse(db.getSession(), file,
+      format("<duplications>\n" +
+        "  <g>\n" +
+        "    <b s=\"20\" l=\"5\" r=\"%s\"/>\n" +
+        "    <b s=\"31\" l=\"5\" r=\"%s\"/>\n" +
+        "  </g>\n" +
+        "</duplications>", file.getDbKey(), "not_existing"));
     assertThat(blocks).hasSize(1);
 
     List<DuplicationsParser.Duplication> duplications = blocks.get(0).getDuplications();
@@ -190,17 +198,19 @@ public class DuplicationsParserTest {
     assertThat(duplication1.from()).isEqualTo(31);
     assertThat(duplication1.size()).isEqualTo(5);
 
-    DuplicationsParser.Duplication duplication2 = duplication(duplications, fileOnSameProject.getDbKey());
-    assertThat(duplication2.file()).isEqualTo(fileOnSameProject);
+    DuplicationsParser.Duplication duplication2 = duplication(duplications, file.getDbKey());
+    assertThat(duplication2.file()).isEqualTo(file);
     assertThat(duplication2.from()).isEqualTo(20);
     assertThat(duplication2.size()).isEqualTo(5);
   }
 
   @Test
   public void compare_duplications() {
-    ComponentDto currentFile = newFileDto(project1, null).setId(11L);
-    ComponentDto fileOnSameProject = newFileDto(project1, null).setId(12L);
-    ComponentDto fileOnDifferentProject = newFileDto(project2, null).setId(13L);
+    ComponentDto project1 = db.components().insertPrivateProject();
+    ComponentDto project2 = db.components().insertPrivateProject();
+    ComponentDto currentFile = db.components().insertComponent(newFileDto(project1, null));
+    ComponentDto fileOnSameProject = db.components().insertComponent(newFileDto(project1, null));
+    ComponentDto fileOnDifferentProject = db.components().insertComponent(newFileDto(project2, null));
 
     DuplicationsParser.DuplicationComparator comparator = new DuplicationsParser.DuplicationComparator(currentFile.uuid(), currentFile.projectUuid());
 
@@ -213,7 +223,7 @@ public class DuplicationsParserTest {
     assertThat(comparator.compare(new DuplicationsParser.Duplication(fileOnSameProject, 5, 2), new DuplicationsParser.Duplication(fileOnDifferentProject, 2, 2))).isEqualTo(-1);
     assertThat(comparator.compare(new DuplicationsParser.Duplication(fileOnDifferentProject, 5, 2), new DuplicationsParser.Duplication(fileOnSameProject, 2, 2))).isEqualTo(1);
     // Files on 2 different projects
-    ComponentDto project3 = ComponentTesting.newPrivateProjectDto(organizationDto).setId(3L);
+    ComponentDto project3 = db.components().insertPrivateProject();
     assertThat(comparator.compare(new DuplicationsParser.Duplication(fileOnDifferentProject, 5, 2),
       new DuplicationsParser.Duplication(project3, 2, 2))).isEqualTo(1);
 
@@ -227,10 +237,6 @@ public class DuplicationsParserTest {
     assertThat(comparator.compare(new DuplicationsParser.Duplication(null, 2, 2), new DuplicationsParser.Duplication(currentFile, 5, 2))).isEqualTo(-1);
   }
 
-  private String getData(String file) throws IOException {
-    return Files.toString(new File(Resources.getResource(this.getClass(), "DuplicationsParserTest/" + file).getFile()), StandardCharsets.UTF_8);
-  }
-
   private static DuplicationsParser.Duplication duplication(List<DuplicationsParser.Duplication> duplications, @Nullable final String componentKey) {
     return Iterables.find(duplications, new Predicate<DuplicationsParser.Duplication>() {
       @Override
diff --git a/server/sonar-server/src/test/java/org/sonar/server/duplication/ws/DuplicationsWsTest.java b/server/sonar-server/src/test/java/org/sonar/server/duplication/ws/DuplicationsWsTest.java
deleted file mode 100644 (file)
index 8cf850d..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2017 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.server.duplication.ws;
-
-import org.junit.Rule;
-import org.junit.Test;
-import org.sonar.api.server.ws.WebService;
-import org.sonar.db.DbClient;
-import org.sonar.server.component.ComponentFinder;
-import org.sonar.server.tester.UserSessionRule;
-import org.sonar.server.ws.WsTester;
-
-import static org.assertj.core.api.Assertions.assertThat;
-import static org.mockito.Mockito.mock;
-
-public class DuplicationsWsTest {
-  @Rule
-  public UserSessionRule userSessionRule = UserSessionRule.standalone();
-
-  WsTester tester = new WsTester(new DuplicationsWs(
-    new ShowAction(mock(DbClient.class), mock(DuplicationsParser.class), mock(ShowResponseBuilder.class), userSessionRule,
-      mock(ComponentFinder.class))));
-
-  @Test
-  public void define_ws() {
-    WebService.Controller controller = tester.controller("api/duplications");
-    assertThat(controller).isNotNull();
-    assertThat(controller.since()).isEqualTo("4.4");
-    assertThat(controller.description()).isNotEmpty();
-
-    WebService.Action show = controller.action("show");
-    assertThat(show).isNotNull();
-    assertThat(show.handler()).isNotNull();
-    assertThat(show.since()).isEqualTo("4.4");
-    assertThat(show.isInternal()).isFalse();
-    assertThat(show.responseExampleAsString()).isNotEmpty();
-    assertThat(show.params()).hasSize(2);
-  }
-
-}
index 49add0329a4b2b99ccb7053ac1acbcabff5752b2..6999d8927766c5bac59cd546fbfdeae5e9472825 100644 (file)
@@ -25,6 +25,7 @@ import org.junit.Rule;
 import org.junit.Test;
 import org.junit.rules.ExpectedException;
 import org.sonar.api.measures.CoreMetrics;
+import org.sonar.api.server.ws.WebService;
 import org.sonar.api.web.UserRole;
 import org.sonar.db.DbTester;
 import org.sonar.db.component.ComponentDto;
@@ -39,6 +40,7 @@ import org.sonar.server.ws.TestRequest;
 import org.sonar.server.ws.TestResponse;
 import org.sonar.server.ws.WsActionTester;
 
+import static org.assertj.core.api.Assertions.assertThat;
 import static org.sonar.db.component.ComponentTesting.newFileDto;
 import static org.sonar.db.component.SnapshotTesting.newAnalysis;
 import static org.sonar.db.measure.MeasureTesting.newMeasureDto;
@@ -66,6 +68,17 @@ public class ShowActionTest {
     db.commit();
   }
 
+  @Test
+  public void define_ws() {
+    WebService.Action show = ws.getDef();
+    assertThat(show).isNotNull();
+    assertThat(show.handler()).isNotNull();
+    assertThat(show.since()).isEqualTo("4.4");
+    assertThat(show.isInternal()).isFalse();
+    assertThat(show.responseExampleAsString()).isNotEmpty();
+    assertThat(show.params()).hasSize(2);
+  }
+
   @Test
   public void get_duplications_by_file_key() throws Exception {
     TestRequest request = newBaseRequest();
diff --git a/server/sonar-server/src/test/resources/org/sonar/server/duplication/ws/DuplicationsParserTest/complex_duplication.xml b/server/sonar-server/src/test/resources/org/sonar/server/duplication/ws/DuplicationsParserTest/complex_duplication.xml
deleted file mode 100644 (file)
index 9c4dc96..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-<duplications>
-  <g>
-    <b s="94" l="101" r="org.codehaus.sonar:sonar-plugin-api:src/main/java/org/sonar/api/utils/command/CommandExecutor.java"/>
-    <b s="83" l="101" r="com.sonarsource.orchestrator:sonar-orchestrator:src/main/java/com/sonar/orchestrator/util/CommandExecutor.java"/>
-  </g>
-  <g>
-    <b s="38" l="40" r="org.codehaus.sonar:sonar-plugin-api:src/main/java/org/sonar/api/utils/command/CommandExecutor.java"/>
-    <b s="29" l="39" r="com.sonarsource.orchestrator:sonar-orchestrator:src/main/java/com/sonar/orchestrator/util/CommandExecutor.java"/>
-  </g>
-  <g>
-    <b s="148" l="24" r="org.codehaus.sonar:sonar-plugin-api:src/main/java/org/sonar/api/utils/command/CommandExecutor.java"/>
-    <b s="137" l="24" r="com.sonarsource.orchestrator:sonar-orchestrator:src/main/java/com/sonar/orchestrator/util/CommandExecutor.java"/>
-    <b s="157" l="24" r="org.codehaus.sonar.runner:sonar-runner-api:src/main/java/org/sonar/runner/api/CommandExecutor.java"/>
-  </g>
-</duplications>
diff --git a/server/sonar-server/src/test/resources/org/sonar/server/duplication/ws/DuplicationsParserTest/duplication_on_removed_file.xml b/server/sonar-server/src/test/resources/org/sonar/server/duplication/ws/DuplicationsParserTest/duplication_on_removed_file.xml
deleted file mode 100644 (file)
index 4ccf8b8..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-<duplications>
-  <g>
-    <b s="20" l="5" r="org.codehaus.sonar:sonar-plugin-api:src/main/java/com/sonar/orchestrator/util/CommandExecutor.java"/>
-    <b s="31" l="5" r="org.codehaus.sonar:sonar-plugin-api:src/main/java/com/sonar/orchestrator/util/RemovedFile.java"/>
-  </g>
-</duplications>
diff --git a/server/sonar-server/src/test/resources/org/sonar/server/duplication/ws/DuplicationsParserTest/duplication_on_same_file.xml b/server/sonar-server/src/test/resources/org/sonar/server/duplication/ws/DuplicationsParserTest/duplication_on_same_file.xml
deleted file mode 100644 (file)
index 4ef11b7..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-<duplications>
-  <g>
-    <b s="31" l="5" r="org.codehaus.sonar:sonar-plugin-api:src/main/java/org/sonar/api/utils/command/CommandExecutor.java"/>
-    <b s="20" l="5" r="org.codehaus.sonar:sonar-plugin-api:src/main/java/org/sonar/api/utils/command/CommandExecutor.java"/>
-  </g>
-</duplications>
diff --git a/server/sonar-server/src/test/resources/org/sonar/server/duplication/ws/DuplicationsParserTest/duplication_on_same_project.xml b/server/sonar-server/src/test/resources/org/sonar/server/duplication/ws/DuplicationsParserTest/duplication_on_same_project.xml
deleted file mode 100644 (file)
index 3c2465c..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-<duplications>
-  <g>
-    <b s="20" l="5" r="org.codehaus.sonar:sonar-plugin-api:src/main/java/com/sonar/orchestrator/util/CommandExecutor.java"/>
-    <b s="31" l="5" r="org.codehaus.sonar:sonar-plugin-api:src/main/java/org/sonar/api/utils/command/CommandExecutor.java"/>
-  </g>
-</duplications>
diff --git a/server/sonar-server/src/test/resources/org/sonar/server/duplication/ws/DuplicationsParserTest/duplications_on_different_project.xml b/server/sonar-server/src/test/resources/org/sonar/server/duplication/ws/DuplicationsParserTest/duplications_on_different_project.xml
deleted file mode 100644 (file)
index 18ebb07..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-<duplications>
-  <g>
-    <b s="148" l="24" r="org.codehaus.sonar:sonar-plugin-api:src/main/java/org/sonar/api/utils/command/CommandExecutor.java"/>
-    <b s="137" l="24" r="com.sonarsource.orchestrator:sonar-orchestrator:src/main/java/com/sonar/orchestrator/util/CommandExecutor.java"/>
-    <b s="111" l="24" r="org.codehaus.sonar:sonar-plugin-api:src/main/java/com/sonar/orchestrator/util/CommandExecutor.java"/>
-  </g>
-</duplications>
diff --git a/server/sonar-server/src/test/resources/org/sonar/server/duplication/ws/DuplicationsParserTest/duplications_on_many_blocks.xml b/server/sonar-server/src/test/resources/org/sonar/server/duplication/ws/DuplicationsParserTest/duplications_on_many_blocks.xml
deleted file mode 100644 (file)
index 3c05e3e..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-<duplications>
-  <g>
-    <b s="94" l="101" r="org.codehaus.sonar:sonar-plugin-api:src/main/java/org/sonar/api/utils/command/CommandExecutor.java"/>
-    <b s="83" l="101" r="com.sonarsource.orchestrator:sonar-orchestrator:src/main/java/com/sonar/orchestrator/util/CommandExecutor.java"/>
-  </g>
-  <g>
-    <b s="38" l="40" r="org.codehaus.sonar:sonar-plugin-api:src/main/java/org/sonar/api/utils/command/CommandExecutor.java"/>
-    <b s="29" l="39" r="com.sonarsource.orchestrator:sonar-orchestrator:src/main/java/com/sonar/orchestrator/util/CommandExecutor.java"/>
-  </g>
-</duplications>