Skip to content
This repository was archived by the owner on Aug 27, 2022. It is now read-only.
/ lanai Public archive

Commit 9b3fb5d

Browse files
author
Pankaj Bansal
committedMay 27, 2020
8233551: [TESTBUG] SelectEditTableCell.java fails on MacOS
Reviewed-by: psadhukhan
1 parent c638618 commit 9b3fb5d

File tree

2 files changed

+20
-13
lines changed

2 files changed

+20
-13
lines changed
 

‎test/jdk/ProblemList.txt

-1
Original file line numberDiff line numberDiff line change
@@ -835,7 +835,6 @@ javax/swing/text/StyledEditorKit/4506788/bug4506788.java 8233562 macosx-all
835835
javax/swing/text/JTextComponent/6361367/bug6361367.java 8233569 macosx-all
836836
javax/swing/text/html/HTMLEditorKit/5043626/bug5043626.java 233570 macosx-all
837837
javax/swing/ProgressMonitor/ProgressMonitorEscapeKeyPress.java 8233635 macosx-all
838-
javax/swing/JTable/7124218/SelectEditTableCell.java 8233551 macosx-all
839838
javax/swing/JRootPane/4670486/bug4670486.java 8042381 macosx-all
840839
javax/swing/JRadioButton/ButtonGroupFocus/ButtonGroupFocusTest.java 8233555 macosx-all
841840
javax/swing/JRadioButton/8075609/bug8075609.java 8233555 macosx-all

‎test/jdk/javax/swing/JTable/7124218/SelectEditTableCell.java

+20-12
Original file line numberDiff line numberDiff line change
@@ -50,23 +50,28 @@ public class SelectEditTableCell {
5050

5151
public static void main(String[] args) throws Exception {
5252
robot = new Robot();
53-
robot.delay(2000);
53+
robot.setAutoDelay(100);
5454
UIManager.LookAndFeelInfo[] lookAndFeelArray
5555
= UIManager.getInstalledLookAndFeels();
5656
for (UIManager.LookAndFeelInfo lookAndFeelItem : lookAndFeelArray) {
5757
executeCase(lookAndFeelItem.getClassName());
5858
}
59-
6059
}
6160

6261
private static void executeCase(String lookAndFeelString) throws Exception {
63-
if (tryLookAndFeel(lookAndFeelString)) {
64-
createUI(lookAndFeelString);
65-
robot.delay(2000);
66-
runTestCase();
67-
robot.delay(2000);
68-
cleanUp();
69-
robot.delay(2000);
62+
try {
63+
if (tryLookAndFeel(lookAndFeelString)) {
64+
createUI(lookAndFeelString);
65+
robot.delay(2000);
66+
runTestCase();
67+
robot.delay(2000);
68+
cleanUp();
69+
robot.delay(2000);
70+
}
71+
} finally {
72+
if (frame != null) {
73+
SwingUtilities.invokeAndWait(frame::dispose);
74+
}
7075
}
7176

7277
}
@@ -100,6 +105,7 @@ private static void runTestCase() throws Exception {
100105
robot.mouseMove(centerPoint.x, centerPoint.y);
101106
robot.mousePress(InputEvent.BUTTON1_MASK);
102107
robot.mouseRelease(InputEvent.BUTTON1_MASK);
108+
robot.waitForIdle();
103109
SwingUtilities.invokeAndWait(new Runnable() {
104110
@Override
105111
public void run() {
@@ -112,7 +118,7 @@ public void run() {
112118
}
113119
}
114120
});
115-
robot.waitForIdle();
121+
116122
int fetchKeyCode;
117123
keyTap(fetchKeyCode = isMac(lookAndFeel)
118124
? KeyEvent.VK_ENTER : KeyEvent.VK_SPACE);
@@ -129,7 +135,7 @@ public void run() {
129135
}
130136
}
131137
});
132-
robot.waitForIdle();
138+
133139
keyTap(KeyEvent.VK_SPACE);
134140
robot.waitForIdle();
135141
SwingUtilities.invokeAndWait(new Runnable() {
@@ -149,10 +155,12 @@ public void run() {
149155
}
150156
}
151157
});
152-
robot.waitForIdle();
158+
153159
// hitting a letter key will start editing
154160
keyTap(KeyEvent.VK_A);
161+
robot.waitForIdle();
155162
keyTap(KeyEvent.VK_SPACE);
163+
robot.waitForIdle();
156164
keyTap(KeyEvent.VK_A);
157165
robot.waitForIdle();
158166
SwingUtilities.invokeAndWait(new Runnable() {

0 commit comments

Comments
 (0)