Skip to content

Commit 9da6eea

Browse files
committed
8191678: [TESTBUG] Add keyword headful in java/awt and javax tests
Also fix some NPE thrown if run headless. Reviewed-by: serb
1 parent c4bab8b commit 9da6eea

12 files changed

Lines changed: 43 additions & 13 deletions

File tree

test/jdk/java/awt/Component/GetScreenLocTest/ComponentGetLocationOnScreenNPETest.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
* @test
2626
* @bug 8189204
2727
* @summary Possible NPE in Component::getLocationOnScreen()
28+
* @key headful
2829
* @run main ComponentGetLocationOnScreenNPETest
2930
*/
3031

test/jdk/java/awt/Dialog/SiblingChildOrder/SiblingChildOrderTest.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,11 @@
2121
* questions.
2222
*/
2323

24-
/* @test
24+
/**
25+
* @test
2526
* @bug 8190230
2627
* @summary [macosx] Order of overlapping of modal dialogs is wrong
28+
* @key headful
2729
* @run main SiblingChildOrderTest
2830
*/
2931

test/jdk/java/awt/Focus/FocusTransitionTest/FocusTransitionTest.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,12 @@
2121
* questions.
2222
*/
2323

24-
/* @test
24+
/**
25+
* @test
2526
* @bug 8155197
2627
* @summary Tests whether the value of mostRecentFocusOwner for a window is correct, if
2728
* another window is displayed during focus transition
29+
* @key headful
2830
* @library ../../regtesthelpers
2931
* @build Util
3032
* @run main FocusTransitionTest

test/jdk/javax/swing/DefaultButtonModel/DefaultButtonModelCrashTest.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,15 @@
2020
* or visit www.oracle.com if you need additional information or have any
2121
* questions.
2222
*/
23-
/*
23+
24+
/**
2425
* @test
2526
* @bug 8182577
2627
* @summary Verifies if moving focus via custom ButtonModel causes crash
28+
* @key headful
2729
* @run main DefaultButtonModelCrashTest
2830
*/
31+
2932
import java.awt.BorderLayout;
3033
import java.awt.Container;
3134
import java.awt.Point;
@@ -61,7 +64,7 @@ public DefaultButtonModelCrashTest() throws Exception {
6164
robot.keyPress(KeyEvent.VK_TAB);
6265
robot.keyRelease(KeyEvent.VK_TAB);
6366
} finally {
64-
SwingUtilities.invokeAndWait(()->frame .dispose());
67+
if (frame != null) { SwingUtilities.invokeAndWait(()->frame.dispose()); }
6568
}
6669
}
6770

test/jdk/javax/swing/GraphicsConfigNotifier/TestMultiScreenGConfigNotify.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,14 @@
2020
* or visit www.oracle.com if you need additional information or have any
2121
* questions.
2222
*/
23-
/*
23+
24+
/**
2425
* @test
2526
* @bug 8178025
2627
* @summary Verifies if graphicsConfiguration property notification is sent
2728
* when frame is moved from one screen to another in multiscreen
2829
* environment.
30+
* @key headful
2931
* @run main TestMultiScreenGConfigNotify
3032
*/
3133

test/jdk/javax/swing/JButton/TestGlyphBreak.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,12 @@
2020
* or visit www.oracle.com if you need additional information or have any
2121
* questions.
2222
*/
23-
/*
23+
24+
/**
2425
* @test
2526
* @bug 8191428
2627
* @summary Verifies if text view is not borken into multiple lines
28+
* @key headful
2729
* @run main/othervm -Dsun.java2d.uiScale=1.2 TestGlyphBreak
2830
*/
2931

test/jdk/javax/swing/JComboBox/8182031/ComboPopupTest.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,15 @@
2020
* or visit www.oracle.com if you need additional information or have any
2121
* questions.
2222
*/
23-
/*
23+
24+
/**
2425
* @test
2526
* @bug 8182031
2627
* @summary Verifies if ComboBox Popup opens and closes immediately
28+
* @key headful
2729
* @run main ComboPopupTest
2830
*/
31+
2932
import java.awt.Container;
3033
import java.awt.Dimension;
3134
import java.awt.FlowLayout;
@@ -80,7 +83,7 @@ public ComboPopupTest() throws Exception {
8083
throw new RuntimeException("combobox popup is not visible");
8184
}
8285
} finally {
83-
SwingUtilities.invokeAndWait(()->frame.dispose());
86+
if (frame != null) { SwingUtilities.invokeAndWait(()->frame.dispose()); }
8487
}
8588
}
8689

test/jdk/javax/swing/JMenu/8178430/LabelDotTest.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,16 @@
2020
* or visit www.oracle.com if you need additional information or have any
2121
* questions.
2222
*/
23-
/*
23+
24+
/**
2425
* @test
2526
* @bug 8178430
2627
* @summary JMenu in GridBagLayout flickers when label text shows "..." and
2728
* is updated
29+
* @key headful
2830
* @run main LabelDotTest
2931
*/
32+
3033
import java.awt.Dimension;
3134
import java.awt.GridBagConstraints;
3235
import java.awt.GridBagLayout;
@@ -112,7 +115,9 @@ public static void main(String[] args) throws Exception {
112115
SwingUtilities.invokeAndWait(() -> createUI());
113116
runTest(50);
114117
} finally {
115-
SwingUtilities.invokeAndWait(() -> frame.dispose());
118+
if (frame != null) {
119+
SwingUtilities.invokeAndWait(() -> frame.dispose());
120+
}
116121
if (isException)
117122
throw new RuntimeException("Size of Menu bar is not correct.");
118123
}

test/jdk/javax/swing/JTextArea/TestTabSize.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,12 @@
2020
* or visit www.oracle.com if you need additional information or have any
2121
* questions.
2222
*/
23-
/*
23+
24+
/**
2425
* @test
2526
* @bug 8187957
2627
* @summary Verifies Tab Size works correctly in JTextArea
28+
* @key headful
2729
* @run main TestTabSize
2830
*/
2931

@@ -96,7 +98,9 @@ public static void main(String args[]) throws Exception {
9698
} catch (BadLocationException ex) {
9799
excpnthrown = true;
98100
} finally {
99-
f.dispose();
101+
if (f != null) {
102+
f.dispose();
103+
}
100104
}
101105
});
102106
if (excpnthrown) {

test/jdk/javax/swing/dnd/8139050/NativeErrorsInTableDnD.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,12 @@
4040
/**
4141
* @test
4242
* @bug 8139050 8153871
43+
* @key headful
4344
* @library ../../../../lib/testlibrary
4445
* @build ExtendedRobot
4546
* @run main/othervm/timeout=360 -Xcheck:jni NativeErrorsInTableDnD
4647
*/
48+
4749
public final class NativeErrorsInTableDnD {
4850

4951
private static JFrame frame;

0 commit comments

Comments
 (0)