RFR: 8316053: Open some swing tests 3
Damon Nguyen
dnguyen at openjdk.org
Thu Sep 21 16:52:49 UTC 2023
On Wed, 20 Sep 2023 22:30:04 GMT, Alisen Chung <achung at openjdk.org> wrote:
> Moving tests from closed to open
> 8 javax/swing/SwingGraphics/VolatileBackBuffer/MultimonVImage.java
> 9 javax/swing/SwingUtilities/4859570/bug4859570.java
> 10 javax/swing/SwingUtilities/4936652/bug4936652.java
> 11 javax/swing/ToolTipManager/4768127/bug4768127.java
Changes requested by dnguyen (Committer).
test/jdk/javax/swing/JDialog/bug4859570.java line 24:
> 22: */
> 23:
> 24: /* @test
Suggestion:
/*
* @test
Minor nit pick here. Standardize throughout the tests as well
test/jdk/javax/swing/JDialog/bug4859570.java line 41:
> 39: static Window owner;
> 40:
> 41: public static void main(String args[]) throws Exception {
Suggestion:
public static void main(String[] args) throws Exception {
Probably better to standardize this throughout all the tests here
test/jdk/javax/swing/JDialog/bug4859570.java line 63:
> 61: Robot r = new Robot();
> 62: r.delay(1000);
> 63: r.waitForIdle();
waitForIdle before delays typically
test/jdk/javax/swing/JDialog/bug4859570.java line 72:
> 70: } catch (Exception e) {
> 71: e.printStackTrace();
> 72: }
Since you already create a Robot, can't you avoid using notifyAll, synchronized, and dialogIsClosed altogether and use delays/waitForIdle?
test/jdk/javax/swing/JDialog/bug4936652.java line 24:
> 22: */
> 23:
> 24: /* @test
Suggestion:
/*
* @test
test/jdk/javax/swing/JDialog/bug4936652.java line 34:
> 32:
> 33: public class bug4936652 {
> 34: public static void main(String[] argv) throws Exception {
Suggestion:
public static void main(String[] args) throws Exception {
test/jdk/javax/swing/JLabel/bug4768127.java line 24:
> 22: */
> 23:
> 24: /* @test
Suggestion:
/*
* @test
test/jdk/javax/swing/JLabel/bug4768127.java line 45:
> 43: static JFrame fr;
> 44: static volatile JLabel[] label = new JLabel[2];
> 45: static volatile Robot robot;
I think robot can be local instead of static
test/jdk/javax/swing/JLabel/bug4768127.java line 47:
> 45: static volatile Robot robot;
> 46:
> 47: public static void main(String args[]) throws Exception {
Suggestion:
public static void main(String[] args) throws Exception {
test/jdk/javax/swing/JLabel/bug4768127.java line 112:
> 110:
> 111: static void clickLabel(int i) {
> 112: final Point p = label[i].getLocationOnScreen();
I think this line should be on EDT
test/jdk/javax/swing/JLabel/bug4768127.java line 116:
> 114: robot.mouseMove(p.x + rect.width / 2, p.y + rect.height / 2);
> 115: robot.mousePress(InputEvent.BUTTON1_MASK);
> 116: robot.mouseRelease(InputEvent.BUTTON1_MASK);
Is this deprecated? I think BUTTON1_DOWN_MASK is the replacement
-------------
PR Review: https://git.openjdk.org/jdk/pull/15851#pullrequestreview-1638302045
PR Review Comment: https://git.openjdk.org/jdk/pull/15851#discussion_r1333352329
PR Review Comment: https://git.openjdk.org/jdk/pull/15851#discussion_r1333348610
PR Review Comment: https://git.openjdk.org/jdk/pull/15851#discussion_r1333350154
PR Review Comment: https://git.openjdk.org/jdk/pull/15851#discussion_r1333351520
PR Review Comment: https://git.openjdk.org/jdk/pull/15851#discussion_r1333352539
PR Review Comment: https://git.openjdk.org/jdk/pull/15851#discussion_r1333352723
PR Review Comment: https://git.openjdk.org/jdk/pull/15851#discussion_r1333355698
PR Review Comment: https://git.openjdk.org/jdk/pull/15851#discussion_r1333353668
PR Review Comment: https://git.openjdk.org/jdk/pull/15851#discussion_r1333355548
PR Review Comment: https://git.openjdk.org/jdk/pull/15851#discussion_r1333355111
PR Review Comment: https://git.openjdk.org/jdk/pull/15851#discussion_r1333354761
More information about the client-libs-dev
mailing list