Search in sources :

Example 1 with CrossProjectDuplicate

use of org.sonar.ce.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))));
    assertThat(reader.read(line1)).isEmpty();
    assertThat(reader.read(line2)).isEmpty();
    assertThat(reader.read(line3)).isEmpty();
    assertThat(reader.read(line4)).isEmpty();
    assertThat(line1.getDuplicationList()).containsExactly(1);
    assertThat(line2.getDuplicationList()).containsExactly(1);
    assertThat(line3.getDuplicationList()).isEmpty();
    assertThat(line4.getDuplicationList()).isEmpty();
}
Also used : CrossProjectDuplicate(org.sonar.ce.task.projectanalysis.duplication.CrossProjectDuplicate) TextBlock(org.sonar.ce.task.projectanalysis.duplication.TextBlock) Test(org.junit.Test)

Aggregations

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