|
23 | 23 |
|
24 | 24 | /*
|
25 | 25 | * @test
|
| 26 | + * @bug 8139872 |
26 | 27 | * @summary Testing built-in editor.
|
27 |
| - * @ignore 8139872 |
28 |
| - * @modules jdk.jshell/jdk.internal.jshell.tool |
| 28 | + * @modules java.desktop/java.awt |
| 29 | + * jdk.jshell/jdk.internal.jshell.tool |
29 | 30 | * @build ReplToolTesting EditorTestBase
|
30 | 31 | * @run testng EditorPadTest
|
31 | 32 | */
|
|
35 | 36 | import java.awt.Container;
|
36 | 37 | import java.awt.Dimension;
|
37 | 38 | import java.awt.Frame;
|
| 39 | +import java.awt.GraphicsEnvironment; |
38 | 40 | import java.awt.Point;
|
39 | 41 | import java.awt.Robot;
|
40 | 42 | import java.awt.event.InputEvent;
|
@@ -67,14 +69,24 @@ public class EditorPadTest extends EditorTestBase {
|
67 | 69 | private static JButton accept = null;
|
68 | 70 | private static JButton exit = null;
|
69 | 71 |
|
| 72 | + // Do not actually run if we are headless |
| 73 | + @Override |
| 74 | + public void testEditor(boolean defaultStartup, String[] args, ReplTest... tests) { |
| 75 | + if (!GraphicsEnvironment.isHeadless()) { |
| 76 | + test(defaultStartup, args, tests); |
| 77 | + } |
| 78 | + } |
| 79 | + |
70 | 80 | @BeforeClass
|
71 | 81 | public static void setUpEditorPadTest() {
|
72 |
| - try { |
73 |
| - robot = new Robot(); |
74 |
| - robot.setAutoWaitForIdle(true); |
75 |
| - robot.setAutoDelay(DELAY); |
76 |
| - } catch (AWTException e) { |
77 |
| - throw new ExceptionInInitializerError(e); |
| 82 | + if (!GraphicsEnvironment.isHeadless()) { |
| 83 | + try { |
| 84 | + robot = new Robot(); |
| 85 | + robot.setAutoWaitForIdle(true); |
| 86 | + robot.setAutoDelay(DELAY); |
| 87 | + } catch (AWTException e) { |
| 88 | + throw new ExceptionInInitializerError(e); |
| 89 | + } |
78 | 90 | }
|
79 | 91 | }
|
80 | 92 |
|
@@ -123,7 +135,7 @@ public void shutdownEditor() {
|
123 | 135 | @Test
|
124 | 136 | public void testShuttingDown() {
|
125 | 137 | testEditor(
|
126 |
| - (a) -> assertEditOutput(a, "/e", "", this::shutdownEditor) |
| 138 | + (a) -> assertEditOutput(a, "/ed", "", this::shutdownEditor) |
127 | 139 | );
|
128 | 140 | }
|
129 | 141 |
|
|
0 commit comments