Permalink
Browse files

close FileInputStream before deleting file in FileOutput test

Otherwise, Windows won't let us delete it.
  • Loading branch information...
dicej committed Jan 17, 2011
1 parent 4a9ff55 commit b4941cddbea9cca8e7763d04ec06fb7a46456834
Showing with 2 additions and 1 deletion.
  1. +2 −1 test/FileOutput.java
View
@@ -25,14 +25,15 @@ private static void test(boolean appendFirst) throws IOException {
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)))
{
throw new RuntimeException();
}
} finally {
- new File("test.txt").delete();
+ expect(new File("test.txt").delete());
}
}

0 comments on commit b4941cd

Please sign in to comment.