Search in sources :

Example 1 with CrossProjectDuplicate

use of org.sonar.server.computation.task.projectanalysis.duplication.CrossProjectDuplicate in project sonarqube by SonarSource.

the class DuplicationLineReaderTest method read_duplication_with_duplicates_on_other_file_from_other_project.

@Test
public void read_duplication_with_duplicates_on_other_file_from_other_project() {
    DuplicationLineReader reader = duplicationLineReader(duplication(1, 2, new CrossProjectDuplicate("other-component-key-from-another-project", new TextBlock(3, 4))));
    reader.read(line1);
    reader.read(line2);
    reader.read(line3);
    reader.read(line4);
    assertThat(line1.getDuplicationList()).containsExactly(1);
    assertThat(line2.getDuplicationList()).containsExactly(1);
    assertThat(line3.getDuplicationList()).isEmpty();
    assertThat(line4.getDuplicationList()).isEmpty();
}
Also used : CrossProjectDuplicate(org.sonar.server.computation.task.projectanalysis.duplication.CrossProjectDuplicate) TextBlock(org.sonar.server.computation.task.projectanalysis.duplication.TextBlock) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)1 CrossProjectDuplicate (org.sonar.server.computation.task.projectanalysis.duplication.CrossProjectDuplicate)1 TextBlock (org.sonar.server.computation.task.projectanalysis.duplication.TextBlock)1