--- old/test/java/awt/print/PaintSetEnabledDeadlock/PaintSetEnabledDeadlock.java 2012-02-08 18:21:51.664227600 +0400 +++ new/test/java/awt/print/PaintSetEnabledDeadlock/PaintSetEnabledDeadlock.java 2012-02-08 18:21:50.561164500 +0400 @@ -54,9 +54,12 @@ Util.clickOnComp(frame.button, robot); } - frame.panel.stop(); + boolean ret = frame.panel.stop(); frame.dispose(); + if (!ret) { + throw new RuntimeException("Test failed!"); + } System.out.println("Test passed."); } @@ -140,17 +143,19 @@ } } - public void stop() { + public boolean stop() { active = false; try { - synchronized (sync) { - sync.notify(); - } - synchronized (thread) { - thread.wait(); + sync(); + thread.join(1000); + if (thread.isAlive()) { + thread.interrupt(); + return false; } } catch (InterruptedException ex) { + return false; } + return true; } public void draw() {