use of org.sonar.scanner.protocol.output.ScannerReport.IssueLocation in project sonarqube by SonarSource.
the class MultilineIssuesMediumTest method testFlowWithSingleLocation.
@Test
public void testFlowWithSingleLocation() throws Exception {
List<Issue> issues = result.issuesFor(result.inputFile("xources/hello/Multiple.xoo"));
assertThat(issues).hasSize(1);
Issue issue = issues.get(0);
assertThat(issue.getMsg()).isEqualTo("Primary location");
assertThat(issue.getTextRange().getStartLine()).isEqualTo(6);
assertThat(issue.getTextRange().getStartOffset()).isEqualTo(23);
assertThat(issue.getTextRange().getEndLine()).isEqualTo(6);
assertThat(issue.getTextRange().getEndOffset()).isEqualTo(50);
assertThat(issue.getFlowList()).hasSize(1);
Flow flow = issue.getFlow(0);
assertThat(flow.getLocationList()).hasSize(1);
IssueLocation additionalLocation = flow.getLocation(0);
assertThat(additionalLocation.getMsg()).isEqualTo("Flow step #1");
assertThat(additionalLocation.getTextRange().getStartLine()).isEqualTo(7);
assertThat(additionalLocation.getTextRange().getStartOffset()).isEqualTo(26);
assertThat(additionalLocation.getTextRange().getEndLine()).isEqualTo(7);
assertThat(additionalLocation.getTextRange().getEndOffset()).isEqualTo(53);
}
Aggregations