Examples of HighlightingBuilder


Examples of org.sonar.api.batch.sensor.highlighting.HighlightingBuilder

    if (highlightingFile.exists()) {
      LOG.debug("Processing " + highlightingFile.getAbsolutePath());
      try {
        List<String> lines = FileUtils.readLines(highlightingFile, context.fileSystem().encoding().name());
        int lineNumber = 0;
        HighlightingBuilder highlightingBuilder = context.highlightingBuilder(inputFile);
        for (String line : lines) {
          lineNumber++;
          if (StringUtils.isBlank(line) || line.startsWith("#")) {
            continue;
          }
          processLine(highlightingFile, lineNumber, highlightingBuilder, line);
        }
        highlightingBuilder.done();
      } catch (IOException e) {
        throw new IllegalStateException(e);
      }
    }
  }
View Full Code Here

Examples of org.sonar.api.batch.sensor.highlighting.HighlightingBuilder

  public void testExecution() throws IOException {
    File symbol = new File(baseDir, "src/foo.xoo.highlighting");
    FileUtils.write(symbol, "1:4:k\n12:15:cppd\n\n#comment");
    DefaultInputFile inputFile = new DefaultInputFile("foo", "src/foo.xoo").setAbsolutePath(new File(baseDir, "src/foo.xoo").getAbsolutePath()).setLanguage("xoo");
    fileSystem.add(inputFile);
    HighlightingBuilder builder = mock(HighlightingBuilder.class);
    when(context.highlightingBuilder(inputFile)).thenReturn(builder);

    sensor.execute(context);

    verify(builder).highlight(1, 4, TypeOfText.KEYWORD);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.