8151857: [TEST_BUG] bug6544309.java fails intermittently
authorserb
Wed, 16 Mar 2016 15:36:06 +0300
changeset 36887 b05841864f56
parent 36886 c56d9d689225
child 36888 0905e6c2d1af
8151857: [TEST_BUG] bug6544309.java fails intermittently Reviewed-by: yan, avstepan
jdk/test/javax/swing/JPopupMenu/6544309/bug6544309.java
--- a/jdk/test/javax/swing/JPopupMenu/6544309/bug6544309.java	Wed Mar 16 15:00:57 2016 +0530
+++ b/jdk/test/javax/swing/JPopupMenu/6544309/bug6544309.java	Wed Mar 16 15:36:06 2016 +0300
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -30,9 +30,14 @@
    @run main bug6544309
 */
 
-import javax.swing.*;
-import java.awt.event.*;
-import java.awt.*;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.awt.event.KeyEvent;
+
+import javax.swing.JDialog;
+import javax.swing.JMenuItem;
+import javax.swing.JPopupMenu;
+import javax.swing.SwingUtilities;
 
 public class bug6544309 {
     private JDialog dialog;
@@ -41,6 +46,8 @@
 
     public static void main(String[] args) throws Exception {
         robot = new ExtendedRobot();
+        // move mouse outside menu to prevent auto selection
+        robot.mouseMove(100,100);
         final bug6544309 test = new bug6544309();
         try {
             SwingUtilities.invokeAndWait(new Runnable() {