diff options
author | Julien HENRY <julien.henry@sonarsource.com> | 2015-05-13 18:01:43 +0200 |
---|---|---|
committer | Julien HENRY <julien.henry@sonarsource.com> | 2015-05-13 18:08:23 +0200 |
commit | 685f611b550e086b5a551bbbb9c79f103f203a9b (patch) | |
tree | f52978d23c007d02cdca318739e13efd46e622d7 /sonar-plugin-api/src/test | |
parent | aaf1d2f100350ea95e6dfaa34bd001075d2e2584 (diff) | |
download | sonarqube-685f611b550e086b5a551bbbb9c79f103f203a9b.tar.gz sonarqube-685f611b550e086b5a551bbbb9c79f103f203a9b.zip |
SONAR-6548 Restore support of deprecated org.sonar.api.resources.InputFile
Diffstat (limited to 'sonar-plugin-api/src/test')
-rw-r--r-- | sonar-plugin-api/src/test/java/org/sonar/api/batch/fs/internal/DefaultInputFileTest.java | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/sonar-plugin-api/src/test/java/org/sonar/api/batch/fs/internal/DefaultInputFileTest.java b/sonar-plugin-api/src/test/java/org/sonar/api/batch/fs/internal/DefaultInputFileTest.java index 3e3339bf63d..596662d861a 100644 --- a/sonar-plugin-api/src/test/java/org/sonar/api/batch/fs/internal/DefaultInputFileTest.java +++ b/sonar-plugin-api/src/test/java/org/sonar/api/batch/fs/internal/DefaultInputFileTest.java @@ -25,6 +25,7 @@ import org.junit.rules.TemporaryFolder; import org.sonar.api.batch.fs.InputFile; import java.io.File; +import java.nio.file.Path; import static org.assertj.core.api.Assertions.assertThat; import static org.junit.Assert.fail; @@ -36,14 +37,17 @@ public class DefaultInputFileTest { @Test public void test() throws Exception { + Path baseDir = temp.newFolder().toPath(); DefaultInputFile inputFile = new DefaultInputFile("ABCDE", "src/Foo.php") - .setModuleBaseDir(temp.newFolder().toPath()) + .setModuleBaseDir(baseDir) .setLines(42) .setLanguage("php") .setStatus(InputFile.Status.ADDED) .setType(InputFile.Type.TEST); assertThat(inputFile.relativePath()).isEqualTo("src/Foo.php"); + assertThat(inputFile.getRelativePath()).isEqualTo("src/Foo.php"); + assertThat(inputFile.getFile()).isEqualTo(new File(baseDir.toFile(), "src/Foo.php")); assertThat(new File(inputFile.relativePath())).isRelative(); assertThat(inputFile.absolutePath()).endsWith("Foo.php"); assertThat(new File(inputFile.absolutePath())).isAbsolute(); |