commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1441253 - in /commons/proper/io/trunk/src/test/java/org/apache/commons/io: input/ output/
Date Thu, 31 Jan 2013 23:14:03 GMT
Author: sebb
Date: Thu Jan 31 23:14:02 2013
New Revision: 1441253

URL: http://svn.apache.org/viewvc?rev=1441253&view=rev
Log:
Ensure stream is closed

Modified:
    commons/proper/io/trunk/src/test/java/org/apache/commons/io/input/ClassLoaderObjectInputStreamTest.java
    commons/proper/io/trunk/src/test/java/org/apache/commons/io/input/SwappedDataInputStreamTest.java
    commons/proper/io/trunk/src/test/java/org/apache/commons/io/output/CountingOutputStreamTest.java
    commons/proper/io/trunk/src/test/java/org/apache/commons/io/output/StringBuilderWriterTest.java
    commons/proper/io/trunk/src/test/java/org/apache/commons/io/output/WriterOutputStreamTest.java

Modified: commons/proper/io/trunk/src/test/java/org/apache/commons/io/input/ClassLoaderObjectInputStreamTest.java
URL: http://svn.apache.org/viewvc/commons/proper/io/trunk/src/test/java/org/apache/commons/io/input/ClassLoaderObjectInputStreamTest.java?rev=1441253&r1=1441252&r2=1441253&view=diff
==============================================================================
--- commons/proper/io/trunk/src/test/java/org/apache/commons/io/input/ClassLoaderObjectInputStreamTest.java
(original)
+++ commons/proper/io/trunk/src/test/java/org/apache/commons/io/input/ClassLoaderObjectInputStreamTest.java
Thu Jan 31 23:14:02 2013
@@ -53,6 +53,7 @@ public class ClassLoaderObjectInputStrea
         final Boolean result = (Boolean) clois.readObject();
 
         assertTrue( !result.booleanValue() );
+        clois.close();
     }
 
     public void testResolveProxyClass() throws Exception {
@@ -67,6 +68,7 @@ public class ClassLoaderObjectInputStrea
         final String[] interfaces = new String[] { Comparable.class.getName() };
         final Class<?> result = clois.resolveProxyClass(interfaces);
         assertTrue("Assignable", Comparable.class.isAssignableFrom(result));
+        clois.close();
     }
     
 }

Modified: commons/proper/io/trunk/src/test/java/org/apache/commons/io/input/SwappedDataInputStreamTest.java
URL: http://svn.apache.org/viewvc/commons/proper/io/trunk/src/test/java/org/apache/commons/io/input/SwappedDataInputStreamTest.java?rev=1441253&r1=1441252&r2=1441253&view=diff
==============================================================================
--- commons/proper/io/trunk/src/test/java/org/apache/commons/io/input/SwappedDataInputStreamTest.java
(original)
+++ commons/proper/io/trunk/src/test/java/org/apache/commons/io/input/SwappedDataInputStreamTest.java
Thu Jan 31 23:14:02 2013
@@ -71,6 +71,7 @@ public class SwappedDataInputStreamTest 
         assertEquals( false, sdis.readBoolean() );
         assertEquals( true, sdis.readBoolean() );
         assertEquals( true, sdis.readBoolean() );
+        sdis.close();
     }
 
     public void testReadByte() throws IOException {

Modified: commons/proper/io/trunk/src/test/java/org/apache/commons/io/output/CountingOutputStreamTest.java
URL: http://svn.apache.org/viewvc/commons/proper/io/trunk/src/test/java/org/apache/commons/io/output/CountingOutputStreamTest.java?rev=1441253&r1=1441252&r2=1441253&view=diff
==============================================================================
--- commons/proper/io/trunk/src/test/java/org/apache/commons/io/output/CountingOutputStreamTest.java
(original)
+++ commons/proper/io/trunk/src/test/java/org/apache/commons/io/output/CountingOutputStreamTest.java
Thu Jan 31 23:14:02 2013
@@ -71,6 +71,7 @@ public class CountingOutputStreamTest ex
         assertByteArrayEquals("CountingOutputStream.write(int)", baos.toByteArray(), 35,
45);
         assertEquals("CountingOutputStream.getCount()", cos.getCount(), 10);
 
+        cos.close();
     }
 
     /**

Modified: commons/proper/io/trunk/src/test/java/org/apache/commons/io/output/StringBuilderWriterTest.java
URL: http://svn.apache.org/viewvc/commons/proper/io/trunk/src/test/java/org/apache/commons/io/output/StringBuilderWriterTest.java?rev=1441253&r1=1441252&r2=1441253&view=diff
==============================================================================
--- commons/proper/io/trunk/src/test/java/org/apache/commons/io/output/StringBuilderWriterTest.java
(original)
+++ commons/proper/io/trunk/src/test/java/org/apache/commons/io/output/StringBuilderWriterTest.java
Thu Jan 31 23:14:02 2013
@@ -42,6 +42,7 @@ public class StringBuilderWriterTest ext
         final Writer writer = new StringBuilderWriter(100);
         writer.append("Foo");
         assertEquals("Foo", writer.toString());
+        writer.close();
     }
 
     /** Test {@link StringBuilderWriter} constructor. */
@@ -51,6 +52,7 @@ public class StringBuilderWriterTest ext
         writer.append("Bar");
         assertEquals("FooBar", writer.toString());
         assertSame(builder, writer.getBuilder());
+        writer.close();
     }
 
     /** Test {@link StringBuilderWriter} constructor. */
@@ -58,6 +60,7 @@ public class StringBuilderWriterTest ext
         final Writer writer = new StringBuilderWriter((StringBuilder)null);
         writer.append("Foo");
         assertEquals("Foo", writer.toString());
+        writer.close();
     }
 
     /** Test {@link Writer#append(char)}. */
@@ -65,6 +68,7 @@ public class StringBuilderWriterTest ext
         final Writer writer = new StringBuilderWriter();
         writer.append('F').append('o').append('o');
         assertEquals("Foo", writer.toString());
+        writer.close();
     }
 
     /** Test {@link Writer#append(CharSequence)}. */
@@ -72,6 +76,7 @@ public class StringBuilderWriterTest ext
         final Writer writer = new StringBuilderWriter();
         writer.append("Foo").append("Bar");
         assertEquals("FooBar", writer.toString());
+        writer.close();
     }
 
     /** Test {@link Writer#append(CharSequence, int, int)}. */
@@ -79,6 +84,7 @@ public class StringBuilderWriterTest ext
         final Writer writer = new StringBuilderWriter();
         writer.append("FooBar", 3, 6).append(new StringBuffer("FooBar"), 0, 3);
         assertEquals("BarFoo", writer.toString());
+        writer.close();
     }
 
     /** Test {@link Writer#close()}. */
@@ -103,6 +109,7 @@ public class StringBuilderWriterTest ext
         assertEquals("Fo", writer.toString());
         writer.write('o');
         assertEquals("Foo", writer.toString());
+        writer.close();
     }
 
     /** Test {@link Writer#write(char[])}. */
@@ -112,6 +119,7 @@ public class StringBuilderWriterTest ext
         assertEquals("Foo", writer.toString());
         writer.write(new char[] {'B', 'a', 'r'});
         assertEquals("FooBar", writer.toString());
+        writer.close();
     }
 
     /** Test {@link Writer#write(char[], int, int)}. */
@@ -121,6 +129,7 @@ public class StringBuilderWriterTest ext
         assertEquals("Bar", writer.toString());
         writer.write(FOOBAR_CHARS, 0, 3);
         assertEquals("BarFoo", writer.toString());
+        writer.close();
     }
 
     /** Test {@link Writer#write(String)}. */
@@ -130,6 +139,7 @@ public class StringBuilderWriterTest ext
         assertEquals("Foo", writer.toString());
         writer.write("Bar");
         assertEquals("FooBar", writer.toString());
+        writer.close();
     }
 
     /** Test {@link Writer#write(String, int, int)}. */
@@ -139,6 +149,7 @@ public class StringBuilderWriterTest ext
         assertEquals("Bar", writer.toString());
         writer.write("FooBar", 0, 3);
         assertEquals("BarFoo", writer.toString());
+        writer.close();
     }
 
 }

Modified: commons/proper/io/trunk/src/test/java/org/apache/commons/io/output/WriterOutputStreamTest.java
URL: http://svn.apache.org/viewvc/commons/proper/io/trunk/src/test/java/org/apache/commons/io/output/WriterOutputStreamTest.java?rev=1441253&r1=1441252&r2=1441253&view=diff
==============================================================================
--- commons/proper/io/trunk/src/test/java/org/apache/commons/io/output/WriterOutputStreamTest.java
(original)
+++ commons/proper/io/trunk/src/test/java/org/apache/commons/io/output/WriterOutputStreamTest.java
Thu Jan 31 23:14:02 2013
@@ -109,6 +109,7 @@ public class WriterOutputStreamTest exte
         assertEquals(0, writer.getBuffer().length());
         out.flush();
         assertEquals("abc", writer.toString());
+        out.close();
     }
     
     public void testWriteImmediately() throws IOException {
@@ -116,5 +117,6 @@ public class WriterOutputStreamTest exte
         final WriterOutputStream out = new WriterOutputStream(writer, "us-ascii", 1024, true);
         out.write("abc".getBytes("us-ascii"));
         assertEquals("abc", writer.toString());
+        out.close();
     }
 }



Mime
View raw message