diff options
author | Simon Brandhof <simon.brandhof@sonarsource.com> | 2014-11-30 18:09:03 +0100 |
---|---|---|
committer | Simon Brandhof <simon.brandhof@sonarsource.com> | 2014-11-30 18:09:03 +0100 |
commit | 45bf3e6974a3c664d920fc34783dabb1268a6039 (patch) | |
tree | f92154fa09ea45be577d2879886e0fc93d93a7a4 /sonar-testing-harness/src/main/java/org/sonar/test | |
parent | 7aa79a9d7cd5cfb25c479a53349adf1e86a7ee22 (diff) | |
download | sonarqube-45bf3e6974a3c664d920fc34783dabb1268a6039.tar.gz sonarqube-45bf3e6974a3c664d920fc34783dabb1268a6039.zip |
Shared elasticsearch instance for server tests
Diffstat (limited to 'sonar-testing-harness/src/main/java/org/sonar/test')
-rw-r--r-- | sonar-testing-harness/src/main/java/org/sonar/test/TestUtils.java | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/sonar-testing-harness/src/main/java/org/sonar/test/TestUtils.java b/sonar-testing-harness/src/main/java/org/sonar/test/TestUtils.java index c8522ec3ed8..31e9e24cfef 100644 --- a/sonar-testing-harness/src/main/java/org/sonar/test/TestUtils.java +++ b/sonar-testing-harness/src/main/java/org/sonar/test/TestUtils.java @@ -90,4 +90,16 @@ public final class TestUtils { } return ok; } + + public static File newTempDir(String prefix) { + try { + // Technique to create a temp directory from a temp file + File f = File.createTempFile(prefix, ""); + f.delete(); + f.mkdir(); + return f; + } catch (Exception e) { + throw new IllegalStateException("Fail to create temp dir", e); + } + } } |