RFR: 8315726: Open source several AWT applet tests [v2]

Alexey Ivanov aivanov at openjdk.org
Tue Sep 12 21:07:45 UTC 2023


On Tue, 12 Sep 2023 12:26:38 GMT, Alexander Zvegintsev <azvegint at openjdk.org> wrote:

>> Some closed AWT test are open sourced.
>
> Alexander Zvegintsev has updated the pull request incrementally with one additional commit since the last revision:
> 
>   spacing

Changes requested by aivanov (Reviewer).

test/jdk/java/awt/Choice/ChoiceSelectTest.java line 39:

> 37: 
> 38: public class ChoiceSelectTest extends Panel {
> 39:     Choice c;

Can be `final`?

test/jdk/java/awt/Choice/ChoiceSelectTest.java line 160:

> 158:     public static void main(String[] args) throws Exception {
> 159:         EventQueue.invokeAndWait(() -> new ChoiceSelectTest().test());
> 160:     }

The choice is never shown on the screen, is it? Can the test be headless then?

test/jdk/java/awt/Focus/TestWindowsLFFocus.java line 62:

> 60: 
> 61:     private static void test() throws Exception {
> 62:         try {

You should reset `actionFired = false` before creating UI and clicking the menu. Otherwise the test will always pass if it passes in the first Look-and-Feel.

test/jdk/java/awt/Focus/TestWindowsLFFocus.java line 112:

> 110:             robot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK);
> 111: 
> 112:             robot.delay(500);

Suggestion:

            robot.waitForIdle();
            robot.delay(500);

Perhaps, you want to ensure the events are processed before checking the value of `actionFired`.

test/jdk/java/awt/geom/HitTest/PathHitTestManual.java line 114:

> 112:     public static class PathHitTestCanvas extends Canvas implements Runnable {
> 113:         public static final Color[] colors = {
> 114:                 /* contains?  point in?  intersects? */

Should this line align to Yes / No comments below?

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

PR Review: https://git.openjdk.org/jdk/pull/15671#pullrequestreview-1623068233
PR Review Comment: https://git.openjdk.org/jdk/pull/15671#discussion_r1323525274
PR Review Comment: https://git.openjdk.org/jdk/pull/15671#discussion_r1323526349
PR Review Comment: https://git.openjdk.org/jdk/pull/15671#discussion_r1323537138
PR Review Comment: https://git.openjdk.org/jdk/pull/15671#discussion_r1323544748
PR Review Comment: https://git.openjdk.org/jdk/pull/15671#discussion_r1323561593


More information about the client-libs-dev mailing list