equal
deleted
inserted
replaced
1 /* |
1 /* |
2 * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. |
7 * published by the Free Software Foundation. |
39 import org.testng.annotations.Test; |
39 import org.testng.annotations.Test; |
40 |
40 |
41 @Test |
41 @Test |
42 public class ToolTabCommandTest extends UITesting { |
42 public class ToolTabCommandTest extends UITesting { |
43 |
43 |
|
44 public ToolTabCommandTest() { |
|
45 super(true); |
|
46 } |
|
47 |
44 public void testCommand() throws Exception { |
48 public void testCommand() throws Exception { |
45 // set terminal height so that help output won't hit page breaks |
49 // set terminal height so that help output won't hit page breaks |
46 System.setProperty("test.terminal.height", "1000000"); |
50 System.setProperty("test.terminal.height", "1000000"); |
47 |
51 |
48 doRunTest((inputSink, out) -> { |
52 doRunTest((inputSink, out) -> { |
82 REDRAW_PROMPT + "/edit "); |
86 REDRAW_PROMPT + "/edit "); |
83 inputSink.write(TAB); |
87 inputSink.write(TAB); |
84 waitOutput(out, resource("help.edit")); |
88 waitOutput(out, resource("help.edit")); |
85 |
89 |
86 inputSink.write(INTERRUPT + "/env " + TAB); |
90 inputSink.write(INTERRUPT + "/env " + TAB); |
87 waitOutput(out, PROMPT + "/env -\n" + |
91 waitOutput(out, PROMPT + "/env \n" + |
88 "-add-exports -add-modules -class-path -module-path \n" + |
92 "-add-exports -add-modules -class-path -module-path \n" + |
89 "\n" + |
93 "\n" + |
90 resource("jshell.console.see.synopsis") + |
94 resource("jshell.console.see.synopsis") + |
91 REDRAW_PROMPT + "/env -"); |
95 REDRAW_PROMPT + "/env -"); |
92 |
96 |
116 waitOutput(out, resource("help.exit.summary") + "\n\n" + |
120 waitOutput(out, resource("help.exit.summary") + "\n\n" + |
117 resource("jshell.console.see.full.documentation") + |
121 resource("jshell.console.see.full.documentation") + |
118 REDRAW_PROMPT + "/exit "); |
122 REDRAW_PROMPT + "/exit "); |
119 inputSink.write(INTERRUPT); |
123 inputSink.write(INTERRUPT); |
120 inputSink.write("int zebraStripes = 11\n"); |
124 inputSink.write("int zebraStripes = 11\n"); |
121 waitOutput(out, "zebraStripes ==> 11\n\u0005"); |
125 waitOutput(out, "\\u001B\\[\\?2004lzebraStripes ==> 11\n\\u001B\\[\\?2004h" + PROMPT); |
122 inputSink.write("/exit zeb" + TAB); |
126 inputSink.write("/exit zeb" + TAB); |
123 waitOutput(out, "braStr.*es"); |
127 waitOutput(out, "braStr.*es"); |
124 inputSink.write(INTERRUPT + "/doesnotexist" + TAB); |
128 inputSink.write(INTERRUPT + "/doesnotexist" + TAB); |
125 waitOutput(out, PROMPT + "/doesnotexist\n" + |
129 waitOutput(out, PROMPT + "/doesnotexist\n" + |
126 resource("jshell.console.no.such.command") + "\n" + |
130 resource("jshell.console.no.such.command") + "\n" + |