JDK-6920172 : Test java/awt/Multiscreen/LocationRelativeToTest/ must be changed in OpenJDK6
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: OpenJDK6
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2010-01-26
  • Updated: 2011-01-19
  • Resolved: 2010-01-26
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
OpenJDK6 b18Fixed
Related Reports
Relates :  
Description
Currently, java/awt/Multiscreen/LocationRelativeToTest/ regression test conforms to JDK7 specification. However, it's present in OpenJDK6 as well, and therefore should be slightly corrected to match JDK6 spec.

The test checks for Window.setLocationRelativeTo() method behavior. This method was enhanced in JDK7 in the fix for 6232687.

Comments
SUGGESTED FIX # HG changeset patch # User ptisnovs # Date 1264522926 -3600 # Node ID 0db3dbda124a74b7114708b634a1da09b7125d50 # Parent b2510c4f0228a74fef867b8ddc5dce994dbd1250 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 --- a/test/java/awt/Multiscreen/LocationRelativeToTest/LocationRelativeToTest.java Wed Jan 20 11:47:58 2010 -0700 +++ b/test/java/awt/Multiscreen/LocationRelativeToTest/LocationRelativeToTest.java Tue Jan 26 17:22:06 2010 +0100 @@ -50,7 +50,8 @@ public class LocationRelativeToTest 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,9 @@ public class LocationRelativeToTest // second, check setLocationRelativeTo(invisible) f.setLocationRelativeTo(f2); Util.waitForIdle(r); - checkLocation(f, new Point(gcBounds.x + gcBounds.width / 2, - gcBounds.y + gcBounds.height / 2)); + // Warning: this command is correct only + // on OpenJDK6, not OpenJDK7 + checkLocation(f, centerPoint); // third, check setLocationRelativeTo(visible) f2.setVisible(true);
26-01-2010

PUBLIC COMMENTS See http://hg.openjdk.java.net/jdk6/jdk6/jdk/rev/0db3dbda124a
26-01-2010

EVALUATION A fine fix.
26-01-2010