RFR: 8340084: Open source AWT Frame related tests

Harshitha Onkar honkar at openjdk.org
Wed Sep 18 23:48:35 UTC 2024


On Wed, 18 Sep 2024 06:18:03 GMT, Abhishek Kumar <abhiscxk at openjdk.org> wrote:

> Few AWT Frame related tests are converted from applet to manual and moved to open.

Changes requested by honkar (Reviewer).

test/jdk/java/awt/Frame/FrameSetMinimumSizeTest.java line 61:

> 59:             if (!passed) {
> 60:                 throw new RuntimeException("Frame's setMinimumSize not honoured");
> 61:              }

The test condition does not seem right.
For instance if `passed` was false in one of the previous checks and the final case results in true then the test passes, which seems to be incorrect.

test/jdk/java/awt/Frame/FrameSetMinimumSizeTest.java line 80:

> 78:     private static boolean verifyFrameSize(Dimension expected) {
> 79: 
> 80:         if (f.getSize().width != expected.width || f.getSize().height != expected.height) {

Do we need to wrap calls to `verifyFrameSize()` in EDT, since we are accessing frame.getSize() ?

test/jdk/java/awt/Frame/PackTwiceTest.java line 56:

> 54: 
> 55:     private static Frame createUI() {
> 56:         Frame f = new Frame("TestFrame");

Title of the frame can be renamed to something more specific to the test.

Suggestion:

        Frame f = new Frame("PackTwiceTest TestFrame");

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

PR Review: https://git.openjdk.org/jdk/pull/21052#pullrequestreview-2314031722
PR Review Comment: https://git.openjdk.org/jdk/pull/21052#discussion_r1765883111
PR Review Comment: https://git.openjdk.org/jdk/pull/21052#discussion_r1765884441
PR Review Comment: https://git.openjdk.org/jdk/pull/21052#discussion_r1765885855


More information about the client-libs-dev mailing list