From b4941cddbea9cca8e7763d04ec06fb7a46456834 Mon Sep 17 00:00:00 2001 From: Joel Dice Date: Mon, 17 Jan 2011 10:33:43 -0700 Subject: [PATCH] close FileInputStream before deleting file in FileOutput test Otherwise, Windows won't let us delete it. --- test/FileOutput.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/FileOutput.java b/test/FileOutput.java index 6fffc0f8a7..539b73fc59 100644 --- a/test/FileOutput.java +++ b/test/FileOutput.java @@ -25,6 +25,7 @@ public class FileOutput { while ((c = in.read(buffer, offset, buffer.length - offset)) != -1) { offset += c; } + in.close(); if (! "Hello world!\nHello world again!".equals (new String(buffer, 0, offset))) @@ -32,7 +33,7 @@ public class FileOutput { throw new RuntimeException(); } } finally { - new File("test.txt").delete(); + expect(new File("test.txt").delete()); } }