From 7a6eabd80d2c57cb8018eb4eb98fb46b765ec189 Mon Sep 17 00:00:00 2001 From: tkellner Date: Wed, 3 Oct 2012 19:50:49 +0000 Subject: close streams git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@1146 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- smcc/src/test/java/at/gv/egiz/smcc/ESCardTest.java | 1 + .../gv/egiz/smcc/TransparentFileInputStreamTest.java | 18 +++++++++--------- 2 files changed, 10 insertions(+), 9 deletions(-) (limited to 'smcc/src/test') diff --git a/smcc/src/test/java/at/gv/egiz/smcc/ESCardTest.java b/smcc/src/test/java/at/gv/egiz/smcc/ESCardTest.java index 4a357cec..ec1fba2c 100644 --- a/smcc/src/test/java/at/gv/egiz/smcc/ESCardTest.java +++ b/smcc/src/test/java/at/gv/egiz/smcc/ESCardTest.java @@ -447,6 +447,7 @@ public class ESCardTest extends AbstractSignatureCard { } if (offset < bytes.length) { + is.close(); throw new IOException("Could not completely read file " + file.getName()); } diff --git a/smcc/src/test/java/at/gv/egiz/smcc/TransparentFileInputStreamTest.java b/smcc/src/test/java/at/gv/egiz/smcc/TransparentFileInputStreamTest.java index 69bc69db..6964f2d2 100644 --- a/smcc/src/test/java/at/gv/egiz/smcc/TransparentFileInputStreamTest.java +++ b/smcc/src/test/java/at/gv/egiz/smcc/TransparentFileInputStreamTest.java @@ -83,7 +83,7 @@ public class TransparentFileInputStreamTest { assertEquals(0xFF & i++, b); } assertEquals(file.length, i); - + is.close(); } @Test @@ -99,7 +99,7 @@ public class TransparentFileInputStreamTest { } } assertEquals(file.length, i); - + is.close(); } @Test @@ -115,7 +115,7 @@ public class TransparentFileInputStreamTest { } } assertEquals(file_bs.length, i); - + is.close(); } @Test(expected = IOException.class) @@ -124,7 +124,7 @@ public class TransparentFileInputStreamTest { TransparentFileInputStream is = new TestTransparentFileInputStream(file); is.read(new byte[128]); is.reset(); - + is.close(); } @Test @@ -141,7 +141,7 @@ public class TransparentFileInputStreamTest { } } assertEquals(file.length, i); - + is.close(); } @Test @@ -164,7 +164,7 @@ public class TransparentFileInputStreamTest { } } assertEquals(file.length, i); - + is.close(); } @@ -181,7 +181,7 @@ public class TransparentFileInputStreamTest { assertEquals(0xFF & i + j, 0xFF & b[j]); } is.reset(); - + is.close(); } @Test @@ -196,7 +196,7 @@ public class TransparentFileInputStreamTest { for (int j = 0; j < l; j++) { assertEquals(0xFF & i + j, 0xFF & b[j]); } - + is.close(); } @Test public void testSkipBig() throws IOException { @@ -210,7 +210,7 @@ public class TransparentFileInputStreamTest { for (int j = 0; j < l; j++) { assertEquals(0xFF & i + j, 0xFF & b[j]); } - + is.close(); } } -- cgit v1.2.3