Fix detection of symlinks in acceptance tests
Delete of temporary files failed if the tmp folder in which the
temporary directory was created is a symlink.
Now, the temporary folder is canonicalized before it is used. This
fixes this issue.
Change-Id: Ic5aa91e5242b5b836131c11b05b8723c50b359d9
diff --git a/gerrit-acceptance-tests/src/test/java/com/google/gerrit/acceptance/TempFileUtil.java b/gerrit-acceptance-tests/src/test/java/com/google/gerrit/acceptance/TempFileUtil.java
index fb44d83..0b78f57 100644
--- a/gerrit-acceptance-tests/src/test/java/com/google/gerrit/acceptance/TempFileUtil.java
+++ b/gerrit-acceptance-tests/src/test/java/com/google/gerrit/acceptance/TempFileUtil.java
@@ -23,7 +23,7 @@
private static List<File> allDirsCreated = new ArrayList<>();
public synchronized static File createTempDirectory() throws IOException {
- File tmp = File.createTempFile("gerrit_test_", "");
+ File tmp = File.createTempFile("gerrit_test_", "").getCanonicalFile();
if (!tmp.delete() || !tmp.mkdir()) {
throw new IOException("Cannot create " + tmp.getPath());
}