Mercurial > hg > release > icedtea6-1.11
changeset 2606:1d4ca38b3440
Patch for regression test openjdk/jdk/test/java/nio/channels/Channels/Write.java
author | ptisnovs |
---|---|
date | Fri, 17 Jun 2011 11:10:49 +0200 |
parents | 9dbcfded2579 |
children | 2962ab27cd01 |
files | ChangeLog Makefile.am patches/jtreg-ChannelsWrite.patch |
diffstat | 3 files changed, 61 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/ChangeLog Thu Jun 16 12:57:43 2011 -0400 +++ b/ChangeLog Fri Jun 17 11:10:49 2011 +0200 @@ -1,3 +1,11 @@ +2011-06-17 Pavel Tisnovsky <ptisnovs@redhat.com> + + * Makefile.am: added new patch + * patches/jtreg-ChannelsWrite.patch: + Make sure that the regression test + openjdk/jdk/test/java/nio/channels/Channels/Write.java + deletes all its work files. + 2011-06-16 Denis Lila <dlila@redhat.com> * pulseaudio/src/java/org/classpath/icedtea/pulseaudio/PulseAudioDataLine.java
--- a/Makefile.am Thu Jun 16 12:57:43 2011 -0400 +++ b/Makefile.am Fri Jun 17 11:10:49 2011 +0200 @@ -357,7 +357,8 @@ patches/jtreg-TempBuffer.patch \ patches/jtreg-EncodedMultiByteChar.patch \ patches/jtreg-FileLoaderTest.patch \ - patches/jtreg-FileMap.patch + patches/jtreg-FileMap.patch \ + patches/jtreg-ChannelsWrite.patch if WITH_ALT_HSBUILD ICEDTEA_PATCHES += \
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/patches/jtreg-ChannelsWrite.patch Fri Jun 17 11:10:49 2011 +0200 @@ -0,0 +1,51 @@ +--- openjdk.orig/jdk/test/java/nio/channels/Channels/Write.java 2011-02-28 17:06:59.000000000 +0100 ++++ openjdk/jdk/test/java/nio/channels/Channels/Write.java 2011-06-16 14:14:44.000000000 +0200 +@@ -34,18 +34,37 @@ + + public static void main(String[] args) throws Exception { + byte[] bb = new byte[3]; +- File testFile = File.createTempFile("test1", null); +- testFile.deleteOnExit(); ++ File testFile = null; ++ try { ++ testFile = File.createTempFile("test1", null); + +- FileOutputStream fos = new FileOutputStream(testFile); +- FileChannel fc = fos.getChannel(); +- OutputStream out = Channels.newOutputStream(fc); ++ FileOutputStream fos = null; ++ FileChannel fc = null; ++ OutputStream out = null; ++ try { ++ fos = new FileOutputStream(testFile); ++ fc = fos.getChannel(); ++ out = Channels.newOutputStream(fc); + +- out.write(bb,0,1); +- out.write(bb,2,1); +- +- out.close(); +- fc.close(); +- fos.close(); ++ out.write(bb,0,1); ++ out.write(bb,2,1); ++ } ++ finally { ++ if (out != null) { ++ out.close(); ++ } ++ if (fc != null) { ++ fc.close(); ++ } ++ if (fos != null) { ++ fos.close(); ++ } ++ } ++ } ++ finally { ++ if (testFile != null) { ++ testFile.delete(); ++ } ++ } + } + }