aboutsummaryrefslogtreecommitdiffstats
path: root/src/test/java/org
diff options
context:
space:
mode:
authorJulien HENRY <julien.henry@sonarsource.com>2013-01-03 11:19:07 +0100
committerJulien HENRY <julien.henry@sonarsource.com>2013-01-03 18:36:15 +0100
commitbbea8ed02e8503360ac4d1808ec7fe700e5267ec (patch)
tree9d5bb4c27fa326724301964860ea978dbbbc4a00 /src/test/java/org
parent67feeef54e28e7f61fcb4458a7024d7320b79626 (diff)
downloadsonar-scanner-cli-bbea8ed02e8503360ac4d1808ec7fe700e5267ec.tar.gz
sonar-scanner-cli-bbea8ed02e8503360ac4d1808ec7fe700e5267ec.zip
SONARPLUGINS-1233 Delete the Sonar working/temporary directory before starting analysis
Diffstat (limited to 'src/test/java/org')
-rw-r--r--src/test/java/org/sonar/runner/RunnerTest.java18
1 files changed, 15 insertions, 3 deletions
diff --git a/src/test/java/org/sonar/runner/RunnerTest.java b/src/test/java/org/sonar/runner/RunnerTest.java
index 75685cf..d69cef8 100644
--- a/src/test/java/org/sonar/runner/RunnerTest.java
+++ b/src/test/java/org/sonar/runner/RunnerTest.java
@@ -146,10 +146,22 @@ public class RunnerTest {
runner = Runner.create(properties);
assertThat(runner.getWorkDir()).isEqualTo(new File(".", "temp-dir").getAbsoluteFile());
- // real asbolute path
- properties.setProperty(Runner.PROPERTY_WORK_DIRECTORY, new File("target").getAbsolutePath());
+ // real absolute path
+ properties.setProperty(Runner.PROPERTY_WORK_DIRECTORY, new File("target", "temp-dir2").getAbsolutePath());
runner = Runner.create(properties);
- assertThat(runner.getWorkDir()).isEqualTo(new File("target").getAbsoluteFile());
+ assertThat(runner.getWorkDir()).isEqualTo(new File("target", "temp-dir2").getAbsoluteFile());
+ }
+
+ @Test
+ public void shouldDeleteWorkingDirectory() {
+ Properties properties = new Properties();
+ File workDir = new File("target", "temp-dir-should-be-deleted");
+ workDir.mkdirs();
+ assertThat(workDir.exists()).isTrue();
+ // real absolute path
+ properties.setProperty(Runner.PROPERTY_WORK_DIRECTORY, workDir.getAbsolutePath());
+ Runner.create(properties);
+ assertThat(workDir.exists()).isFalse();
}
@Test