Package org.sonar.api.batch.fs.internal

Examples of org.sonar.api.batch.fs.internal.DeprecatedDefaultInputFile.deprecatedKey()


    assertThat(inputFile.key()).isEqualTo("struts:src/main/java/foo/Bar.java");
    assertThat(inputFile.relativePath()).isEqualTo("src/main/java/foo/Bar.java");
    assertThat(inputFile.lines()).isEqualTo(1);
    assertThat(inputFile.sourceDirAbsolutePath()).isNull();
    assertThat(inputFile.pathRelativeToSourceDir()).isNull();
    assertThat(inputFile.deprecatedKey()).isNull();
  }

  @Test
  public void return_null_if_file_outside_basedir() throws Exception {
    // file system
View Full Code Here


    DeprecatedDefaultInputFile inputFile = builder.create(srcFile);
    inputFile = builder.complete(inputFile, InputFile.Type.MAIN);

    assertThat(inputFile.pathRelativeToSourceDir()).isEqualTo("foo/Bar.java");
    assertThat(inputFile.sourceDirAbsolutePath()).isEqualTo(PathUtils.sanitize(sourceDir.getAbsolutePath()));
    assertThat(inputFile.deprecatedKey()).isEqualTo("struts:foo.Bar");
  }

  @Test
  public void fill_deprecated_data_of_non_java_file() throws Exception {
    // file system
View Full Code Here

    DeprecatedDefaultInputFile inputFile = builder.create(srcFile);
    inputFile = builder.complete(inputFile, InputFile.Type.MAIN);

    assertThat(inputFile.pathRelativeToSourceDir()).isEqualTo("foo/Bar.php");
    assertThat(inputFile.sourceDirAbsolutePath()).isEqualTo(PathUtils.sanitize(sourceDir.getAbsolutePath()));
    assertThat(inputFile.deprecatedKey()).isEqualTo("struts:foo/Bar.php");

  }
}
View Full Code Here

  public void put(Value value, Object object, CoderContext context) {
    DeprecatedDefaultInputFile f = (DeprecatedDefaultInputFile) object;
    putUTFOrNull(value, f.moduleKey());
    putUTFOrNull(value, f.relativePath());
    value.putString(f.getFileBaseDir().toString());
    putUTFOrNull(value, f.deprecatedKey());
    value.putString(f.sourceDirAbsolutePath());
    putUTFOrNull(value, f.pathRelativeToSourceDir());
    putUTFOrNull(value, f.absolutePath());
    value.putString(f.language());
    value.putString(f.type().name());
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.