Mercurial > hg > release > icedtea6-1.11
changeset 1916:2e45706c88ce
Merge
author | Andrew John Hughes <ahughes@redhat.com> |
---|---|
date | Mon, 15 Feb 2010 22:12:10 +0000 |
parents | 18446e8c463f (current diff) 73755cc5f4cb (diff) |
children | 389724e2c6b5 |
files | ChangeLog Makefile.am patches/icedtea-6912628-turkcert.patch |
diffstat | 7 files changed, 366 insertions(+), 14 deletions(-) [+] |
line wrap: on
line diff
--- a/ChangeLog Mon Feb 15 22:10:30 2010 +0000 +++ b/ChangeLog Mon Feb 15 22:12:10 2010 +0000 @@ -6,6 +6,23 @@ 2010-02-15 Andrew John Hughes <ahughes@redhat.com> + * patches/icedtea-6829636-loggingdeadlock2.patch, + * patches/icedtea-6912628-turkcert.patch, + * patches/icedtea-6920143-using-with-mouse.patch, + * patches/icedtea-6920172-location-relative-to-test.patch, + * patches/icedtea-6920172-turkish.patch: + Moved. + * Makefile.am: Use new patch paths. + * patches/openjdk/6716076-loggingdeadlock2.patch, + * patches/openjdk/6912628-turkcert.patch, + * patches/openjdk/6917663-turkish.patch, + * patches/openjdk/6920143-using-with-mouse.patch, + * patches/openjdk/6920172-location-relative-to-test.patch: + Move OpenJDK patches to appropriate directory and use + correct bug IDs for loggingdeadlock2 and turkish. + +2010-02-15 Andrew John Hughes <ahughes@redhat.com> + * patches/icedtea-6897844-xshm.patch: Dropped, applied upstream. * Makefile.am: Remove above patch.
--- a/patches/icedtea-6912628-turkcert.patch Mon Feb 15 22:10:30 2010 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,14 +0,0 @@ -6912628: test/java/util/jar/JarFile/TurkCert.java cannot be run in samevm mode -Summary: Added tag to run this test in othervm -Reviewed-by: chegar - ---- openjdk.orig/jdk/test/java/util/jar/JarFile/TurkCert.java 2010-02-02 12:02:47.216585000 +0100 -+++ openjdk/jdk/test/java/util/jar/JarFile/TurkCert.java 2010-02-02 12:02:46.933586000 +0100 -@@ -26,6 +26,7 @@ - * @bug 4624534 - * @summary Make sure jar certificates work for Turkish locale - * @author kladko -+ * @run main/othervm TurkCert - */ - - import java.util.*;
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/patches/openjdk/6716076-loggingdeadlock2.patch Mon Feb 15 22:12:10 2010 +0000 @@ -0,0 +1,249 @@ +6829636: test/java/util/logging/LoggingDeadlock2.java is flaky +Fixes created by mchung and martin + +--- openjdk.orig/jdk/test/java/util/logging/LoggingDeadlock2.java Fri Jan 30 16:27:33 2009 -0800 ++++ openjdk/jdk/test/java/util/logging/LoggingDeadlock2.java Fri Dec 04 23:11:11 2009 +0000 +@@ -23,10 +23,10 @@ + + /* + * @test +- * @bug 6467152 ++ * @bug 6467152 6716076 6829503 + * + * @summary deadlock occurs in LogManager initialization and JVM termination +- * @author Serguei Spitsyn / Hittachi ++ * @author Serguei Spitsyn / Hittachi / Martin Buchholz + * + * @build LoggingDeadlock2 + * @run main/timeout=15 LoggingDeadlock2 +@@ -47,43 +47,195 @@ + * This is a regression test for this bug. + */ + ++import java.util.Arrays; ++import java.util.List; ++import java.util.Random; ++import java.util.concurrent.CyclicBarrier; ++import java.util.concurrent.atomic.AtomicInteger; + import java.util.logging.LogManager; +- +-public class LoggingDeadlock2 implements Runnable { +- static final java.io.PrintStream out = System.out; +- static Object lock = new Object(); +- static int c = 0; +- public static void main(String arg[]) { +- out.println("\nThis test checks that there is no deadlock."); +- out.println("If not crashed or timed-out then it is passed."); ++import java.io.File; ++import java.io.InputStream; ++import java.io.InputStreamReader; ++import java.io.Reader; ++ ++public class LoggingDeadlock2 { ++ ++ public static void realMain(String arg[]) throws Throwable { + try { +- new Thread(new LoggingDeadlock2()).start(); +- synchronized(lock) { +- c++; +- if (c == 2) lock.notify(); +- else lock.wait(); ++ System.out.println(javaChildArgs); ++ ProcessBuilder pb = new ProcessBuilder(javaChildArgs); ++ ProcessResults r = run(pb.start()); ++ equal(r.exitValue(), 99); ++ equal(r.out(), ""); ++ equal(r.err(), ""); ++ } catch (Throwable t) { unexpected(t); } ++ } ++ ++ public static class JavaChild { ++ public static void main(String args[]) throws Throwable { ++ final CyclicBarrier startingGate = new CyclicBarrier(2); ++ final Throwable[] thrown = new Throwable[1]; ++ ++ // Some random variation, to help tickle races. ++ final Random rnd = new Random(); ++ final boolean dojoin = rnd.nextBoolean(); ++ final int JITTER = 1024; ++ final int iters1 = rnd.nextInt(JITTER); ++ final int iters2 = JITTER - iters1; ++ final AtomicInteger counter = new AtomicInteger(0); ++ ++ Thread exiter = new Thread() { ++ public void run() { ++ try { ++ startingGate.await(); ++ for (int i = 0; i < iters1; i++) ++ counter.getAndIncrement(); ++ System.exit(99); ++ } catch (Throwable t) { ++ t.printStackTrace(); ++ System.exit(86); ++ } ++ }}; ++ exiter.start(); ++ ++ startingGate.await(); ++ for (int i = 0; i < iters2; i++) ++ counter.getAndIncrement(); ++ // This may or may not result in a first call to ++ // Runtime.addShutdownHook after shutdown has already ++ // commenced. ++ LogManager log = LogManager.getLogManager(); ++ ++ if (dojoin) { ++ exiter.join(); ++ if (thrown[0] != null) ++ throw new Error(thrown[0]); ++ check(counter.get() == JITTER); + } +- LogManager log = LogManager.getLogManager(); +- out.println("Test passed"); +- } +- catch(Exception e) { +- e.printStackTrace(); +- out.println("Test FAILED"); // Not expected +- } +- } +- +- public void run() { ++ } ++ } ++ ++ //---------------------------------------------------------------- ++ // The rest of this test is copied from ProcessBuilder/Basic.java ++ //---------------------------------------------------------------- ++ private static final String javaExe = ++ System.getProperty("java.home") + ++ File.separator + "bin" + File.separator + "java"; ++ ++ private static final String classpath = ++ System.getProperty("java.class.path"); ++ ++ private static final List<String> javaChildArgs = ++ Arrays.asList(new String[] ++ { javaExe, "-classpath", classpath, ++ "LoggingDeadlock2$JavaChild"}); ++ ++ private static class ProcessResults { ++ private final String out; ++ private final String err; ++ private final int exitValue; ++ private final Throwable throwable; ++ ++ public ProcessResults(String out, ++ String err, ++ int exitValue, ++ Throwable throwable) { ++ this.out = out; ++ this.err = err; ++ this.exitValue = exitValue; ++ this.throwable = throwable; ++ } ++ ++ public String out() { return out; } ++ public String err() { return err; } ++ public int exitValue() { return exitValue; } ++ public Throwable throwable() { return throwable; } ++ ++ public String toString() { ++ StringBuilder sb = new StringBuilder(); ++ sb.append("<STDOUT>\n" + out() + "</STDOUT>\n") ++ .append("<STDERR>\n" + err() + "</STDERR>\n") ++ .append("exitValue = " + exitValue + "\n"); ++ if (throwable != null) ++ sb.append(throwable.getStackTrace()); ++ return sb.toString(); ++ } ++ } ++ ++ private static class StreamAccumulator extends Thread { ++ private final InputStream is; ++ private final StringBuilder sb = new StringBuilder(); ++ private Throwable throwable = null; ++ ++ public String result () throws Throwable { ++ if (throwable != null) ++ throw throwable; ++ return sb.toString(); ++ } ++ ++ StreamAccumulator (InputStream is) { ++ this.is = is; ++ } ++ ++ public void run() { ++ try { ++ Reader r = new InputStreamReader(is); ++ char[] buf = new char[4096]; ++ int n; ++ while ((n = r.read(buf)) > 0) { ++ sb.append(buf,0,n); ++ } ++ } catch (Throwable t) { ++ throwable = t; ++ } finally { ++ try { is.close(); } ++ catch (Throwable t) { throwable = t; } ++ } ++ } ++ } ++ ++ private static ProcessResults run(Process p) { ++ Throwable throwable = null; ++ int exitValue = -1; ++ String out = ""; ++ String err = ""; ++ ++ StreamAccumulator outAccumulator = ++ new StreamAccumulator(p.getInputStream()); ++ StreamAccumulator errAccumulator = ++ new StreamAccumulator(p.getErrorStream()); ++ + try { +- synchronized(lock) { +- c++; +- if (c == 2) lock.notify(); +- else lock.wait(); +- } +- System.exit(1); +- } +- catch(Exception e) { +- e.printStackTrace(); +- out.println("Test FAILED"); // Not expected +- } +- } ++ outAccumulator.start(); ++ errAccumulator.start(); ++ ++ exitValue = p.waitFor(); ++ ++ outAccumulator.join(); ++ errAccumulator.join(); ++ ++ out = outAccumulator.result(); ++ err = errAccumulator.result(); ++ } catch (Throwable t) { ++ throwable = t; ++ } ++ ++ return new ProcessResults(out, err, exitValue, throwable); ++ } ++ ++ //--------------------- Infrastructure --------------------------- ++ static volatile int passed = 0, failed = 0; ++ static void pass() {passed++;} ++ static void fail() {failed++; Thread.dumpStack();} ++ static void fail(String msg) {System.out.println(msg); fail();} ++ static void unexpected(Throwable t) {failed++; t.printStackTrace();} ++ static void check(boolean cond) {if (cond) pass(); else fail();} ++ static void check(boolean cond, String m) {if (cond) pass(); else fail(m);} ++ static void equal(Object x, Object y) { ++ if (x == null ? y == null : x.equals(y)) pass(); ++ else fail(x + " not equal to " + y);} ++ public static void main(String[] args) throws Throwable { ++ try {realMain(args);} catch (Throwable t) {unexpected(t);} ++ System.out.printf("%nPassed = %d, failed = %d%n%n", passed, failed); ++ if (failed > 0) throw new AssertionError("Some tests failed");} + }
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/patches/openjdk/6912628-turkcert.patch Mon Feb 15 22:12:10 2010 +0000 @@ -0,0 +1,14 @@ +6912628: test/java/util/jar/JarFile/TurkCert.java cannot be run in samevm mode +Summary: Added tag to run this test in othervm +Reviewed-by: chegar + +--- openjdk.orig/jdk/test/java/util/jar/JarFile/TurkCert.java 2010-02-02 12:02:47.216585000 +0100 ++++ openjdk/jdk/test/java/util/jar/JarFile/TurkCert.java 2010-02-02 12:02:46.933586000 +0100 +@@ -26,6 +26,7 @@ + * @bug 4624534 + * @summary Make sure jar certificates work for Turkish locale + * @author kladko ++ * @run main/othervm TurkCert + */ + + import java.util.*;
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/patches/openjdk/6917663-turkish.patch Mon Feb 15 22:12:10 2010 +0000 @@ -0,0 +1,14 @@ +6917663: test/java/security/Provider/Turkish.java not samevm friendly +Summary: Added othervm flag to ensure that this test will run in isolation. +Reviewed-by: alanb + +--- openjdk.orig/jdk/test/java/security/Provider/Turkish.java 2010-01-18 11:02:18.000000000 +0100 ++++ openjdk/jdk/test/java/security/Provider/Turkish.java 2010-01-18 11:02:17.000000000 +0100 +@@ -25,6 +25,7 @@ + * @test + * @bug 6220064 + * @summary make sure everything works ok in the Turkish local (dotted/dotless i problem) ++ * @run main/othervm Turkish + * @author Andreas Sterbenz + */ +
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/patches/openjdk/6920143-using-with-mouse.patch Mon Feb 15 22:12:10 2010 +0000 @@ -0,0 +1,45 @@ +6920143: test/java/awt/TestArea/UsingWithMouse.java needs realSync() +Summary: Added small delay to make sure that TextArea animation have finished +Reviewed-by: anthony + +--- openjdk.orig/jdk/test/java/awt/TextArea/UsingWithMouse/SelectionAutoscrollTest.java 2010-01-27 14:45:28.000000000 +0100 ++++ openjdk/jdk/test/java/awt/TextArea/UsingWithMouse/SelectionAutoscrollTest.java 2010-01-27 14:45:27.000000000 +0100 +@@ -56,6 +56,7 @@ + TextArea textArea; + Robot robot; + final int desiredSelectionEnd = ('z'-'a'+1)*2; // 52 ++ final static int SCROLL_DELAY = 100; // ms + + public void start () { + createObjects(); +@@ -126,6 +127,8 @@ + + moveMouseBelowTextArea( tremble%2!=0 ); + Util.waitForIdle( robot ); ++ // it is needed to add some small delay on Gnome ++ waitUntilScrollIsPerformed(robot); + } + + robot.mouseRelease( MouseEvent.BUTTON1_MASK ); +@@ -141,9 +144,19 @@ + void moveMouseBelowTextArea( boolean shift ) { + Dimension d = textArea.getSize(); + Point l = textArea.getLocationOnScreen(); ++ int x = (int)(l.x+d.width*.5); + int y = (int)(l.y+d.height*1.5); + if( shift ) y+=15; +- robot.mouseMove( (int)(l.x+d.width*.5), y ); ++ robot.mouseMove( x, y ); ++ } ++ ++ void waitUntilScrollIsPerformed(Robot robot) { ++ try { ++ Thread.sleep( SCROLL_DELAY ); ++ } ++ catch( Exception e ) { ++ throw new RuntimeException( e ); ++ } + } + + void checkResults() { +
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/patches/openjdk/6920172-location-relative-to-test.patch Mon Feb 15 22:12:10 2010 +0000 @@ -0,0 +1,27 @@ +6920172: Regression test LocationRelativeToTest does not check frame position correctly. +Summary: Testcase correction - check frame position against graphics environment's center point +Reviewed-by: art + +--- openjdk.orig/jdk/test/java/awt/Multiscreen/LocationRelativeToTest/LocationRelativeToTest.java 2010-01-25 17:42:52.000000000 +0100 ++++ openjdk/jdk/test/java/awt/Multiscreen/LocationRelativeToTest/LocationRelativeToTest.java 2010-01-25 17:42:52.000000000 +0100 +@@ -50,7 +50,8 @@ + + GraphicsEnvironment ge = + GraphicsEnvironment.getLocalGraphicsEnvironment(); +- System.out.println("Center point: " + ge.getCenterPoint()); ++ Point centerPoint = ge.getCenterPoint(); ++ System.out.println("Center point: " + centerPoint); + GraphicsDevice[] gds = ge.getScreenDevices(); + GraphicsDevice gdDef = ge.getDefaultScreenDevice(); + GraphicsConfiguration gcDef = +@@ -77,8 +78,7 @@ + // second, check setLocationRelativeTo(invisible) + f.setLocationRelativeTo(f2); + Util.waitForIdle(r); +- checkLocation(f, new Point(gcBounds.x + gcBounds.width / 2, +- gcBounds.y + gcBounds.height / 2)); ++ checkLocation(f, centerPoint); + + // third, check setLocationRelativeTo(visible) + f2.setVisible(true); +