langtools/test/jdk/jshell/ToolReloadTest.java
changeset 35812 6a6ca0bd3c14
parent 35359 f04501964016
child 36154 63cd939d7e20
--- a/langtools/test/jdk/jshell/ToolReloadTest.java	Thu Feb 11 16:06:11 2016 -0800
+++ b/langtools/test/jdk/jshell/ToolReloadTest.java	Fri Feb 12 10:51:36 2016 -0800
@@ -23,7 +23,7 @@
 
 /*
  * @test
- * @bug 8081845
+ * @bug 8081845 8147898
  * @summary Tests for /reload in JShell tool
  * @modules jdk.compiler/com.sun.tools.javac.api
  *          jdk.compiler/com.sun.tools.javac.main
@@ -110,6 +110,23 @@
         );
     }
 
+    public void testReloadQuiet() {
+        test(false, new String[]{"-nostartup"},
+                a -> assertVariable(a, "int", "a"),
+                a -> dropVariable(a, "/dr 1", "int a = 0"),
+                a -> assertMethod(a, "int b() { return 0; }", "()I", "b"),
+                a -> dropMethod(a, "/drop b", "b ()I"),
+                a -> assertClass(a, "class A {}", "class", "A"),
+                a -> dropClass(a, "/dr A", "class A"),
+                a -> assertCommand(a, "/reload quiet",
+                        "|  Restarting and restoring state.\n"),
+                a -> assertCommandCheckOutput(a, "/vars", assertVariables()),
+                a -> assertCommandCheckOutput(a, "/methods", assertMethods()),
+                a -> assertCommandCheckOutput(a, "/classes", assertClasses()),
+                a -> assertCommandCheckOutput(a, "/imports", assertImports())
+        );
+    }
+
     public void testReloadRepeat() {
         test(false, new String[]{"-nostartup"},
                 (a) -> assertVariable(a, "int", "c", "7", "7"),