<AWT Dev> RFR: 8238436: java/awt/Frame/FrameLocationTest/FrameLocationTest.java fails

Pankaj Bansal pbansal at openjdk.java.net
Tue Oct 6 15:36:15 UTC 2020


The test fail intermittently on all platforms, though issue is filled for only Ubuntu.
The test generated  random numbers and sets the frame location to those random numbers. There are two issues in the
test. 1. The test has logic to make sure maximum location coordinates are such that the frame will always fit in the
screen. There is no logic to set the minimum possible location for frame because of taskbar. Eg, on my Mac, if the y
coordinate is < 23, the frame y location is set to 23 on frame.setLocation(), so the test will fail. The minimum x,y
location coordinate will depend upon the platform. 2. The test is setting the frame location and then verifying the
location in a loop, but there is no wait/delay added to let the frame.setLocation complete.

The fix sets the minimum location coordinates possible for the frame by using the frame location it is shown first
time. Also, Robot is added to use delay/wait to let setLocation complete. The mach5 passes after the fix with multiple
runs of the test. Link in JBS.

The test is moved from closed to open repo, so looks like a new test.

-------------

Commit messages:
 - 8238436: java/awt/Frame/FrameLocationTest/FrameLocationTest.java fails

Changes: https://git.openjdk.java.net/jdk/pull/527/files
 Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=527&range=00
  Issue: https://bugs.openjdk.java.net/browse/JDK-8238436
  Stats: 119 lines in 1 file changed: 119 ins; 0 del; 0 mod
  Patch: https://git.openjdk.java.net/jdk/pull/527.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/527/head:pull/527

PR: https://git.openjdk.java.net/jdk/pull/527


More information about the awt-dev mailing list