8131913: jdk/internal/jline/console/StripAnsiTest.java can't run in the background
Summary: Avoid using a real terminal in tests.
Reviewed-by: rfield
--- a/jdk/test/jdk/internal/jline/console/StripAnsiTest.java Sun Mar 20 07:35:20 2016 +0000
+++ b/jdk/test/jdk/internal/jline/console/StripAnsiTest.java Mon Mar 21 10:27:50 2016 +0100
@@ -23,14 +23,16 @@
/**
* @test
- * @bug 8080679
- * @modules jdk.internal.le/jdk.internal.jline.console
+ * @bug 8080679 8131913
+ * @modules jdk.internal.le/jdk.internal.jline
+ * jdk.internal.le/jdk.internal.jline.console
* @summary Verify ConsoleReader.stripAnsi strips escape sequences from its input correctly.
*/
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.lang.reflect.Method;
+import jdk.internal.jline.UnsupportedTerminal;
import jdk.internal.jline.console.ConsoleReader;
public class StripAnsiTest {
@@ -41,7 +43,7 @@
void run() throws Exception {
ByteArrayInputStream in = new ByteArrayInputStream(new byte[0]);
ByteArrayOutputStream out = new ByteArrayOutputStream();
- ConsoleReader reader = new ConsoleReader(in, out);
+ ConsoleReader reader = new ConsoleReader(in, out, new UnsupportedTerminal());
String withAnsi = "0\033[s1\033[2J2\033[37;4m3";
String expected = "0123";