RFR: 8340719: Open source AWT List tests

Abhishek Kumar abhiscxk at openjdk.org
Mon Sep 30 12:17:37 UTC 2024


On Mon, 30 Sep 2024 03:07:17 GMT, Prasanta Sadhukhan <psadhukhan at openjdk.org> wrote:

> Opensource few AWT List tests...

test/jdk/java/awt/List/HandlingKeyEventIfMousePressedTest.java line 49:

> 47: import java.awt.event.MouseAdapter;
> 48: import java.awt.event.MouseMotionAdapter;
> 49: import java.awt.event.MouseEvent;

Suggestion:

import java.awt.event.MouseEvent;
import java.awt.event.MouseMotionAdapter;

test/jdk/java/awt/List/HandlingKeyEventIfMousePressedTest.java line 73:

> 71:             // key pressing when the mouse is kept in the 'pressed' state
> 72:             robot.keyPress(KeyEvent.VK_DOWN);
> 73:             robot.keyRelease(KeyEvent.VK_DOWN);

Test summary says about "SPACE, UP and DOWN" keys but the test checks only for "DOWN" key... should it extend for other keys as well?

test/jdk/java/awt/List/ListActionEventTest.java line 56:

> 54:                 .title("ListActionEventTest Instructions")
> 55:                 .instructions(INSTRUCTIONS)
> 56:                 .rows((int) INSTRUCTIONS.lines().count() + 2)

may be removed.

test/jdk/java/awt/List/MultiSelectionListHorizScrollbar.java line 41:

> 39:     private static final String INSTRUCTIONS = """
> 40:          Resize the frame so that the lists are not wide enough to fully display the lines of text they contain.
> 41:          Once the lists are in this state, press pass if both lists display an horizontal scrollbar. Otherwise press fail.""";

Plz limit it to 80

test/jdk/java/awt/List/MultiSelectionListHorizScrollbar.java line 41:

> 39:     private static final String INSTRUCTIONS = """
> 40:          Resize the frame so that the lists are not wide enough to fully display the lines of text they contain.
> 41:          Once the lists are in this state, press pass if both lists display an horizontal scrollbar. Otherwise press fail.""";

Suggestion:

         Resize the frame so that the lists are not wide enough to fully display the lines of text they contain.
         Once the lists are in this state, press Pass if both lists display an horizontal scrollbar. Otherwise press Fail.""";

test/jdk/java/awt/List/RepaintAfterResize.java line 63:

> 61:         frame.setLayout (new FlowLayout ());
> 62:         list.setBounds(100, 100, 100, 100);
> 63:         for(int i=0 ; i < 7 ; i++){

Suggestion:

        for(int i = 0 ; i < 7 ; i++){

test/jdk/java/awt/List/RepaintAfterResize.java line 64:

> 62:         list.setBounds(100, 100, 100, 100);
> 63:         for(int i=0 ; i < 7 ; i++){
> 64:             list.add(" "+i);

Suggestion:

            list.add(" " + i);

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

PR Review Comment: https://git.openjdk.org/jdk/pull/21253#discussion_r1780974265
PR Review Comment: https://git.openjdk.org/jdk/pull/21253#discussion_r1780984859
PR Review Comment: https://git.openjdk.org/jdk/pull/21253#discussion_r1780993928
PR Review Comment: https://git.openjdk.org/jdk/pull/21253#discussion_r1780994975
PR Review Comment: https://git.openjdk.org/jdk/pull/21253#discussion_r1780995750
PR Review Comment: https://git.openjdk.org/jdk/pull/21253#discussion_r1781001435
PR Review Comment: https://git.openjdk.org/jdk/pull/21253#discussion_r1781001796


More information about the client-libs-dev mailing list