harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From telli...@apache.org
Subject svn commit: r695508 - in /harmony/enhanced/classlib/trunk/modules: luni/src/test/api/common/org/apache/harmony/luni/tests/java/io/ nio/src/test/java/common/org/apache/harmony/nio/tests/java/nio/channels/
Date Mon, 15 Sep 2008 15:23:23 GMT
Author: tellison
Date: Mon Sep 15 08:23:23 2008
New Revision: 695508

URL: http://svn.apache.org/viewvc?rev=695508&view=rev
Log:
Ensure temporary files are deleted after running tests.

Modified:
    harmony/enhanced/classlib/trunk/modules/luni/src/test/api/common/org/apache/harmony/luni/tests/java/io/FileTest.java
    harmony/enhanced/classlib/trunk/modules/nio/src/test/java/common/org/apache/harmony/nio/tests/java/nio/channels/FileChannelLockingTest.java
    harmony/enhanced/classlib/trunk/modules/nio/src/test/java/common/org/apache/harmony/nio/tests/java/nio/channels/FileLockTest.java

Modified: harmony/enhanced/classlib/trunk/modules/luni/src/test/api/common/org/apache/harmony/luni/tests/java/io/FileTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/test/api/common/org/apache/harmony/luni/tests/java/io/FileTest.java?rev=695508&r1=695507&r2=695508&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/test/api/common/org/apache/harmony/luni/tests/java/io/FileTest.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/test/api/common/org/apache/harmony/luni/tests/java/io/FileTest.java
Mon Sep 15 08:23:23 2008
@@ -700,14 +700,16 @@
         new FileOutputStream(f1).close(); // create the file
         if (f1.equals(f2)) {
             try {
-                new FileInputStream(f2);
+                FileInputStream fis = new FileInputStream(f2);
+                fis.close();
             } catch (IOException e) {
                 fail("File system is case sensitive");
             }
         } else {
             boolean exception = false;
             try {
-                new FileInputStream(f2);
+                FileInputStream fis = new FileInputStream(f2);
+                fis.close();
             } catch (IOException e) {
                 exception = true;
             }

Modified: harmony/enhanced/classlib/trunk/modules/nio/src/test/java/common/org/apache/harmony/nio/tests/java/nio/channels/FileChannelLockingTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/nio/src/test/java/common/org/apache/harmony/nio/tests/java/nio/channels/FileChannelLockingTest.java?rev=695508&r1=695507&r2=695508&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/nio/src/test/java/common/org/apache/harmony/nio/tests/java/nio/channels/FileChannelLockingTest.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/nio/src/test/java/common/org/apache/harmony/nio/tests/java/nio/channels/FileChannelLockingTest.java
Mon Sep 15 08:23:23 2008
@@ -71,6 +71,18 @@
         readWriteChannel = randomAccessFile.getChannel();
     }
 
+    protected void tearDown() throws IOException {
+        if (readOnlyChannel != null) {
+            readOnlyChannel.close();
+        }
+        if (writeOnlyChannel != null) {
+            writeOnlyChannel.close();
+        }
+        if (readWriteChannel != null) {
+            readWriteChannel.close();
+        }
+    }
+
     public void test_illegalLocks() throws IOException {
         // Cannot acquire an exclusive lock on a read-only file channel
         try {

Modified: harmony/enhanced/classlib/trunk/modules/nio/src/test/java/common/org/apache/harmony/nio/tests/java/nio/channels/FileLockTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/nio/src/test/java/common/org/apache/harmony/nio/tests/java/nio/channels/FileLockTest.java?rev=695508&r1=695507&r2=695508&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/nio/src/test/java/common/org/apache/harmony/nio/tests/java/nio/channels/FileLockTest.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/nio/src/test/java/common/org/apache/harmony/nio/tests/java/nio/channels/FileLockTest.java
Mon Sep 15 08:23:23 2008
@@ -62,6 +62,12 @@
 		mockLock = new MockFileLock(readWriteChannel, 10, 100, false);
 	}
 
+	protected void tearDown() throws IOException {
+	    if (readWriteChannel != null) {
+	        readWriteChannel.close();
+	    }
+	}
+
 	/**
 	 * @tests java.nio.channels.FileLock#FileLock(FileChannel, long, long,
 	 *        boolean)



Mime
View raw message