Skip to content

Commit 2edf408

Browse files
committedMar 13, 2024
8328004: Minor updates to TrayIcon test DisposeInActionEventTest.java
Reviewed-by: azvegint
1 parent 1ad3ebc commit 2edf408

File tree

1 file changed

+16
-15
lines changed

1 file changed

+16
-15
lines changed
 

‎test/jdk/java/awt/TrayIcon/DisposeInActionEventTest/DisposeInActionEventTest.java ‎test/jdk/java/awt/TrayIcon/DisposeInActionEventTest.java

+16-15
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,12 @@
3939
* @bug 6299866 8316931
4040
* @summary Tests that no NPE is thrown when the tray icon is disposed from the
4141
* handler of action event caused by clicking on this icon.
42-
* @library ../../regtesthelpers /test/lib
42+
* @library /java/awt/regtesthelpers /test/lib
4343
* @build PassFailJFrame jtreg.SkippedException
4444
* @run main/manual DisposeInActionEventTest
4545
*/
4646

4747
public class DisposeInActionEventTest {
48-
private static JTextArea textArea;
4948
private static SystemTray systemTray;
5049
private static TrayIcon trayIcon;
5150

@@ -57,24 +56,26 @@ public static void main(String[] args) throws Exception {
5756
String clickInstruction =
5857
(Platform.isOSX()) ? "Right-click" : "Double click (left mouse button)";
5958

60-
String instructions = "When the test starts, it adds the icon to the tray area. If you\n" +
61-
" don't see a tray icon, please, make sure that the tray area\n" +
62-
" (also called Taskbar Status Area on MS Windows, Notification\n" +
63-
" Area on Gnome or System Tray on KDE) is visible.\n\n" +
64-
clickInstruction + " the tray icon to trigger the\n" +
65-
" action event. Brief information about action events is printed\n" +
66-
" in the frame. After each action event, the tray icon is removed from\n" +
67-
" the tray and then added back in a second.\n\n" +
59+
String instructions = "When the test starts, it adds an icon to the tray area.\n" +
60+
"The icon is a red filled square with a white border.\n" +
61+
"If you don't see this tray icon, please make sure that the tray area\n" +
62+
"(also called Taskbar Status Area on MS Windows, Notification\n" +
63+
"Area on Gnome or System Tray on KDE) is visible.\n" +
64+
"On macOS the default location is the right of the top system bar.\n\n" +
65+
clickInstruction + " the tray icon to trigger the action event.\n" +
66+
"Brief information about action events is printed\n" +
67+
"in the Event Message Display frame.\n" +
68+
"After each action event, the tray icon is removed from\n" +
69+
"the tray and then added back in a second.\n\n" +
6870
"The test checks if any exceptions are thrown when removing and\n" +
69-
" re-adding the icon. If something is wrong, the test will automatically fail.\n" +
70-
" Repeat clicks several times Then press PASS button.";
71+
"re-adding the icon. If something is wrong, the test will automatically fail.\n" +
72+
"Repeat clicks several times. Then press PASS button.";
7173

7274
try {
7375
PassFailJFrame.builder()
7476
.title("DisposeInActionEventTest")
7577
.instructions(instructions)
76-
.testTimeOut(10)
77-
.rows(15)
78+
.rows(18)
7879
.columns(45)
7980
.testUI(DisposeInActionEventTest::showFrameAndIcon)
8081
.build()
@@ -90,7 +91,7 @@ private static JFrame showFrameAndIcon() {
9091
JFrame frame = new JFrame("Event Message Display");
9192
frame.setLayout(new BorderLayout());
9293

93-
textArea = new JTextArea();
94+
JTextArea textArea = new JTextArea();
9495
frame.getContentPane().add(new JScrollPane(textArea));
9596
frame.setSize(400, 200);
9697

0 commit comments

Comments
 (0)
Please sign in to comment.