Package org.sonar.api.batch.fs

Examples of org.sonar.api.batch.fs.InputDir


    assertThat(issue.effortToFix()).isEqualTo(10.0);
  }

  @Test
  public void shouldAddIssueOnDirectory() {
    InputDir dir = new DefaultInputDir("foo", "src");

    ArgumentCaptor<Issue> argumentCaptor = ArgumentCaptor.forClass(Issue.class);

    Issuable issuable = mock(Issuable.class);
    when(resourcePerspectives.as(Issuable.class, Directory.create("src"))).thenReturn(issuable);
View Full Code Here


    }
  }

  private void createIssues(InputFile file, SensorContext context) {
    RuleKey ruleKey = RuleKey.of(XooRulesDefinition.XOO_REPOSITORY, RULE_KEY);
    InputDir inputDir = context.fileSystem().inputDir(file.file().getParentFile());
    if (inputDir != null) {
      context.newIssue()
        .ruleKey(ruleKey)
        .onDir(inputDir)
        .message("This issue is generated for file " + file.relativePath())
View Full Code Here

          .prop("path", inputFile.relativePath())
          .prop("moduleKey", StringUtils.substringBeforeLast(key, ":"))
          .prop("status", inputFile.status().name())
          .endObject();
      } else {
        InputDir inputDir = (InputDir) inputPath;
        String key = ((DefaultInputDir) inputDir).key();
        json
          .beginObject()
          .prop("key", key)
          .prop("path", inputDir.relativePath())
          .prop("moduleKey", StringUtils.substringBeforeLast(key, ":"))
          .endObject();
      }

    }
View Full Code Here

    } else {
      int type = value.getInt();
      String moduleKey = value.getString();
      String relativePath = value.getString();
      if (type == 0) {
        InputDir dir = inputPathCache.getDir(moduleKey, relativePath);
        newIssue.onDir(dir);
      } else {
        InputFile f = inputPathCache.getFile(moduleKey, relativePath);
        newIssue.onFile(f);
        if (!value.isNull(true)) {
View Full Code Here

TOP

Related Classes of org.sonar.api.batch.fs.InputDir

Copyright © 2018 www.massapicom. 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.