JDK-7161320 : TEST_BUG: java/awt/event/KeyEvent/SwallowKeyEvents/SwallowKeyEvents.java fails (Invalid key code)
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 7,8
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: windows_vista
  • CPU: generic
  • Submitted: 2012-04-13
  • Updated: 2014-10-15
  • Resolved: 2014-03-21
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.
JDK 7 JDK 8 JDK 9
7u76Fixed 8u20Fixed 9 b08Fixed
Related Reports
Relates :  
Description
Test java/awt/event/KeyEvent/SwallowKeyEvents/SwallowKeyEvents.java always fails on WINDOWS with java.lang.IllegalArgumentException: Invalid key code

Failure is caused by string
r.keyPress(KeyEvent.VK_META);

This test was created for MacOSX bug CR 7154072, so it is for MacOS only

Comments
http://cr.openjdk.java.net/~kshefov/7161320/webrev.02
21-03-2014

P4 as a test bug
18-05-2013

after test failure on windows SHIFT remains pressed (key code 64); it can cause failure of plenty other regression tests - see INTJDK-7118889 test excluded from execution in the regression team suite, it should be removed from notrun.txt after fix this bug for all trains
16-04-2013

SUGGESTED FIX The better would be to do the following - if (!"sun.lwawt.macosx.LWCToolkit".equals(Toolkit.getDefaultToolkit().getClass().getName())) { System.out.println("Skipped. Test for LWCToolkit only."); return; } - as this conforms to the way we used to filter platforms in the tests.
18-04-2012

EVALUATION Right, the test should have been limited to LWCToolkit only. See Suggested Fix.
18-04-2012

SUGGESTED FIX diff -r 3f4f86efc55a test/java/awt/event/KeyEvent/SwallowKeyEventsSwallowKeyEvents.java --- a/test/java/awt/event/KeyEvent/SwallowKeyEvents/SwallowKeyEvents.java Mon Apr 16 19:22:11 2012 +0400 +++ b/test/java/awt/event/KeyEvent/SwallowKeyEvents/SwallowKeyEvents.java Mon Apr 16 19:23:10 2012 +0400 @@ -50,6 +50,11 @@ public static void main(String[] args) { + if (System.getProperty("os.name").toLowerCase().indexOf("mac") < 0) { + System.out.println("Test passed."); + return; + } + f.add(t); f.pack(); f.setVisible(true);
16-04-2012