RFR: 8316149: Open source several Swing JTree JViewport KeyboardManager tests

Prasanta Sadhukhan psadhukhan at openjdk.org
Tue Sep 19 07:49:41 UTC 2023


On Mon, 18 Sep 2023 22:10:54 GMT, Damon Nguyen <dnguyen at openjdk.org> wrote:

> These are the tests being converted:
> 
> javax/swing/JTree/4696499/bug4696499.java
> javax/swing/JTree/5039542/bug5039542.java
> javax/swing/JViewport/4546474/bug4546474.java
> javax/swing/JViewport/4677611/bug4677611.java
> javax/swing/KeyboardManager/4345798/bug4345798.java

test/jdk/javax/swing/JTree/bug4696499.java line 49:

> 47:         try {
> 48:             SwingUtilities.invokeAndWait(() -> {
> 49:                 fr = new JFrame("bug4696499");

I guess frame is not needed and can be made headless

test/jdk/javax/swing/JViewport/bug4546474.java line 50:

> 48:         try {
> 49:             SwingUtilities.invokeAndWait(() -> {
> 50:                 fr = new JFrame("bug4546474");

Guess this also can be made headless without frame

test/jdk/javax/swing/KeyboardManager/bug4345798.java line 50:

> 48:     private static JFrame f;
> 49:     private static JButton b;
> 50:     private static JMenu menu;

guess it can be local var

test/jdk/javax/swing/KeyboardManager/bug4345798.java line 82:

> 80:             robot.setAutoDelay(100);
> 81:             robot.delay(1000);
> 82:             robot.waitForIdle();

Usually, we do waitForIdle followed by delay so that all events processing is done and then wait further 1sec to let frame visible..

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

PR Review Comment: https://git.openjdk.org/jdk/pull/15802#discussion_r1329694199
PR Review Comment: https://git.openjdk.org/jdk/pull/15802#discussion_r1329703581
PR Review Comment: https://git.openjdk.org/jdk/pull/15802#discussion_r1329709632
PR Review Comment: https://git.openjdk.org/jdk/pull/15802#discussion_r1329706858


More information about the client-libs-dev mailing list