File xooFile = new File(srcDir, "sample.xoo");
File xoohighlightingFile = new File(srcDir, "sample.xoo.highlighting");
FileUtils.write(xooFile, "Sample xoo\ncontent");
FileUtils.write(xoohighlightingFile, "0:10:s\n11:18:k");
TaskResult result = tester.newTask()
.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")
.build())
.start();
InputFile file = result.inputFile("src/sample.xoo");
assertThat(result.highlightingTypeFor(file, 0)).containsExactly(TypeOfText.STRING);
assertThat(result.highlightingTypeFor(file, 9)).containsExactly(TypeOfText.STRING);
assertThat(result.highlightingTypeFor(file, 10)).isEmpty();
assertThat(result.highlightingTypeFor(file, 11)).containsExactly(TypeOfText.KEYWORD);
}