author | mchung |
Sat, 24 Feb 2018 09:41:42 -0800 | |
changeset 48984 | b5d1fb0701d4 |
parent 47216 | 71c04702a3d5 |
permissions | -rw-r--r-- |
38531
c449daa25b45
8157200: jshell tool: Add /retain command to persist settings
rfield
parents:
diff
changeset
|
1 |
/* |
c449daa25b45
8157200: jshell tool: Add /retain command to persist settings
rfield
parents:
diff
changeset
|
2 |
* Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. |
c449daa25b45
8157200: jshell tool: Add /retain command to persist settings
rfield
parents:
diff
changeset
|
3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
c449daa25b45
8157200: jshell tool: Add /retain command to persist settings
rfield
parents:
diff
changeset
|
4 |
* |
c449daa25b45
8157200: jshell tool: Add /retain command to persist settings
rfield
parents:
diff
changeset
|
5 |
* This code is free software; you can redistribute it and/or modify it |
c449daa25b45
8157200: jshell tool: Add /retain command to persist settings
rfield
parents:
diff
changeset
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
c449daa25b45
8157200: jshell tool: Add /retain command to persist settings
rfield
parents:
diff
changeset
|
7 |
* published by the Free Software Foundation. |
c449daa25b45
8157200: jshell tool: Add /retain command to persist settings
rfield
parents:
diff
changeset
|
8 |
* |
c449daa25b45
8157200: jshell tool: Add /retain command to persist settings
rfield
parents:
diff
changeset
|
9 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
c449daa25b45
8157200: jshell tool: Add /retain command to persist settings
rfield
parents:
diff
changeset
|
10 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
c449daa25b45
8157200: jshell tool: Add /retain command to persist settings
rfield
parents:
diff
changeset
|
11 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
c449daa25b45
8157200: jshell tool: Add /retain command to persist settings
rfield
parents:
diff
changeset
|
12 |
* version 2 for more details (a copy is included in the LICENSE file that |
c449daa25b45
8157200: jshell tool: Add /retain command to persist settings
rfield
parents:
diff
changeset
|
13 |
* accompanied this code). |
c449daa25b45
8157200: jshell tool: Add /retain command to persist settings
rfield
parents:
diff
changeset
|
14 |
* |
c449daa25b45
8157200: jshell tool: Add /retain command to persist settings
rfield
parents:
diff
changeset
|
15 |
* You should have received a copy of the GNU General Public License version |
c449daa25b45
8157200: jshell tool: Add /retain command to persist settings
rfield
parents:
diff
changeset
|
16 |
* 2 along with this work; if not, write to the Free Software Foundation, |
c449daa25b45
8157200: jshell tool: Add /retain command to persist settings
rfield
parents:
diff
changeset
|
17 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
c449daa25b45
8157200: jshell tool: Add /retain command to persist settings
rfield
parents:
diff
changeset
|
18 |
* |
c449daa25b45
8157200: jshell tool: Add /retain command to persist settings
rfield
parents:
diff
changeset
|
19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
c449daa25b45
8157200: jshell tool: Add /retain command to persist settings
rfield
parents:
diff
changeset
|
20 |
* or visit www.oracle.com if you need additional information or have any |
c449daa25b45
8157200: jshell tool: Add /retain command to persist settings
rfield
parents:
diff
changeset
|
21 |
* questions. |
c449daa25b45
8157200: jshell tool: Add /retain command to persist settings
rfield
parents:
diff
changeset
|
22 |
*/ |
c449daa25b45
8157200: jshell tool: Add /retain command to persist settings
rfield
parents:
diff
changeset
|
23 |
|
c449daa25b45
8157200: jshell tool: Add /retain command to persist settings
rfield
parents:
diff
changeset
|
24 |
/* |
c449daa25b45
8157200: jshell tool: Add /retain command to persist settings
rfield
parents:
diff
changeset
|
25 |
* @test |
41937
1313399705e9
8161969: jshell tool: /var value is not truncated per feedback setting
rfield
parents:
41635
diff
changeset
|
26 |
* @bug 8157200 8163840 8154513 |
38531
c449daa25b45
8157200: jshell tool: Add /retain command to persist settings
rfield
parents:
diff
changeset
|
27 |
* @summary Tests of what information is retained across jshell tool runs |
c449daa25b45
8157200: jshell tool: Add /retain command to persist settings
rfield
parents:
diff
changeset
|
28 |
* @modules jdk.jshell/jdk.internal.jshell.tool |
c449daa25b45
8157200: jshell tool: Add /retain command to persist settings
rfield
parents:
diff
changeset
|
29 |
* @build ToolRetainTest ReplToolTesting |
c449daa25b45
8157200: jshell tool: Add /retain command to persist settings
rfield
parents:
diff
changeset
|
30 |
* @run testng ToolRetainTest |
c449daa25b45
8157200: jshell tool: Add /retain command to persist settings
rfield
parents:
diff
changeset
|
31 |
*/ |
c449daa25b45
8157200: jshell tool: Add /retain command to persist settings
rfield
parents:
diff
changeset
|
32 |
|
41937
1313399705e9
8161969: jshell tool: /var value is not truncated per feedback setting
rfield
parents:
41635
diff
changeset
|
33 |
import java.util.Locale; |
38531
c449daa25b45
8157200: jshell tool: Add /retain command to persist settings
rfield
parents:
diff
changeset
|
34 |
import org.testng.annotations.Test; |
c449daa25b45
8157200: jshell tool: Add /retain command to persist settings
rfield
parents:
diff
changeset
|
35 |
|
c449daa25b45
8157200: jshell tool: Add /retain command to persist settings
rfield
parents:
diff
changeset
|
36 |
@Test |
c449daa25b45
8157200: jshell tool: Add /retain command to persist settings
rfield
parents:
diff
changeset
|
37 |
public class ToolRetainTest extends ReplToolTesting { |
c449daa25b45
8157200: jshell tool: Add /retain command to persist settings
rfield
parents:
diff
changeset
|
38 |
|
c449daa25b45
8157200: jshell tool: Add /retain command to persist settings
rfield
parents:
diff
changeset
|
39 |
public void testRetainMode() { |
c449daa25b45
8157200: jshell tool: Add /retain command to persist settings
rfield
parents:
diff
changeset
|
40 |
test( |
38539 | 41 |
(a) -> assertCommand(a, "/set mode trm -quiet", "| Created new feedback mode: trm"), |
38531
c449daa25b45
8157200: jshell tool: Add /retain command to persist settings
rfield
parents:
diff
changeset
|
42 |
(a) -> assertCommand(a, "/set feedback trm", ""), |
c449daa25b45
8157200: jshell tool: Add /retain command to persist settings
rfield
parents:
diff
changeset
|
43 |
(a) -> assertCommand(a, "/set format trm display '{name}:{value}'", ""), |
c449daa25b45
8157200: jshell tool: Add /retain command to persist settings
rfield
parents:
diff
changeset
|
44 |
(a) -> assertCommand(a, "int x = 45", "x:45"), |
41635
cb3d04878117
8163840: jshell tool: provide way to display configuration settings
rfield
parents:
38539
diff
changeset
|
45 |
(a) -> assertCommand(a, "/set mode -retain trm", ""), |
38531
c449daa25b45
8157200: jshell tool: Add /retain command to persist settings
rfield
parents:
diff
changeset
|
46 |
(a) -> assertCommand(a, "/exit", "") |
c449daa25b45
8157200: jshell tool: Add /retain command to persist settings
rfield
parents:
diff
changeset
|
47 |
); |
c449daa25b45
8157200: jshell tool: Add /retain command to persist settings
rfield
parents:
diff
changeset
|
48 |
test( |
41635
cb3d04878117
8163840: jshell tool: provide way to display configuration settings
rfield
parents:
38539
diff
changeset
|
49 |
(a) -> assertCommandOutputContains(a, "/set mode trm", |
cb3d04878117
8163840: jshell tool: provide way to display configuration settings
rfield
parents:
38539
diff
changeset
|
50 |
"/set format trm display \"{name}:{value}\""), |
38531
c449daa25b45
8157200: jshell tool: Add /retain command to persist settings
rfield
parents:
diff
changeset
|
51 |
(a) -> assertCommand(a, "/set feedback trm", ""), |
c449daa25b45
8157200: jshell tool: Add /retain command to persist settings
rfield
parents:
diff
changeset
|
52 |
(a) -> assertCommand(a, "int x = 45", "x:45") |
c449daa25b45
8157200: jshell tool: Add /retain command to persist settings
rfield
parents:
diff
changeset
|
53 |
); |
c449daa25b45
8157200: jshell tool: Add /retain command to persist settings
rfield
parents:
diff
changeset
|
54 |
} |
c449daa25b45
8157200: jshell tool: Add /retain command to persist settings
rfield
parents:
diff
changeset
|
55 |
|
c449daa25b45
8157200: jshell tool: Add /retain command to persist settings
rfield
parents:
diff
changeset
|
56 |
public void testRetain2Mode() { |
c449daa25b45
8157200: jshell tool: Add /retain command to persist settings
rfield
parents:
diff
changeset
|
57 |
test( |
38539 | 58 |
(a) -> assertCommand(a, "/set mode trm1 -quiet", "| Created new feedback mode: trm1"), |
41635
cb3d04878117
8163840: jshell tool: provide way to display configuration settings
rfield
parents:
38539
diff
changeset
|
59 |
(a) -> assertCommand(a, "/set mode -retain trm1", ""), |
cb3d04878117
8163840: jshell tool: provide way to display configuration settings
rfield
parents:
38539
diff
changeset
|
60 |
(a) -> assertCommand(a, "/set feedback -retain trm1", ""), |
38531
c449daa25b45
8157200: jshell tool: Add /retain command to persist settings
rfield
parents:
diff
changeset
|
61 |
(a) -> assertCommand(a, "/set format trm1 display '{name}:{value}'", ""), |
c449daa25b45
8157200: jshell tool: Add /retain command to persist settings
rfield
parents:
diff
changeset
|
62 |
(a) -> assertCommand(a, "int x = 66", "x:66"), |
41635
cb3d04878117
8163840: jshell tool: provide way to display configuration settings
rfield
parents:
38539
diff
changeset
|
63 |
(a) -> assertCommand(a, "/set mode -retain trm1", ""), |
38531
c449daa25b45
8157200: jshell tool: Add /retain command to persist settings
rfield
parents:
diff
changeset
|
64 |
(a) -> assertCommand(a, "/exit", "") |
c449daa25b45
8157200: jshell tool: Add /retain command to persist settings
rfield
parents:
diff
changeset
|
65 |
); |
41937
1313399705e9
8161969: jshell tool: /var value is not truncated per feedback setting
rfield
parents:
41635
diff
changeset
|
66 |
test(Locale.ROOT, true, new String[0], "", |
38539 | 67 |
(a) -> assertCommand(a, "/set mode trm2 -quiet", ""), |
38531
c449daa25b45
8157200: jshell tool: Add /retain command to persist settings
rfield
parents:
diff
changeset
|
68 |
(a) -> assertCommand(a, "/set format trm2 display '{name}={value}'", ""), |
c449daa25b45
8157200: jshell tool: Add /retain command to persist settings
rfield
parents:
diff
changeset
|
69 |
(a) -> assertCommand(a, "int x = 45", "x:45"), |
41635
cb3d04878117
8163840: jshell tool: provide way to display configuration settings
rfield
parents:
38539
diff
changeset
|
70 |
(a) -> assertCommand(a, "/set mode -retain trm2", ""), |
38531
c449daa25b45
8157200: jshell tool: Add /retain command to persist settings
rfield
parents:
diff
changeset
|
71 |
(a) -> assertCommand(a, "/exit", "") |
c449daa25b45
8157200: jshell tool: Add /retain command to persist settings
rfield
parents:
diff
changeset
|
72 |
); |
41937
1313399705e9
8161969: jshell tool: /var value is not truncated per feedback setting
rfield
parents:
41635
diff
changeset
|
73 |
test(Locale.ROOT, true, new String[0], "", |
41635
cb3d04878117
8163840: jshell tool: provide way to display configuration settings
rfield
parents:
38539
diff
changeset
|
74 |
(a) -> assertCommandOutputContains(a, "/set mode trm1", |
cb3d04878117
8163840: jshell tool: provide way to display configuration settings
rfield
parents:
38539
diff
changeset
|
75 |
"/set format trm1 display \"{name}:{value}\""), |
cb3d04878117
8163840: jshell tool: provide way to display configuration settings
rfield
parents:
38539
diff
changeset
|
76 |
(a) -> assertCommand(a, "/set format trm2 display", |
cb3d04878117
8163840: jshell tool: provide way to display configuration settings
rfield
parents:
38539
diff
changeset
|
77 |
"| /set format trm2 display \"{name}={value}\""), |
38531
c449daa25b45
8157200: jshell tool: Add /retain command to persist settings
rfield
parents:
diff
changeset
|
78 |
(a) -> assertCommand(a, "int x = 99", "x:99"), |
c449daa25b45
8157200: jshell tool: Add /retain command to persist settings
rfield
parents:
diff
changeset
|
79 |
(a) -> assertCommand(a, "/set feedback trm2", ""), |
c449daa25b45
8157200: jshell tool: Add /retain command to persist settings
rfield
parents:
diff
changeset
|
80 |
(a) -> assertCommand(a, "int z = 77", "z=77") |
c449daa25b45
8157200: jshell tool: Add /retain command to persist settings
rfield
parents:
diff
changeset
|
81 |
); |
c449daa25b45
8157200: jshell tool: Add /retain command to persist settings
rfield
parents:
diff
changeset
|
82 |
} |
c449daa25b45
8157200: jshell tool: Add /retain command to persist settings
rfield
parents:
diff
changeset
|
83 |
|
c449daa25b45
8157200: jshell tool: Add /retain command to persist settings
rfield
parents:
diff
changeset
|
84 |
public void testRetainFeedback() { |
c449daa25b45
8157200: jshell tool: Add /retain command to persist settings
rfield
parents:
diff
changeset
|
85 |
test( |
41635
cb3d04878117
8163840: jshell tool: provide way to display configuration settings
rfield
parents:
38539
diff
changeset
|
86 |
(a) -> assertCommand(a, "/set feedback -retain verbose", "| Feedback mode: verbose"), |
38531
c449daa25b45
8157200: jshell tool: Add /retain command to persist settings
rfield
parents:
diff
changeset
|
87 |
(a) -> assertCommand(a, "/exit", "") |
c449daa25b45
8157200: jshell tool: Add /retain command to persist settings
rfield
parents:
diff
changeset
|
88 |
); |
c449daa25b45
8157200: jshell tool: Add /retain command to persist settings
rfield
parents:
diff
changeset
|
89 |
test( |
41635
cb3d04878117
8163840: jshell tool: provide way to display configuration settings
rfield
parents:
38539
diff
changeset
|
90 |
(a) -> assertCommandOutputStartsWith(a, "/set feedback", |
cb3d04878117
8163840: jshell tool: provide way to display configuration settings
rfield
parents:
38539
diff
changeset
|
91 |
"| /set feedback -retain verbose\n" + |
cb3d04878117
8163840: jshell tool: provide way to display configuration settings
rfield
parents:
38539
diff
changeset
|
92 |
"| \n" + |
cb3d04878117
8163840: jshell tool: provide way to display configuration settings
rfield
parents:
38539
diff
changeset
|
93 |
"| "), |
38531
c449daa25b45
8157200: jshell tool: Add /retain command to persist settings
rfield
parents:
diff
changeset
|
94 |
(a) -> assertCommandOutputContains(a, "int h =8", "| created variable h : int") |
c449daa25b45
8157200: jshell tool: Add /retain command to persist settings
rfield
parents:
diff
changeset
|
95 |
); |
c449daa25b45
8157200: jshell tool: Add /retain command to persist settings
rfield
parents:
diff
changeset
|
96 |
} |
c449daa25b45
8157200: jshell tool: Add /retain command to persist settings
rfield
parents:
diff
changeset
|
97 |
|
c449daa25b45
8157200: jshell tool: Add /retain command to persist settings
rfield
parents:
diff
changeset
|
98 |
public void testRetainFeedbackBlank() { |
41635
cb3d04878117
8163840: jshell tool: provide way to display configuration settings
rfield
parents:
38539
diff
changeset
|
99 |
String feedbackOut = |
cb3d04878117
8163840: jshell tool: provide way to display configuration settings
rfield
parents:
38539
diff
changeset
|
100 |
"| /set feedback -retain verbose\n" + |
cb3d04878117
8163840: jshell tool: provide way to display configuration settings
rfield
parents:
38539
diff
changeset
|
101 |
"| \n" + |
cb3d04878117
8163840: jshell tool: provide way to display configuration settings
rfield
parents:
38539
diff
changeset
|
102 |
"| Available feedback modes:\n" + |
cb3d04878117
8163840: jshell tool: provide way to display configuration settings
rfield
parents:
38539
diff
changeset
|
103 |
"| concise\n" + |
cb3d04878117
8163840: jshell tool: provide way to display configuration settings
rfield
parents:
38539
diff
changeset
|
104 |
"| normal\n" + |
cb3d04878117
8163840: jshell tool: provide way to display configuration settings
rfield
parents:
38539
diff
changeset
|
105 |
"| silent\n" + |
cb3d04878117
8163840: jshell tool: provide way to display configuration settings
rfield
parents:
38539
diff
changeset
|
106 |
"| verbose"; |
38531
c449daa25b45
8157200: jshell tool: Add /retain command to persist settings
rfield
parents:
diff
changeset
|
107 |
test( |
c449daa25b45
8157200: jshell tool: Add /retain command to persist settings
rfield
parents:
diff
changeset
|
108 |
(a) -> assertCommand(a, "/set feedback verbose", "| Feedback mode: verbose"), |
41635
cb3d04878117
8163840: jshell tool: provide way to display configuration settings
rfield
parents:
38539
diff
changeset
|
109 |
(a) -> assertCommand(a, "/set feedback -retain", ""), |
cb3d04878117
8163840: jshell tool: provide way to display configuration settings
rfield
parents:
38539
diff
changeset
|
110 |
(a) -> assertCommand(a, "/set feedback", feedbackOut), |
38531
c449daa25b45
8157200: jshell tool: Add /retain command to persist settings
rfield
parents:
diff
changeset
|
111 |
(a) -> assertCommand(a, "/exit", "") |
c449daa25b45
8157200: jshell tool: Add /retain command to persist settings
rfield
parents:
diff
changeset
|
112 |
); |
c449daa25b45
8157200: jshell tool: Add /retain command to persist settings
rfield
parents:
diff
changeset
|
113 |
test( |
41635
cb3d04878117
8163840: jshell tool: provide way to display configuration settings
rfield
parents:
38539
diff
changeset
|
114 |
(a) -> assertCommand(a, "/set feedback", feedbackOut), |
38531
c449daa25b45
8157200: jshell tool: Add /retain command to persist settings
rfield
parents:
diff
changeset
|
115 |
(a) -> assertCommandOutputContains(a, "int qw = 5", "| created variable qw : int") |
c449daa25b45
8157200: jshell tool: Add /retain command to persist settings
rfield
parents:
diff
changeset
|
116 |
); |
c449daa25b45
8157200: jshell tool: Add /retain command to persist settings
rfield
parents:
diff
changeset
|
117 |
} |
c449daa25b45
8157200: jshell tool: Add /retain command to persist settings
rfield
parents:
diff
changeset
|
118 |
|
c449daa25b45
8157200: jshell tool: Add /retain command to persist settings
rfield
parents:
diff
changeset
|
119 |
public void testRetainEditor() { |
c449daa25b45
8157200: jshell tool: Add /retain command to persist settings
rfield
parents:
diff
changeset
|
120 |
test( |
41635
cb3d04878117
8163840: jshell tool: provide way to display configuration settings
rfield
parents:
38539
diff
changeset
|
121 |
(a) -> assertCommand(a, "/set editor -retain nonexistent", |
cb3d04878117
8163840: jshell tool: provide way to display configuration settings
rfield
parents:
38539
diff
changeset
|
122 |
"| Editor set to: nonexistent\n" + |
cb3d04878117
8163840: jshell tool: provide way to display configuration settings
rfield
parents:
38539
diff
changeset
|
123 |
"| Editor setting retained: nonexistent"), |
38531
c449daa25b45
8157200: jshell tool: Add /retain command to persist settings
rfield
parents:
diff
changeset
|
124 |
(a) -> assertCommand(a, "/exit", "") |
c449daa25b45
8157200: jshell tool: Add /retain command to persist settings
rfield
parents:
diff
changeset
|
125 |
); |
c449daa25b45
8157200: jshell tool: Add /retain command to persist settings
rfield
parents:
diff
changeset
|
126 |
test( |
41635
cb3d04878117
8163840: jshell tool: provide way to display configuration settings
rfield
parents:
38539
diff
changeset
|
127 |
(a) -> assertCommand(a, "/set editor", "| /set editor -retain nonexistent"), |
38531
c449daa25b45
8157200: jshell tool: Add /retain command to persist settings
rfield
parents:
diff
changeset
|
128 |
(a) -> assertCommandOutputContains(a, "int h =8", ""), |
c449daa25b45
8157200: jshell tool: Add /retain command to persist settings
rfield
parents:
diff
changeset
|
129 |
(a) -> assertCommandOutputContains(a, "/edit h", "Edit Error:") |
c449daa25b45
8157200: jshell tool: Add /retain command to persist settings
rfield
parents:
diff
changeset
|
130 |
); |
c449daa25b45
8157200: jshell tool: Add /retain command to persist settings
rfield
parents:
diff
changeset
|
131 |
} |
c449daa25b45
8157200: jshell tool: Add /retain command to persist settings
rfield
parents:
diff
changeset
|
132 |
|
c449daa25b45
8157200: jshell tool: Add /retain command to persist settings
rfield
parents:
diff
changeset
|
133 |
public void testRetainEditorBlank() { |
c449daa25b45
8157200: jshell tool: Add /retain command to persist settings
rfield
parents:
diff
changeset
|
134 |
test( |
c449daa25b45
8157200: jshell tool: Add /retain command to persist settings
rfield
parents:
diff
changeset
|
135 |
(a) -> assertCommand(a, "/set editor nonexistent", "| Editor set to: nonexistent"), |
41635
cb3d04878117
8163840: jshell tool: provide way to display configuration settings
rfield
parents:
38539
diff
changeset
|
136 |
(a) -> assertCommand(a, "/set editor -retain", "| Editor setting retained: nonexistent"), |
38531
c449daa25b45
8157200: jshell tool: Add /retain command to persist settings
rfield
parents:
diff
changeset
|
137 |
(a) -> assertCommand(a, "/exit", "") |
c449daa25b45
8157200: jshell tool: Add /retain command to persist settings
rfield
parents:
diff
changeset
|
138 |
); |
c449daa25b45
8157200: jshell tool: Add /retain command to persist settings
rfield
parents:
diff
changeset
|
139 |
test( |
c449daa25b45
8157200: jshell tool: Add /retain command to persist settings
rfield
parents:
diff
changeset
|
140 |
(a) -> assertCommandOutputContains(a, "int h =8", ""), |
c449daa25b45
8157200: jshell tool: Add /retain command to persist settings
rfield
parents:
diff
changeset
|
141 |
(a) -> assertCommandOutputContains(a, "/edit h", "Edit Error:") |
c449daa25b45
8157200: jshell tool: Add /retain command to persist settings
rfield
parents:
diff
changeset
|
142 |
); |
c449daa25b45
8157200: jshell tool: Add /retain command to persist settings
rfield
parents:
diff
changeset
|
143 |
} |
c449daa25b45
8157200: jshell tool: Add /retain command to persist settings
rfield
parents:
diff
changeset
|
144 |
|
c449daa25b45
8157200: jshell tool: Add /retain command to persist settings
rfield
parents:
diff
changeset
|
145 |
public void testRetainModeNeg() { |
c449daa25b45
8157200: jshell tool: Add /retain command to persist settings
rfield
parents:
diff
changeset
|
146 |
test( |
41635
cb3d04878117
8163840: jshell tool: provide way to display configuration settings
rfield
parents:
38539
diff
changeset
|
147 |
(a) -> assertCommandOutputStartsWith(a, "/set mode -retain verbose", |
38539 | 148 |
"| Not valid with a predefined mode"), |
41635
cb3d04878117
8163840: jshell tool: provide way to display configuration settings
rfield
parents:
38539
diff
changeset
|
149 |
(a) -> assertCommandOutputStartsWith(a, "/set mode -retain ????", |
38539 | 150 |
"| Expected a feedback mode name: ????") |
38531
c449daa25b45
8157200: jshell tool: Add /retain command to persist settings
rfield
parents:
diff
changeset
|
151 |
); |
c449daa25b45
8157200: jshell tool: Add /retain command to persist settings
rfield
parents:
diff
changeset
|
152 |
} |
c449daa25b45
8157200: jshell tool: Add /retain command to persist settings
rfield
parents:
diff
changeset
|
153 |
|
c449daa25b45
8157200: jshell tool: Add /retain command to persist settings
rfield
parents:
diff
changeset
|
154 |
public void testRetainFeedbackNeg() { |
c449daa25b45
8157200: jshell tool: Add /retain command to persist settings
rfield
parents:
diff
changeset
|
155 |
test( |
41635
cb3d04878117
8163840: jshell tool: provide way to display configuration settings
rfield
parents:
38539
diff
changeset
|
156 |
(a) -> assertCommandOutputStartsWith(a, "/set feedback -retain babble1", |
38531
c449daa25b45
8157200: jshell tool: Add /retain command to persist settings
rfield
parents:
diff
changeset
|
157 |
"| Does not match any current feedback mode"), |
41635
cb3d04878117
8163840: jshell tool: provide way to display configuration settings
rfield
parents:
38539
diff
changeset
|
158 |
(a) -> assertCommandOutputStartsWith(a, "/set mode trfn", |
cb3d04878117
8163840: jshell tool: provide way to display configuration settings
rfield
parents:
38539
diff
changeset
|
159 |
"| To create a new mode either the -command or the -quiet option must be used -- \n" + |
cb3d04878117
8163840: jshell tool: provide way to display configuration settings
rfield
parents:
38539
diff
changeset
|
160 |
"| Does not match any current feedback mode: trfn -- /set mode trfn"), |
cb3d04878117
8163840: jshell tool: provide way to display configuration settings
rfield
parents:
38539
diff
changeset
|
161 |
(a) -> assertCommand(a, "/set mode trfn -command", |
38531
c449daa25b45
8157200: jshell tool: Add /retain command to persist settings
rfield
parents:
diff
changeset
|
162 |
"| Created new feedback mode: trfn"), |
41635
cb3d04878117
8163840: jshell tool: provide way to display configuration settings
rfield
parents:
38539
diff
changeset
|
163 |
(a) -> assertCommandOutputContains(a, "/set feedback -retain trfn", |
38531
c449daa25b45
8157200: jshell tool: Add /retain command to persist settings
rfield
parents:
diff
changeset
|
164 |
"is predefined or has been retained"), |
41635
cb3d04878117
8163840: jshell tool: provide way to display configuration settings
rfield
parents:
38539
diff
changeset
|
165 |
(a) -> assertCommandOutputStartsWith(a, "/set feedback -retain !!!!", |
38539 | 166 |
"| Expected a feedback mode name: !!!!") |
38531
c449daa25b45
8157200: jshell tool: Add /retain command to persist settings
rfield
parents:
diff
changeset
|
167 |
); |
c449daa25b45
8157200: jshell tool: Add /retain command to persist settings
rfield
parents:
diff
changeset
|
168 |
} |
c449daa25b45
8157200: jshell tool: Add /retain command to persist settings
rfield
parents:
diff
changeset
|
169 |
|
c449daa25b45
8157200: jshell tool: Add /retain command to persist settings
rfield
parents:
diff
changeset
|
170 |
public void testNoRetainMode() { |
c449daa25b45
8157200: jshell tool: Add /retain command to persist settings
rfield
parents:
diff
changeset
|
171 |
test( |
38539 | 172 |
(a) -> assertCommand(a, "/set mode trm -quiet", "| Created new feedback mode: trm"), |
38531
c449daa25b45
8157200: jshell tool: Add /retain command to persist settings
rfield
parents:
diff
changeset
|
173 |
(a) -> assertCommand(a, "/set feedback trm", ""), |
c449daa25b45
8157200: jshell tool: Add /retain command to persist settings
rfield
parents:
diff
changeset
|
174 |
(a) -> assertCommand(a, "/set format trm display '{name}:{value}'", ""), |
c449daa25b45
8157200: jshell tool: Add /retain command to persist settings
rfield
parents:
diff
changeset
|
175 |
(a) -> assertCommand(a, "int x = 45", "x:45"), |
c449daa25b45
8157200: jshell tool: Add /retain command to persist settings
rfield
parents:
diff
changeset
|
176 |
(a) -> assertCommand(a, "/exit", "") |
c449daa25b45
8157200: jshell tool: Add /retain command to persist settings
rfield
parents:
diff
changeset
|
177 |
); |
c449daa25b45
8157200: jshell tool: Add /retain command to persist settings
rfield
parents:
diff
changeset
|
178 |
test( |
c449daa25b45
8157200: jshell tool: Add /retain command to persist settings
rfield
parents:
diff
changeset
|
179 |
(a) -> assertCommandOutputStartsWith(a, "/set feedback trm", |
c449daa25b45
8157200: jshell tool: Add /retain command to persist settings
rfield
parents:
diff
changeset
|
180 |
"| Does not match any current feedback mode"), |
c449daa25b45
8157200: jshell tool: Add /retain command to persist settings
rfield
parents:
diff
changeset
|
181 |
(a) -> assertCommandOutputContains(a, "int x = 45", "==> 45") |
c449daa25b45
8157200: jshell tool: Add /retain command to persist settings
rfield
parents:
diff
changeset
|
182 |
); |
c449daa25b45
8157200: jshell tool: Add /retain command to persist settings
rfield
parents:
diff
changeset
|
183 |
} |
c449daa25b45
8157200: jshell tool: Add /retain command to persist settings
rfield
parents:
diff
changeset
|
184 |
|
c449daa25b45
8157200: jshell tool: Add /retain command to persist settings
rfield
parents:
diff
changeset
|
185 |
public void testNoRetainFeedback() { |
c449daa25b45
8157200: jshell tool: Add /retain command to persist settings
rfield
parents:
diff
changeset
|
186 |
test( |
c449daa25b45
8157200: jshell tool: Add /retain command to persist settings
rfield
parents:
diff
changeset
|
187 |
(a) -> assertCommand(a, "/set feedback verbose", "| Feedback mode: verbose"), |
c449daa25b45
8157200: jshell tool: Add /retain command to persist settings
rfield
parents:
diff
changeset
|
188 |
(a) -> assertCommand(a, "/exit", "") |
c449daa25b45
8157200: jshell tool: Add /retain command to persist settings
rfield
parents:
diff
changeset
|
189 |
); |
c449daa25b45
8157200: jshell tool: Add /retain command to persist settings
rfield
parents:
diff
changeset
|
190 |
test( |
c449daa25b45
8157200: jshell tool: Add /retain command to persist settings
rfield
parents:
diff
changeset
|
191 |
(a) -> assertCommand(a, "int h =8", "h ==> 8") |
c449daa25b45
8157200: jshell tool: Add /retain command to persist settings
rfield
parents:
diff
changeset
|
192 |
); |
c449daa25b45
8157200: jshell tool: Add /retain command to persist settings
rfield
parents:
diff
changeset
|
193 |
} |
c449daa25b45
8157200: jshell tool: Add /retain command to persist settings
rfield
parents:
diff
changeset
|
194 |
|
c449daa25b45
8157200: jshell tool: Add /retain command to persist settings
rfield
parents:
diff
changeset
|
195 |
} |