use of org.sonar.server.computation.task.projectanalysis.duplication.TextBlock in project sonarqube by SonarSource.
the class NewSizeMeasuresStepTest method compute_duplicated_blocks_one_for_original_and_ignores_CrossProjectDuplicate.
@Test
public void compute_duplicated_blocks_one_for_original_and_ignores_CrossProjectDuplicate() {
duplicationRepository.addDuplication(FILE_1_REF, new TextBlock(1, 1), SOME_FILE_KEY, new TextBlock(2, 2));
setChangesets(FILE_1_REF);
underTest.execute();
assertRawMeasureValueOnPeriod(FILE_1_REF, NEW_BLOCKS_DUPLICATED_KEY, 1);
}
use of org.sonar.server.computation.task.projectanalysis.duplication.TextBlock in project sonarqube by SonarSource.
the class ReportDuplicationMeasuresStepTest method compute_duplicated_blocks_one_for_original_and_ignores_CrossProjectDuplicate.
@Test
public void compute_duplicated_blocks_one_for_original_and_ignores_CrossProjectDuplicate() {
duplicationRepository.addDuplication(FILE_1_REF, new TextBlock(1, 1), SOME_FILE_KEY, new TextBlock(2, 2));
underTest.execute();
assertRawMeasureValue(FILE_1_REF, DUPLICATED_BLOCKS_KEY, 1);
}
use of org.sonar.server.computation.task.projectanalysis.duplication.TextBlock in project sonarqube by SonarSource.
the class ReportDuplicationMeasuresStepTest method compute_duplicated_blocks_does_not_count_blocks_only_once_it_assumes_consistency_from_duplication_data.
@Test
public void compute_duplicated_blocks_does_not_count_blocks_only_once_it_assumes_consistency_from_duplication_data() {
duplicationRepository.addDuplication(FILE_1_REF, new TextBlock(1, 1), new TextBlock(3, 3));
duplicationRepository.addDuplication(FILE_1_REF, new TextBlock(2, 2), new TextBlock(3, 3));
underTest.execute();
assertRawMeasureValue(FILE_1_REF, DUPLICATED_BLOCKS_KEY, 4);
}
use of org.sonar.server.computation.task.projectanalysis.duplication.TextBlock in project sonarqube by SonarSource.
the class ReportDuplicationMeasuresStepTest method compute_duplicated_lines_counts_lines_from_original_and_InnerDuplicate_only_once.
@Test
public void compute_duplicated_lines_counts_lines_from_original_and_InnerDuplicate_only_once() {
TextBlock original = new TextBlock(1, 12);
duplicationRepository.addDuplication(FILE_1_REF, original, new TextBlock(10, 11), new TextBlock(11, 15));
duplicationRepository.addDuplication(FILE_1_REF, new TextBlock(2, 2), new TextBlock(96, 96));
underTest.execute();
assertRawMeasureValue(FILE_1_REF, DUPLICATED_LINES_KEY, 16);
}
use of org.sonar.server.computation.task.projectanalysis.duplication.TextBlock in project sonarqube by SonarSource.
the class ReportDuplicationMeasuresStepTest method compute_duplicated_lines_counts_lines_from_original_and_ignores_InProjectDuplicate.
@Test
public void compute_duplicated_lines_counts_lines_from_original_and_ignores_InProjectDuplicate() {
TextBlock original = new TextBlock(1, 1);
duplicationRepository.addDuplication(FILE_1_REF, original, FILE_2_REF, new TextBlock(2, 2));
underTest.execute();
assertRawMeasureValue(FILE_1_REF, DUPLICATED_LINES_KEY, 1);
}
Aggregations