@Test
public void testScmMeasure() throws IOException, URISyntaxException {
File baseDir = prepareProject();
tester.newAnalysis()
.properties(ImmutableMap.<String, String>builder()
.put("sonar.task", "scan")
.put("sonar.projectBaseDir", baseDir.getAbsolutePath())
.put("sonar.projectKey", "com.foo.project")
.put("sonar.projectName", "Foo Project")
.put("sonar.projectVersion", "1.0-SNAPSHOT")
.put("sonar.projectDescription", "Description of Foo Project")
.put("sonar.sources", "src")
.put("sonar.scm.provider", "xoo")
.build())
.execute();
ScannerReport.Changesets fileScm = getChangesets(baseDir, "src/sample.xoo");
assertThat(fileScm.getChangesetIndexByLineList()).hasSize(5);
Changeset changesetLine1 = fileScm.getChangeset(fileScm.getChangesetIndexByLine(0));
assertThat(changesetLine1.getAuthor()).isEmpty();
Changeset changesetLine2 = fileScm.getChangeset(fileScm.getChangesetIndexByLine(1));
assertThat(changesetLine2.getAuthor()).isEqualTo(getNonAsciiAuthor().toLowerCase());
Changeset changesetLine3 = fileScm.getChangeset(fileScm.getChangesetIndexByLine(2));
assertThat(changesetLine3.getAuthor()).isEqualTo("julien");
Changeset changesetLine4 = fileScm.getChangeset(fileScm.getChangesetIndexByLine(3));
assertThat(changesetLine4.getAuthor()).isEqualTo("julien");
Changeset changesetLine5 = fileScm.getChangeset(fileScm.getChangesetIndexByLine(4));
assertThat(changesetLine5.getAuthor()).isEqualTo("simon");
}