diff options
Diffstat (limited to 'src/test/java/org/sonar/runner/RunnerTest.java')
-rw-r--r-- | src/test/java/org/sonar/runner/RunnerTest.java | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/test/java/org/sonar/runner/RunnerTest.java b/src/test/java/org/sonar/runner/RunnerTest.java index c0495fc..877e85d 100644 --- a/src/test/java/org/sonar/runner/RunnerTest.java +++ b/src/test/java/org/sonar/runner/RunnerTest.java @@ -153,9 +153,20 @@ public class RunnerTest { Runner runner = Runner.create(properties); assertThat(runner.getWorkDir()).isEqualTo(new File(".", ".sonar")); + // empty string + properties.setProperty(Runner.PROPERTY_WORK_DIRECTORY, " "); + runner = Runner.create(properties); + assertThat(runner.getWorkDir()).isEqualTo(new File(".", ".sonar")); + + // real relative path properties.setProperty(Runner.PROPERTY_WORK_DIRECTORY, "temp-dir"); runner = Runner.create(properties); assertThat(runner.getWorkDir()).isEqualTo(new File(".", "temp-dir")); + + // real asbolute path + properties.setProperty(Runner.PROPERTY_WORK_DIRECTORY, new File("target").getAbsolutePath()); + runner = Runner.create(properties); + assertThat(runner.getWorkDir()).isEqualTo(new File("target").getAbsoluteFile()); } @Test |