langtools/test/jdk/jshell/ToolBasicTest.java
changeset 38531 c449daa25b45
parent 38520 17e72b872ffd
child 38613 2a8e50869b08
--- a/langtools/test/jdk/jshell/ToolBasicTest.java	Fri May 20 09:47:00 2016 -0700
+++ b/langtools/test/jdk/jshell/ToolBasicTest.java	Fri May 20 11:55:46 2016 -0700
@@ -569,4 +569,17 @@
             return ex.getMessage();
         }
     }
+
+    public void testHeadlessEditPad() {
+        String prevHeadless = System.getProperty("java.awt.headless");
+        try {
+            System.setProperty("java.awt.headless", "true");
+            test(
+                (a) -> assertCommandOutputStartsWith(a, "/edit printf", "|  Cannot launch editor -- unexpected exception:")
+            );
+        } finally {
+            System.setProperty("java.awt.headless", prevHeadless==null? "false" : prevHeadless);
+        }
+    }
+
 }