/hg/icedtea6: Make sure that the regression test

ptisnovs at icedtea.classpath.org ptisnovs at icedtea.classpath.org
Tue Jun 14 04:00:28 PDT 2011


changeset e71f6f90abb6 in /hg/icedtea6
details: http://icedtea.classpath.org/hg/icedtea6?cmd=changeset;node=e71f6f90abb6
author: ptisnovs
date: Tue Jun 14 13:00:21 2011 +0200

	Make sure that the regression test
	openjdk/jdk/test/sun/nio/ch/TempBuffer.java deletes all its work
	files.


diffstat:

 ChangeLog                      |   8 +++++
 Makefile.am                    |   3 +-
 patches/jtreg-TempBuffer.patch |  60 ++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 70 insertions(+), 1 deletions(-)

diffs (93 lines):

diff -r cfb9d61da90f -r e71f6f90abb6 ChangeLog
--- a/ChangeLog	Tue Jun 14 11:18:01 2011 +0200
+++ b/ChangeLog	Tue Jun 14 13:00:21 2011 +0200
@@ -1,3 +1,11 @@
+2011-06-14  Pavel Tisnovsky  <ptisnovs at redhat.com>
+
+	* Makefile.am: added new patch
+	* patches/jtreg-TempBuffer.patch:
+	Make sure that the regression test
+	openjdk/jdk/test/sun/nio/ch/TempBuffer.java
+	deletes all its work files.
+
 2011-06-14  Pavel Tisnovsky  <ptisnovs at redhat.com>
 
 	* Makefile.am: added new patch
diff -r cfb9d61da90f -r e71f6f90abb6 Makefile.am
--- a/Makefile.am	Tue Jun 14 11:18:01 2011 +0200
+++ b/Makefile.am	Tue Jun 14 13:00:21 2011 +0200
@@ -352,7 +352,8 @@
 	patches/openjdk/7043564-hugepage.patch \
 	patches/openjdk/mutter.patch \
 	patches/fonts-rhel-version.patch \
-	patches/jtreg-ChangeDir.patch
+	patches/jtreg-ChangeDir.patch \
+	patches/jtreg-TempBuffer.patch
 
 if WITH_ALT_HSBUILD
 ICEDTEA_PATCHES += \
diff -r cfb9d61da90f -r e71f6f90abb6 patches/jtreg-TempBuffer.patch
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/jtreg-TempBuffer.patch	Tue Jun 14 13:00:21 2011 +0200
@@ -0,0 +1,61 @@
+--- openjdk.orig/jdk/test/sun/nio/ch/TempBuffer_orig.java	2011-02-28 17:07:06.000000000 +0100
++++ openjdk/jdk/test/sun/nio/ch/TempBuffer.java	2011-06-13 15:10:29.000000000 +0200
+@@ -48,18 +48,29 @@
+ 
+         Thread writerThread = new Thread() {
+             public void run() {
++                File blah = null;
+                 try {
+                     OutputStream out = Channels.newOutputStream(sinkChannel);
+-                    File blah = File.createTempFile("blah1", null);
++                    blah = File.createTempFile("blah1", null);
+                     blah.deleteOnExit();
+                     TempBuffer.initTestFile(blah);
+                     RandomAccessFile raf = new RandomAccessFile(blah, "rw");
+                     FileChannel fs = raf.getChannel();
+-                    fs.transferTo(0, SIZE, Channels.newChannel(out));
++                    try {
++                        fs.transferTo(0, SIZE, Channels.newChannel(out));
++                    } finally {
++                        fs.close();
++                        raf.close();
++                    }
+                     out.flush();
+                 } catch (IOException ioe) {
+                     throw new RuntimeException(ioe);
+                 }
++                finally {
++                    if (blah != null) {
++                        blah.delete();
++                    }
++                }
+             }
+         };
+ 
+@@ -70,9 +81,16 @@
+         blah.deleteOnExit();
+         RandomAccessFile raf = new RandomAccessFile(blah, "rw");
+         FileChannel fs = raf.getChannel();
+-        raf.setLength(SIZE);
+-        fs.transferFrom(Channels.newChannel(in), 0, SIZE);
+-        fs.close();
++        try {
++            raf.setLength(SIZE);
++            fs.transferFrom(Channels.newChannel(in), 0, SIZE);
++        } finally {
++            fs.close();
++        }
++
++        sourceChannel.close();
++        sinkChannel.close();
++        blah.delete();
+     }
+ 
+     private static void initTestFile(File blah) throws IOException {
+@@ -89,5 +107,6 @@
+         }
+        awriter.flush();
+        awriter.close();
++       fos.close();
+     }
+ }



More information about the distro-pkg-dev mailing list