From 7d7aaa003eff920f5067f701a908764ec88e9e17 Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Tue, 26 Nov 2013 16:05:14 -0600 Subject: [PATCH] Delete temporary test file afterwards Signed-off-by: Johannes Schindelin --- test/Files.java | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/test/Files.java b/test/Files.java index 0e9ed2fef2..4249bb2296 100644 --- a/test/Files.java +++ b/test/Files.java @@ -27,13 +27,17 @@ public class Files { throws Exception { File file = File.createTempFile("avian.", null); - file.setExecutable(executable); - if (executable) { - expect(file.canExecute()); - } else { - // Commented out because this will fail on Windows - both on Avian and on OpenJDK - // The implementation for Windows considers canExecute() to be the same as canRead() - // expect(!file.canExecute()); + try { + file.setExecutable(executable); + if (executable) { + expect(file.canExecute()); + } else { + // Commented out because this will fail on Windows - both on Avian and on OpenJDK + // The implementation for Windows considers canExecute() to be the same as canRead() + // expect(!file.canExecute()); + } + } finally { + expect(file.delete()); } }