langtools/test/jdk/jshell/ToolBasicTest.java
changeset 37007 6023a9a9d58a
parent 36990 ec0b843a7af5
child 37389 9c137b83a8b8
--- a/langtools/test/jdk/jshell/ToolBasicTest.java	Fri Apr 08 13:26:38 2016 -0700
+++ b/langtools/test/jdk/jshell/ToolBasicTest.java	Sat Apr 09 11:03:48 2016 -0700
@@ -62,34 +62,6 @@
 @Test
 public class ToolBasicTest extends ReplToolTesting {
 
-    public void defineVar() {
-        test(
-                (a) -> assertCommand(a, "int x = 72", "|  Added variable x of type int with initial value 72\n"),
-                (a) -> assertCommand(a, "x", "|  Variable x of type int has value 72\n"),
-                (a) -> assertCommand(a, "/vars", "|    int x = 72\n")
-        );
-    }
-
-    public void defineUnresolvedVar() {
-        test(
-                (a) -> assertCommand(a, "undefined x",
-                        "|  Added variable x, however, it cannot be referenced until class undefined is declared\n"),
-                (a) -> assertCommand(a, "/vars", "|    undefined x = (not-active)\n")
-        );
-    }
-
-    public void testUnresolved() {
-        test(
-                (a) -> assertCommand(a, "int f() { return g() + x + new A().a; }",
-                        "|  Added method f(), however, it cannot be invoked until method g(), variable x, and class A are declared\n"),
-                (a) -> assertCommand(a, "f()",
-                        "|  Attempted to call f which cannot be invoked until method g(), variable x, and class A are declared\n"),
-                (a) -> assertCommand(a, "int g() { return x; }",
-                        "|  Added method g(), however, it cannot be invoked until variable x is declared\n"),
-                (a) -> assertCommand(a, "g()", "|  Attempted to call g which cannot be invoked until variable x is declared\n")
-        );
-    }
-
     public void elideStartUpFromList() {
         test(
                 (a) -> assertCommandOutputContains(a, "123", "type int"),
@@ -297,47 +269,6 @@
         );
     }
 
-    public void testDebug() {
-        test(
-                (a) -> assertCommand(a, "/deb", "|  Debugging on\n"),
-                (a) -> assertCommand(a, "/debug", "|  Debugging off\n"),
-                (a) -> assertCommand(a, "/debug", "|  Debugging on\n"),
-                (a) -> assertCommand(a, "/deb", "|  Debugging off\n")
-        );
-    }
-
-    public void testHelpLength() {
-        Consumer<String> testOutput = (s) -> {
-            List<String> ss = Stream.of(s.split("\n"))
-                    .filter(l -> !l.isEmpty())
-                    .collect(Collectors.toList());
-            assertTrue(ss.size() >= 10, "Help does not print enough lines:\n" + s);
-        };
-        test(
-                (a) -> assertCommandCheckOutput(a, "/?", testOutput),
-                (a) -> assertCommandCheckOutput(a, "/help", testOutput),
-                (a) -> assertCommandCheckOutput(a, "/help /list", testOutput)
-        );
-    }
-
-    public void testHelp() {
-        test(
-                (a) -> assertHelp(a, "/?", "/list", "/help", "/exit", "intro"),
-                (a) -> assertHelp(a, "/help", "/list", "/help", "/exit", "intro"),
-                (a) -> assertHelp(a, "/help short", "shortcuts", "<tab>"),
-                (a) -> assertHelp(a, "/? /li", "/list all", "snippets"),
-                (a) -> assertHelp(a, "/help /help", "/help <command>")
-        );
-    }
-
-    private void assertHelp(boolean a, String command, String... find) {
-        assertCommandCheckOutput(a, command, s -> {
-            for (String f : find) {
-                assertTrue(s.contains(f), "Expected output of " + command + " to contain: " + f);
-            }
-        });
-    }
-
     public void oneLineOfError() {
         test(
                 (a) -> assertCommand(a, "12+", null),
@@ -678,39 +609,6 @@
         );
     }
 
-    // Check that each line of output contains the corresponding string from the list
-    private void checkLineToList(String in, List<String> match) {
-        String[] res = in.trim().split("\n");
-        assertEquals(res.length, match.size(), "Got: " + Arrays.asList(res));
-        for (int i = 0; i < match.size(); ++i) {
-            assertTrue(res[i].contains(match.get(i)));
-        }
-    }
-
-    public void testListArgs() {
-        String arg = "qqqq";
-        List<String> startVarList = new ArrayList<>(START_UP);
-        startVarList.add("int aardvark");
-        test(
-                a -> assertCommandCheckOutput(a, "/list all",
-                        s -> checkLineToList(s, START_UP)),
-                a -> assertCommandCheckOutput(a, "/list " + arg,
-                        s -> assertEquals(s, "|  No definition or id named " + arg +
-                                " found.  There are no active definitions.\n")),
-                a -> assertVariable(a, "int", "aardvark"),
-                a -> assertCommandOutputContains(a, "/list aardvark", "aardvark"),
-                a -> assertCommandCheckOutput(a, "/list start",
-                        s -> checkLineToList(s, START_UP)),
-                a -> assertCommandCheckOutput(a, "/list all",
-                        s -> checkLineToList(s, startVarList)),
-                a -> assertCommandCheckOutput(a, "/list printf",
-                        s -> assertTrue(s.contains("void printf"))),
-                a -> assertCommandCheckOutput(a, "/list " + arg,
-                        s -> assertEquals(s, "|  No definition or id named " + arg +
-                                " found.  Try /list without arguments.\n"))
-        );
-    }
-
     public void testFeedbackNegative() {
         test(a -> assertCommandCheckOutput(a, "/set feedback aaaa",
                 assertStartsWith("|  Does not match any current feedback mode")));