use of org.sonar.ce.task.projectanalysis.source.linereader.LineReader.Data.SYMBOLS in project sonarqube by SonarSource.
the class FileSourceDataWarningsTest method create_symbol_warning_when_any_number_of_read_error_for_one_file.
@Test
public void create_symbol_warning_when_any_number_of_read_error_for_one_file() {
ReportComponent file = ReportComponent.builder(Component.Type.FILE, 1).setUuid("uuid").setName(path).build();
LineReader.ReadError[] readErrors = IntStream.range(0, 1 + random.nextInt(10)).mapToObj(i -> new LineReader.ReadError(SYMBOLS, line + i)).toArray(LineReader.ReadError[]::new);
when(system2.now()).thenReturn(timeStamp);
Arrays.stream(readErrors).forEach(readError -> underTest.addWarning(file, readError));
verifyZeroInteractions(taskMessages);
underTest.commitWarnings();
verify(taskMessages, times(1)).add(new CeTaskMessages.Message("Inconsistent symbol data detected on file '" + path + "'. " + "File source may have been modified while analysis was running.", timeStamp));
}
Aggregations