use of org.sonar.api.batch.fs.internal.DefaultTextPointer in project sonarqube by SonarSource.
the class SensorContextTesterTest method testAnalysisErrors.
@Test
public void testAnalysisErrors() {
assertThat(tester.allAnalysisErrors()).isEmpty();
NewAnalysisError newAnalysisError = tester.newAnalysisError();
InputFile file = new TestInputFileBuilder("foo", "src/Foo.java").build();
newAnalysisError.onFile(file).message("error").at(new DefaultTextPointer(5, 2)).save();
assertThat(tester.allAnalysisErrors()).hasSize(1);
AnalysisError analysisError = tester.allAnalysisErrors().iterator().next();
assertThat(analysisError.inputFile()).isEqualTo(file);
assertThat(analysisError.message()).isEqualTo("error");
assertThat(analysisError.location()).isEqualTo(new DefaultTextPointer(5, 2));
}
use of org.sonar.api.batch.fs.internal.DefaultTextPointer in project sonarqube by SonarSource.
the class DefaultAnalysisErrorTest method setUp.
@Before
public void setUp() {
inputFile = new TestInputFileBuilder("module1", "src/File.java").build();
textPointer = new DefaultTextPointer(5, 2);
storage = Mockito.mock(SensorStorage.class);
}
Aggregations