diff options
author | Fabrice Bellingard <bellingard@gmail.com> | 2012-07-26 15:18:10 +0000 |
---|---|---|
committer | Fabrice Bellingard <bellingard@gmail.com> | 2012-07-26 15:18:10 +0000 |
commit | 19e50646269b781e2f9fdedcb06a11c707eb74c9 (patch) | |
tree | 757e5c573cf3acd90c862c9ada3de868e5ff339a /src/test/java/org/sonar/runner/RunnerTest.java | |
parent | c252acc5eca3d65903f07002ac02ed24801aa036 (diff) | |
download | sonar-scanner-cli-19e50646269b781e2f9fdedcb06a11c707eb74c9.tar.gz sonar-scanner-cli-19e50646269b781e2f9fdedcb06a11c707eb74c9.zip |
SONARPLUGINS-1230 Work dir can be absolute or relative
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 |