<Swing Dev> RFR: 8202880: Test javax/swing/JPopupMenu/8075063/ContextMenuScrollTest.java fails

Alexey Ivanov aivanov at openjdk.java.net
Wed Jan 13 15:48:03 UTC 2021


On Wed, 13 Jan 2021 10:41:29 GMT, Prasanta Sadhukhan <psadhukhan at openjdk.org> wrote:

> This test was unstable in linux in nightly testing. Modified to move the frame to center of screen so that the left-taskbar of linux doesn't interfere with the mouse movement along with delay after frame is visible to make it more stable. 
> Mach5 job running for several iterations on all platforms is ok. Link in JBS.

Copyright year in the test and in the ProblemList.txt, since it exists there, should be updated.

test/jdk/javax/swing/JPopupMenu/8075063/ContextMenuScrollTest.java line 55:

> 53:     private static JMenuItem paste;
> 54:     private static JMenuItem delete;
> 55:     private static JMenuItem selectAll;

These can be local variables; as well as the menuBar. They're not accessed anywhere else but createGUI().

test/jdk/javax/swing/JPopupMenu/8075063/ContextMenuScrollTest.java line 183:

> 181:         frame.pack();
> 182:         frame.setVisible(true);
> 183:         frame.setLocationRelativeTo(null);

Shall `setLocationRelativeTo` be called before `setVisible(true)`?

test/jdk/javax/swing/JPopupMenu/8075063/ContextMenuScrollTest.java line 82:

> 80:             robot.delay(1000);
> 81: 
> 82:             System.out.println("popmenu visible " + menu.isPopupMenuVisible());

`menu.isPopupMenuVisible()` should also be called on EDT.

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

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


More information about the swing-dev mailing list