Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8160767

[TEST_BUG] java/awt/Frame/MaximizedToIconified/MaximizedToIconified.java

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P4
    • 11
    • 7, 9, 10
    • client-libs
    • OEL 7* but may be anywhere, Ubuntu 17.10

    • b05

    Backports

      Description

        This test fails for various reasons: one of the is JDK-8158918 and another is unlucky timing with current implementation of realSync machinery. Namely, on OEL 7 (but not only, I guess) the test fails intermittently at the very beginning (see the rule below for an example of exception). This is a fix for that issue which works for me:

        --- a/test/java/awt/Frame/MaximizedToIconified/MaximizedToIconified.java Wed Jun 29 14:47:58 2016 +0530
        +++ b/test/java/awt/Frame/MaximizedToIconified/MaximizedToIconified.java Mon Jul 04 13:57:19 2016 +0300
        @@ -51,10 +51,12 @@
             static volatile int lastFrameState = Frame.NORMAL;
             static volatile boolean failed = false;
             static volatile Toolkit myKit;
        + static Robot robot = null;
         
             private static void checkState(Frame f, int state) {
                 f.setExtendedState(state);
        - Util.waitForIdle(null);
        + Util.waitForIdle(robot);
        + robot.delay(100);
         
                 System.out.println("state = " + state + "; getExtendedState() = " + f.getExtendedState());
         
        @@ -79,7 +81,8 @@
                     f.setVisible(true);
                 }
         
        - Util.waitForIdle(null);
        + Util.waitForIdle(robot);
        + robot.delay(100);
         
                 f.addWindowStateListener(new WindowStateListener() {
                     public void windowStateChanged(WindowEvent e) {
        @@ -158,6 +161,11 @@
             // it for now.
             public static void main( String args[] ) throws InterruptedException
             {
        + try {
        + robot = new Robot();
        + }catch(Exception noRobotEx){
        + noRobotEx.printStackTrace();
        + }
                 mainThread = Thread.currentThread();
                 try
                 {

        RULE "java/awt/Frame/MaximizedToIconified/MaximizedToIconified.java" Exception java.lang.RuntimeException: getExtendedState() != last getNewState() in WINDOW_STATE_CHANGED event.

        Attachments

          Issue Links

            Activity

              People

                pkbalakr Prem Balakrishnan (Inactive)
                yan Yuri Nesterenko
                Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved: