8209604: [TEST] rewrite com/sun/jdi shell tests to java version - step2
authoramenkov
Thu, 30 Aug 2018 11:53:49 -0700
changeset 51596 b8eea2a7569a
parent 51595 02572bed95b6
child 51597 4c78f4fd8370
8209604: [TEST] rewrite com/sun/jdi shell tests to java version - step2 Reviewed-by: jcbeyler, sspitsyn, cjplummer
test/jdk/com/sun/jdi/ArrayLengthDumpTest.java
test/jdk/com/sun/jdi/BreakpointWithFullGC.java
test/jdk/com/sun/jdi/CatchAllTest.java
test/jdk/com/sun/jdi/CatchAllTest.sh
test/jdk/com/sun/jdi/CatchCaughtTest.java
test/jdk/com/sun/jdi/CatchCaughtTest.sh
test/jdk/com/sun/jdi/CommandCommentDelimiter.java
test/jdk/com/sun/jdi/CommandCommentDelimiter.sh
test/jdk/com/sun/jdi/DeoptimizeWalk.java
test/jdk/com/sun/jdi/DeoptimizeWalk.sh
test/jdk/com/sun/jdi/EvalArgs.java
test/jdk/com/sun/jdi/EvalArgs.sh
test/jdk/com/sun/jdi/EvalArraysAsList.java
test/jdk/com/sun/jdi/EvalArraysAsList.sh
test/jdk/com/sun/jdi/EvalInterfaceStatic.java
test/jdk/com/sun/jdi/EvalInterfaceStatic.sh
test/jdk/com/sun/jdi/GetLocalVariables3Test.java
test/jdk/com/sun/jdi/GetLocalVariables3Test.sh
test/jdk/com/sun/jdi/JdbExprTest.java
test/jdk/com/sun/jdi/JdbMethodExitTest.java
test/jdk/com/sun/jdi/lib/jdb/Jdb.java
test/jdk/com/sun/jdi/lib/jdb/JdbCommand.java
test/jdk/com/sun/jdi/lib/jdb/JdbTest.java
--- a/test/jdk/com/sun/jdi/ArrayLengthDumpTest.java	Thu Aug 30 03:01:49 2018 -0700
+++ b/test/jdk/com/sun/jdi/ArrayLengthDumpTest.java	Thu Aug 30 11:53:49 2018 -0700
@@ -90,7 +90,7 @@
 
     @Override
     protected void runCases() {
-        setBreakpoints(System.getProperty("test.src") + "/ArrayLengthDumpTest.java", 1);
+        setBreakpointsFromTestSource("ArrayLengthDumpTest.java", 1);
 
         // Run to breakpoint #1
         jdb.command(JdbCommand.run());
--- a/test/jdk/com/sun/jdi/BreakpointWithFullGC.java	Thu Aug 30 03:01:49 2018 -0700
+++ b/test/jdk/com/sun/jdi/BreakpointWithFullGC.java	Thu Aug 30 11:53:49 2018 -0700
@@ -77,7 +77,7 @@
 
     @Override
     protected void runCases() {
-        setBreakpoints(System.getProperty("test.src") + "/BreakpointWithFullGC.java", 1);
+        setBreakpointsFromTestSource("BreakpointWithFullGC.java", 1);
 
         // get to the first loop breakpoint
         jdb.command(JdbCommand.run());
@@ -90,14 +90,14 @@
 
         jdb.contToExit(1);
 
-        new OutputAnalyzer(jdb.getJdbOutput())
+        new OutputAnalyzer(getJdbOutput())
                 // make sure we hit the first breakpoint at least once
                 .stdoutShouldMatch("System\\..*top of loop")
                 // make sure we hit the second breakpoint at least once
                 .stdoutShouldMatch("System\\..*bottom of loop")
                 // make sure we hit the last breakpoint
                 .stdoutShouldMatch("System\\..*end of test");
-        new OutputAnalyzer(jdb.getDebuggeeOutput())
+        new OutputAnalyzer(getDebuggeeOutput())
                 // check for error message due to thread ID change
                 .stderrShouldNotContain("Exception in thread \"event-handler\" java.lang.NullPointerException");
     }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/com/sun/jdi/CatchAllTest.java	Thu Aug 30 11:53:49 2018 -0700
@@ -0,0 +1,86 @@
+/*
+ * Copyright (c) 2002, 2018, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 4749692
+ * @summary REGRESSION: jdb rejects the syntax catch java.lang.IndexOutOfBoundsException
+ * @comment converted from test/jdk/com/sun/jdi/CatchAllTest.sh
+ *
+ * @library /test/lib
+ * @build CatchAllTest
+ * @run main/othervm CatchAllTest
+ */
+
+import jdk.test.lib.process.OutputAnalyzer;
+import lib.jdb.JdbCommand;
+import lib.jdb.JdbTest;
+
+class CatchAllTestTarg {
+    public void bar() {
+        System.out.println("bar");        // @1 breakpoint
+    }
+
+    public static void main(String[] args) {
+        CatchAllTestTarg my = new CatchAllTestTarg();
+        my.bar();
+    }
+}
+
+public class CatchAllTest extends JdbTest {
+    public static void main(String argv[]) {
+        new CatchAllTest().run();
+    }
+
+    private CatchAllTest() {
+        super(DEBUGGEE_CLASS);
+    }
+
+    private static final String DEBUGGEE_CLASS = CatchAllTestTarg.class.getName();
+
+    @Override
+    protected void runCases() {
+        setBreakpointsFromTestSource("CatchAllTest.java", 1);
+        // Run to breakpoint #1
+        jdb.command(JdbCommand.run());
+
+        final String IOOB = "java.lang.IndexOutOfBoundsException";
+        jdb.command(JdbCommand.catch_(IOOB));
+        jdb.command(JdbCommand.catch_(""));
+        jdb.command(JdbCommand.ignore(""));
+        jdb.command(JdbCommand.ignore(IOOB));
+        jdb.command(JdbCommand.catch_(JdbCommand.ExType.all, IOOB));
+        jdb.command(JdbCommand.ignore(JdbCommand.ExType.all, IOOB));
+        jdb.command(JdbCommand.catch_(JdbCommand.ExType.caught, IOOB));
+        jdb.command(JdbCommand.ignore(JdbCommand.ExType.caught, IOOB));
+        jdb.command(JdbCommand.catch_(JdbCommand.ExType.uncaught, IOOB));
+        jdb.command(JdbCommand.ignore(JdbCommand.ExType.uncaught, IOOB));
+
+        jdb.contToExit(1);
+
+        new OutputAnalyzer(getJdbOutput())
+                .shouldNotContain("Usage: catch")
+                .shouldNotContain("Usage: ignore");
+    }
+
+}
--- a/test/jdk/com/sun/jdi/CatchAllTest.sh	Thu Aug 30 03:01:49 2018 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,95 +0,0 @@
-#!/bin/sh
-
-#
-# Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved.
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# This code is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License version 2 only, as
-# published by the Free Software Foundation.
-#
-# This code is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-# version 2 for more details (a copy is included in the LICENSE file that
-# accompanied this code).
-#
-# You should have received a copy of the GNU General Public License version
-# 2 along with this work; if not, write to the Free Software Foundation,
-# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-# or visit www.oracle.com if you need additional information or have any
-# questions.
-#
-
-#
-#  @test
-#  @bug 4749692
-#  @summary REGRESSION: jdb rejects the syntax catch java.lang.IndexOutOfBoundsException
-#  @author Tim Bell
-#
-#  @key intermittent
-#  @run shell CatchAllTest.sh
-#
-classname=CatchAllTestTarg
-
-createJavaFile()
-{
-    cat <<EOF > $classname.java.1
-class $classname {
-    public void bar() {
-        System.out.println("bar");        // @1 breakpoint
-    }
-
-    public static void main(String[] args) {
-        CatchAllTestTarg my = new CatchAllTestTarg();
-        my.bar();
-    }
-}
-EOF
-}
-
-# This is called to feed cmds to jdb.
-dojdbCmds()
-{
-   setBkpts @1
-   runToBkpt @1
-   cmd catch           java.lang.IndexOutOfBoundsException
-   cmd catch
-   cmd ignore
-   cmd ignore          java.lang.IndexOutOfBoundsException
-   cmd catch  all      java.lang.IndexOutOfBoundsException
-   cmd ignore all      java.lang.IndexOutOfBoundsException
-   cmd catch  caught   java.lang.IndexOutOfBoundsException
-   cmd ignore caught   java.lang.IndexOutOfBoundsException
-   cmd catch  uncaught java.lang.IndexOutOfBoundsException
-   cmd ignore uncaught java.lang.IndexOutOfBoundsException
-   cmd allowExit cont
-}
-
-mysetup()
-{
-    if [ -z "$TESTSRC" ] ; then
-        TESTSRC=.
-    fi
-
-    for ii in . $TESTSRC $TESTSRC/.. ; do
-        if [ -r "$ii/ShellScaffold.sh" ] ; then
-            . $ii/ShellScaffold.sh
-            break
-        fi
-    done
-}
-
-
-# You could replace this next line with the contents
-# of ShellScaffold.sh and this script will run just the same.
-mysetup
-
-runit
-#
-jdbFailIfPresent "Usage: catch"
-jdbFailIfPresent "Usage: ignore"
-#
-pass
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/com/sun/jdi/CatchCaughtTest.java	Thu Aug 30 11:53:49 2018 -0700
@@ -0,0 +1,76 @@
+/*
+ * Copyright (c) 2002, 2018, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 4788864
+ * @summary TTY: 'catch caught' with no class pattern throws NullPointerException
+ * @comment converted from test/jdk/com/sun/jdi/CatchCaughtTest.sh
+ *
+ * @library /test/lib
+ * @build CatchCaughtTest
+ * @run main/othervm CatchCaughtTest
+ */
+
+import jdk.test.lib.process.OutputAnalyzer;
+import lib.jdb.JdbCommand;
+import lib.jdb.JdbTest;
+
+class CatchCaughtTestTarg {
+    public void bar() {
+        System.out.println("bar");        // @1 breakpoint
+    }
+
+    public static void main(String[] args) {
+        CatchCaughtTestTarg my = new CatchCaughtTestTarg();
+        my.bar();
+    }
+}
+
+public class CatchCaughtTest extends JdbTest {
+    public static void main(String argv[]) {
+        new CatchCaughtTest().run();
+    }
+
+    private CatchCaughtTest() {
+        super(DEBUGGEE_CLASS);
+    }
+
+    private static final String DEBUGGEE_CLASS = CatchCaughtTestTarg.class.getName();
+
+    @Override
+    protected void runCases() {
+        setBreakpointsFromTestSource("CatchCaughtTest.java", 1);
+        // Run to breakpoint #1
+        jdb.command(JdbCommand.run());
+
+        jdb.command(JdbCommand.catch_(JdbCommand.ExType.caught, ""));
+
+        jdb.contToExit(1);
+
+        new OutputAnalyzer(getJdbOutput())
+                .shouldNotContain("Internal exception")
+                .shouldContain("Usage: catch");
+    }
+
+}
--- a/test/jdk/com/sun/jdi/CatchCaughtTest.sh	Thu Aug 30 03:01:49 2018 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,86 +0,0 @@
-#!/bin/sh
-
-#
-# Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved.
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# This code is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License version 2 only, as
-# published by the Free Software Foundation.
-#
-# This code is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-# version 2 for more details (a copy is included in the LICENSE file that
-# accompanied this code).
-#
-# You should have received a copy of the GNU General Public License version
-# 2 along with this work; if not, write to the Free Software Foundation,
-# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-# or visit www.oracle.com if you need additional information or have any
-# questions.
-#
-
-#
-#  @test
-#  @bug 4788864
-#  @summary TTY: 'catch caught' with no class pattern throws NullPointerException
-#  @author Tim Bell
-#
-#  @key intermittent
-#  @run shell CatchCaughtTest.sh
-#
-classname=CatchCaughtTestTarg
-
-createJavaFile()
-{
-    cat <<EOF > $classname.java.1
-class $classname {
-    public void bar() {
-        System.out.println("bar");        // @1 breakpoint
-    }
-
-    public static void main(String[] args) {
-        CatchCaughtTestTarg my = new CatchCaughtTestTarg();
-        my.bar();
-    }
-}
-EOF
-}
-
-# This is called to feed cmds to jdb.
-dojdbCmds()
-{
-   setBkpts @1
-   runToBkpt @1
-   cmd catch caught
-   cmd allowExit cont
-}
-
-mysetup()
-{
-    if [ -z "$TESTSRC" ] ; then
-        TESTSRC=.
-    fi
-
-    for ii in . $TESTSRC $TESTSRC/.. ; do
-        if [ -r "$ii/ShellScaffold.sh" ] ; then
-            . $ii/ShellScaffold.sh
-            break
-        fi
-    done
-}
-
-
-# You could replace this next line with the contents
-# of ShellScaffold.sh and this script will run just the same.
-mysetup
-
-runit
-#
-jdbFailIfPresent "Internal exception"
-jdbFailIfNotPresent "Usage: catch"
-#
-pass
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/com/sun/jdi/CommandCommentDelimiter.java	Thu Aug 30 11:53:49 2018 -0700
@@ -0,0 +1,79 @@
+/*
+ * Copyright (c) 2004, 2018, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 4507088
+ * @summary TTY: Add a comment delimiter to the jdb command set
+ * @comment converted from test/jdk/com/sun/jdi/CommandCommentDelimiter.sh
+ *
+ * @library /test/lib
+ * @build CommandCommentDelimiter
+ * @run main/othervm CommandCommentDelimiter
+ */
+
+import jdk.test.lib.process.OutputAnalyzer;
+import lib.jdb.JdbCommand;
+import lib.jdb.JdbTest;
+
+class CommandCommentDelimiterTarg {
+    public static void main(String args[]) {
+        System.out.print  ("Hello");
+        System.out.print  (", ");
+        System.out.print  ("world");
+        System.out.println("!");
+    }
+}
+
+
+public class CommandCommentDelimiter extends JdbTest {
+    public static void main(String argv[]) {
+        new CommandCommentDelimiter().run();
+    }
+
+    private CommandCommentDelimiter() {
+        super(DEBUGGEE_CLASS);
+    }
+
+    private static final String DEBUGGEE_CLASS = CommandCommentDelimiterTarg.class.getName();
+
+    @Override
+    protected void runCases() {
+        jdb.command(JdbCommand.stopIn(DEBUGGEE_CLASS, "main"));
+        jdb.command(JdbCommand.run());
+
+        jdb.command(JdbCommand.step());
+        jdb.command("#");
+        jdb.command("#foo");
+        jdb.command("3 #blah");
+        jdb.command("# connectors");
+        jdb.command(JdbCommand.step());
+
+        jdb.contToExit(1);
+
+        new OutputAnalyzer(getJdbOutput())
+                .shouldNotContain("Unrecognized command: '#'.  Try help...")
+                .shouldNotContain("Available connectors are");
+    }
+
+}
--- a/test/jdk/com/sun/jdi/CommandCommentDelimiter.sh	Thu Aug 30 03:01:49 2018 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,86 +0,0 @@
-#!/bin/sh
-
-#
-# Copyright (c) 2004, 2014, Oracle and/or its affiliates. All rights reserved.
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# This code is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License version 2 only, as
-# published by the Free Software Foundation.
-#
-# This code is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-# version 2 for more details (a copy is included in the LICENSE file that
-# accompanied this code).
-#
-# You should have received a copy of the GNU General Public License version
-# 2 along with this work; if not, write to the Free Software Foundation,
-# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-# or visit www.oracle.com if you need additional information or have any
-# questions.
-#
-
-#
-#  @test
-#  @bug 4507088
-#  @summary TTY: Add a comment delimiter to the jdb command set
-#  @author Tim Bell
-#  @key intermittent
-#  @run shell CommandCommentDelimiter.sh
-#
-
-createJavaFile()
-{
-    cat <<EOF > $classname.java.1
-public class $classname {
-    public static void main(String args[]) {
-        System.out.print  ("Hello");
-        System.out.print  (", ");
-        System.out.print  ("world");
-        System.out.println("!");
-    }
-}
-
-EOF
-}
-
-# This is called to feed cmds to jdb.
-dojdbCmds()
-{
-   #set -x
-   cmd stop in $classname.main
-   runToBkpt
-   cmd step
-   cmd \#
-   cmd \#foo
-   cmd 3 \#blah
-   cmd \# connectors
-   cmd step
-   cmd allowExit cont
-}
-
-mysetup()
-{
-    if [ -z "$TESTSRC" ] ; then
-        TESTSRC=.
-    fi
-
-    for ii in . $TESTSRC $TESTSRC/.. ; do
-        if [ -r "$ii/ShellScaffold.sh" ] ; then
-            . $ii/ShellScaffold.sh
-            break
-        fi
-    done
-}
-
-# You could replace this next line with the contents
-# of ShellScaffold.sh and this script will run just the same.
-mysetup
-
-runit
-jdbFailIfPresent "Unrecognized command: '#'.  Try help..." 50
-jdbFailIfPresent "Available connectors are" 50
-pass
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/com/sun/jdi/DeoptimizeWalk.java	Thu Aug 30 11:53:49 2018 -0700
@@ -0,0 +1,110 @@
+/*
+ * Copyright (c) 2002, 2018, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 4525714
+ * @summary jtreg test PopAsynchronousTest fails in build 85 with -Xcomp
+ * @comment converted from test/jdk/com/sun/jdi/DeoptimizeWalk.sh
+ *
+ * @library /test/lib
+ * @compile -g DeoptimizeWalk.java
+ * @run main/othervm DeoptimizeWalk
+ */
+
+import jdk.test.lib.process.OutputAnalyzer;
+import lib.jdb.Jdb;
+import lib.jdb.JdbCommand;
+import lib.jdb.JdbTest;
+
+/*
+ * The bug (JDK-4525714) is about failing PopAsynchronousTest test.
+ * This is another test of the same issue. The bug occurs when trying
+ * to walk the stack of a deoptimized thread. We can do this
+ * by running in -Xcomp mode and by doing a step which causes deopt,
+ * and then a 'where'. This will cause not all the frames to be shown.
+ */
+
+class DeoptimizeWalkTarg {
+    static public void main(String[] args) {
+        DeoptimizeWalkTarg mine = new DeoptimizeWalkTarg();
+        mine.a1(89);
+    }
+
+    public void a1(int p1) {
+        int v1 = 89;
+        System.out.println("a1" + v1);
+        a2(89);
+    }
+
+    public void a2(int pp) {
+        int v2 = 89;
+        System.out.println("a2" + v2);
+        a3(89);
+    }
+
+    public void a3(int pp) {
+        int v3 = 89;
+        System.out.println("a3");  //@ 1 breakpoint
+        a4(22);                  // it passes if this line is commented out
+        System.out.println("jj");
+    }
+
+    public void a4(int pp) {
+        int v4 = 90;
+        System.out.println("a4: @1 breakpoint here");
+    }
+}
+
+
+public class DeoptimizeWalk extends JdbTest {
+    public static void main(String argv[]) {
+        new DeoptimizeWalk().run();
+    }
+
+    private DeoptimizeWalk() {
+        super(new Jdb.LaunchOptions(DEBUGGEE_CLASS)
+                .addDebuggeeOptions(DEBUGGEE_OPTIONS));
+    }
+
+    private static final String DEBUGGEE_CLASS = DeoptimizeWalkTarg.class.getName();
+    private static final String[] DEBUGGEE_OPTIONS = {"-Xcomp"};
+
+    @Override
+    protected void runCases() {
+        setBreakpointsFromTestSource("DeoptimizeWalk.java", 1);
+        jdb.command(JdbCommand.run());
+
+        jdb.command(JdbCommand.where(""));
+        jdb.command(JdbCommand.step());
+        jdb.command(JdbCommand.where(""));
+
+        jdb.contToExit(1);
+
+        new OutputAnalyzer(getJdbOutput())
+                .shouldContain(DEBUGGEE_CLASS + ".main");
+        new OutputAnalyzer(getDebuggeeOutput())
+                .shouldNotContain("Internal exception:");
+    }
+}
+
--- a/test/jdk/com/sun/jdi/DeoptimizeWalk.sh	Thu Aug 30 03:01:49 2018 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,112 +0,0 @@
-#!/bin/sh
-
-#
-# Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved.
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# This code is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License version 2 only, as
-# published by the Free Software Foundation.
-#
-# This code is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-# version 2 for more details (a copy is included in the LICENSE file that
-# accompanied this code).
-#
-# You should have received a copy of the GNU General Public License version
-# 2 along with this work; if not, write to the Free Software Foundation,
-# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-# or visit www.oracle.com if you need additional information or have any
-# questions.
-#
-
-#  @test
-#  @bug 4525714
-#  @summary jtreg test PopAsynchronousTest fails in build 85 with -Xcomp
-#  @author Jim Holmlund/Swamy Venkataramanappa
-#  @key intermittent
-#  @run shell DeoptimizeWalk.sh
-
-#  This is another test of the same bug.  The bug occurs when trying
-#  to walk the stack of a deoptimized thread.  We can do this
-#  by running in -Xcomp mode and by doing a step which causes deopt,
-#  and then a 'where'.  This will cause not all the frames to be shown.
-
-compileOptions=-g
-
-echo "*********** This test only fails with -Xcomp ***************"
-createJavaFile()
-{
-    cat <<EOF > $1.java.1
-
-public class $1 {
-    static public void main(String[] args) {
-       $1 mine = new $1();
-       mine.a1(89);
-    }
-
-    public void a1(int p1) {
-      int v1 = 89;
-      System.out.println("a1" + v1);
-      a2(89);
-    }
-
-
-    public void a2(int pp) {
-      int v2 = 89;
-      System.out.println("a2" + v2);
-      a3(89);
-    }
-
-    public void a3(int pp) {
-      int v3 = 89;
-      System.out.println("a3");  //@ 1 breakpoint
-      a4(22);                  // it passes if this line is commented out
-      System.out.println("jj");
-    }
-
-    public void a4(int pp) {
-      int v4 = 90;
-      System.out.println("a4: @1 breakpoint here");
-    }
-}
-EOF
-}
-
-# This is called to feed cmds to jdb.
-dojdbCmds()
-{
-    setBkpts @1
-    runToBkpt @1
-    cmd where
-    #cmd next
-    cmd step
-    cmd where
-}
-
-
-mysetup()
-{
-    if [ -z "$TESTSRC" ] ; then
-        TESTSRC=.
-    fi
-
-    for ii in . $TESTSRC $TESTSRC/.. ; do
-        if [ -r "$ii/ShellScaffold.sh" ] ; then
-            . $ii/ShellScaffold.sh
-            break
-        fi
-    done
-}
-
-# You could replace this next line with the contents
-# of ShellScaffold.sh and this script will run just the same.
-mysetup
-
-runit
-jdbFailIfNotPresent "shtest\.main" 3
-debuggeeFailIfPresent "Internal exception:"
-pass
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/com/sun/jdi/EvalArgs.java	Thu Aug 30 11:53:49 2018 -0700
@@ -0,0 +1,290 @@
+/*
+ * Copyright (c) 2002, 2018, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 4663146
+ * @summary Arguments match no method error
+ * @comment converted from test/jdk/com/sun/jdi/EvalArgs.sh
+ *
+ * @library /test/lib
+ * @build EvalArgs
+ * @run main/othervm EvalArgs
+ */
+
+import lib.jdb.JdbCommand;
+import lib.jdb.JdbTest;
+
+/*
+ * The bug is that, for example, if a String is passed
+ * as an arg to a func where an Object is expected,
+ * "Arguments match no method" error occurs. jdb doesn't notice that this is
+ * legal because String is an instance of Object.
+ */
+
+class EvalArgsTarg {
+
+    static jj1 myjj1;
+    static jj2 myjj2;
+    static oranges myoranges;
+    static boolean jjboolean = true;
+    static byte    jjbyte = 1;
+    static char    jjchar = 'a';
+    static double  jjdouble = 2.2;
+    static float   jjfloat = 3.1f;
+    static int     jjint = 4;
+    static long    jjlong = 5;
+    static short   jjshort = 6;
+    static int[]   jjintArray = {7, 8};
+    static float[] jjfloatArray = {9.1f, 10.2f};
+
+
+    public static void main(String args[]) {
+        myjj1 = new jj1();
+        myjj2 = new jj2();
+        myoranges = new oranges();
+
+        // prove that these work
+        System.out.println( ffjj1(myjj1));
+        System.out.println( ffjj1(myjj2));
+
+        System.out.println("EvalArgsTarg.ffoverload(EvalArgsTarg.jjboolean) = " +
+                            EvalArgsTarg.ffoverload(EvalArgsTarg.jjboolean));
+        System.out.println("EvalArgsTarg.ffoverload(EvalArgsTarg.jjbyte) = " +
+                            EvalArgsTarg.ffoverload(EvalArgsTarg.jjbyte));
+        System.out.println("EvalArgsTarg.ffoverload(EvalArgsTarg.jjchar) = " +
+                            EvalArgsTarg.ffoverload(EvalArgsTarg.jjchar));
+        System.out.println("EvalArgsTarg.ffoverload(EvalArgsTarg.jjdouble) = " +
+                            EvalArgsTarg.ffoverload(EvalArgsTarg.jjdouble));
+
+        //This doesn't even compile
+        //System.out.println( "ffintArray(jjfloatArray) = " + ffintArray(jjfloatArray));
+        gus();
+    }
+
+    static void gus() {
+        int x = 0;             // @1 breakpoint
+    }
+
+    public static String ffjj1(jj1 arg) {
+        return arg.me;
+    }
+
+    public static String ffjj2(jj2 arg) {
+        return arg.me;
+    }
+
+    static String ffboolean(boolean p1) {
+        return "ffbool: p1 = " + p1;
+    }
+
+    static String ffbyte(byte p1) {
+        return "ffbyte: p1 = " + p1;
+    }
+
+    static String ffchar(char p1) {
+        return "ffchar: p1 = " + p1;
+    }
+
+    static String ffdouble(double p1) {
+        return "ffdouble: p1 = " + p1;
+    }
+
+    static String fffloat(float p1) {
+        return "fffloat: p1 = " + p1;
+    }
+
+    static String ffint(int p1) {
+        return "ffint: p1 = " + p1;
+    }
+
+    static String fflong(long p1) {
+        return "fflong: p1 = " + p1;
+    }
+
+    static String ffshort(short p1) {
+        return "ffshort: p1 = " + p1;
+    }
+
+    static String ffintArray(int[] p1) {
+        return "ffintArray: p1 = " + p1;
+    }
+
+    // Overloaded funcs
+    public static String ffoverload(jj1 arg) {
+        return arg.me;
+    }
+
+    static String ffoverload(boolean p1) {
+        return "ffoverload: boolean p1 = " + p1;
+    }
+/***
+    static String ffoverload(byte p1) {
+        return "ffoverload: byte p1 = " + p1;
+    }
+***/
+    static String ffoverload(char p1) {
+        return "ffoverload: char p1 = " + p1;
+    }
+
+    static String ffoverload(double p1) {
+        return "ffoverload: double p1 = " + p1;
+    }
+
+    static String ffoverload(float p1) {
+        return "ffoverload: float p1 = " + p1;
+    }
+/***
+    static String ffoverload(int p1) {
+        return "ffoverload: int p1 = " + p1;
+    }
+***/
+    static String ffoverload(long p1) {
+        return "ffoverload: long p1 = " + p1;
+    }
+
+    static String ffoverload(short p1) {
+        return "ffoverload: short p1 = " + p1;
+    }
+
+    static String ffoverload(int[] p1) {
+        return "ffoverload: int array p1 = " + p1;
+    }
+
+    static class jj1 {
+        String me;
+        jj1() {
+            me = "jj1name";
+        }
+        public String toString() {
+            return me;
+        }
+
+    }
+
+    static class jj2 extends jj1 {
+        jj2() {
+            super();
+            me = "jj2name";
+        }
+    }
+
+    static class oranges {
+        oranges() {
+        }
+    }
+}
+
+public class EvalArgs extends JdbTest {
+    public static void main(String argv[]) {
+        new EvalArgs().run();
+    }
+
+    private EvalArgs() {
+        super(DEBUGGEE_CLASS);
+    }
+
+    private static final String DEBUGGEE_CLASS = EvalArgsTarg.class.getName();
+
+    @Override
+    protected void runCases() {
+        setBreakpointsFromTestSource("EvalArgs.java", 1);
+        // Run to breakpoint #1
+        jdb.command(JdbCommand.run());
+
+        final String argsMatchNoMethod = "Arguments match no method";
+        // verify that it works ok when arg types are the same as
+        // the param types
+        evalShouldNotContain("EvalArgsTarg.ffboolean(EvalArgsTarg.jjboolean)", argsMatchNoMethod);
+        evalShouldNotContain("EvalArgsTarg.ffbyte(EvalArgsTarg.jjbyte)", argsMatchNoMethod);
+        evalShouldNotContain("EvalArgsTarg.ffchar(EvalArgsTarg.jjchar)", argsMatchNoMethod);
+        evalShouldNotContain("EvalArgsTarg.ffdouble(EvalArgsTarg.jjdouble)", argsMatchNoMethod);
+        evalShouldNotContain("EvalArgsTarg.fffloat(EvalArgsTarg.jjfloat)", argsMatchNoMethod);
+        evalShouldNotContain("EvalArgsTarg.ffint(EvalArgsTarg.jjint)", argsMatchNoMethod);
+        evalShouldNotContain("EvalArgsTarg.fflong(EvalArgsTarg.jjlong)", argsMatchNoMethod);
+        evalShouldNotContain("EvalArgsTarg.ffshort(EvalArgsTarg.jjshort)", argsMatchNoMethod);
+        evalShouldNotContain("EvalArgsTarg.ffintArray(EvalArgsTarg.jjintArray)", argsMatchNoMethod);
+        evalShouldNotContain("EvalArgsTarg.ffjj1(EvalArgsTarg.myjj1)", argsMatchNoMethod);
+
+        // Provide a visual break in the output
+        jdb.command(JdbCommand.print("1"));
+
+        // Verify mixing primitive types works ok
+        // These should work even though the arg types are
+        // not the same because there is only one
+        // method with each name.
+        evalShouldNotContain("EvalArgsTarg.ffbyte(EvalArgsTarg.jjint)", argsMatchNoMethod);
+        evalShouldNotContain("EvalArgsTarg.ffchar(EvalArgsTarg.jjdouble)", argsMatchNoMethod);
+        evalShouldNotContain("EvalArgsTarg.ffdouble(EvalArgsTarg.jjfloat)", argsMatchNoMethod);
+        evalShouldNotContain("EvalArgsTarg.fffloat(EvalArgsTarg.jjshort)", argsMatchNoMethod);
+        evalShouldNotContain("EvalArgsTarg.ffint(EvalArgsTarg.jjlong)", argsMatchNoMethod);
+        evalShouldNotContain("EvalArgsTarg.fflong(EvalArgsTarg.jjchar)", argsMatchNoMethod);
+        evalShouldNotContain("EvalArgsTarg.ffshort(EvalArgsTarg.jjbyte)", argsMatchNoMethod);
+
+        jdb.command(JdbCommand.print("1"));
+
+        //  Verify that passing a subclass object works
+        evalShouldNotContain("EvalArgsTarg.ffjj1(EvalArgsTarg.myjj2)", argsMatchNoMethod);
+        evalShouldNotContain("EvalArgsTarg.myjj1.toString().equals(\"jj1name\")", argsMatchNoMethod);
+
+        jdb.command(JdbCommand.print("1"));
+
+        // Overloaded methods.  These should pass
+        // because there is an exact  match.
+        evalShouldNotContain("EvalArgsTarg.ffoverload(EvalArgsTarg.jjboolean)", argsMatchNoMethod);
+
+        evalShouldNotContain("EvalArgsTarg.ffoverload(EvalArgsTarg.jjchar)", argsMatchNoMethod);
+        evalShouldNotContain("EvalArgsTarg.ffoverload(EvalArgsTarg.jjdouble)", argsMatchNoMethod);
+        evalShouldNotContain("EvalArgsTarg.ffoverload(EvalArgsTarg.jjfloat)", argsMatchNoMethod);
+        evalShouldNotContain("EvalArgsTarg.ffoverload(EvalArgsTarg.jjlong)", argsMatchNoMethod);
+        evalShouldNotContain("EvalArgsTarg.ffoverload(EvalArgsTarg.jjshort)", argsMatchNoMethod);
+        evalShouldNotContain("EvalArgsTarg.ffoverload(EvalArgsTarg.jjintArray)", argsMatchNoMethod);
+        evalShouldNotContain("EvalArgsTarg.ffoverload(EvalArgsTarg.myjj1)", argsMatchNoMethod);
+        evalShouldNotContain("EvalArgsTarg.ffoverload(EvalArgsTarg.myjj2)", argsMatchNoMethod);
+
+        jdb.command(JdbCommand.print("1"));
+        jdb.command(JdbCommand.print("\"These should fail with msg Arguments match multiple methods\""));
+
+        // These overload calls should fail because there
+        // isn't an exact match and jdb isn't smart  enough
+        // to figure out which of several possibilities
+        // should be called
+        final String argsMatchMultipleMethods = "Arguments match multiple methods";
+        evalShouldContain("EvalArgsTarg.ffoverload(EvalArgsTarg.jjbyte)", argsMatchMultipleMethods);
+
+        evalShouldContain("EvalArgsTarg.ffoverload(EvalArgsTarg.jjint)", argsMatchMultipleMethods);
+
+        jdb.command(JdbCommand.print("1"));
+        jdb.command(JdbCommand.print("\"These should fail with InvalidTypeExceptions\""));
+
+        final String invalidTypeException = "InvalidTypeException";
+        evalShouldContain("EvalArgsTarg.ffboolean(EvalArgsTarg.jjbyte)", invalidTypeException);
+        evalShouldContain("EvalArgsTarg.ffintArray(EvalArgsTarg.jjint)", invalidTypeException);
+        evalShouldContain("EvalArgsTarg.ffintArray(EvalArgsTarg.jjfloatArray)", invalidTypeException);
+        evalShouldContain("EvalArgsTarg.ffjj2(EvalArgsTarg.myjj1)", invalidTypeException);
+        evalShouldContain("EvalArgsTarg.ffjj2(EvalArgsTarg.myoranges)", invalidTypeException);
+
+        jdb.contToExit(1);
+    }
+
+}
--- a/test/jdk/com/sun/jdi/EvalArgs.sh	Thu Aug 30 03:01:49 2018 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,316 +0,0 @@
-#!/bin/sh
-
-#
-# Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved.
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# This code is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License version 2 only, as
-# published by the Free Software Foundation.
-#
-# This code is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-# version 2 for more details (a copy is included in the LICENSE file that
-# accompanied this code).
-#
-# You should have received a copy of the GNU General Public License version
-# 2 along with this work; if not, write to the Free Software Foundation,
-# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-# or visit www.oracle.com if you need additional information or have any
-# questions.
-#
-
-#  @test
-#  @bug 4663146
-#  @summary Arguments match no method error
-#  @author Jim Holmlund/Suvasis
-#
-#  @run shell/timeout=300 EvalArgs.sh
-
-#  The bug is that, for example, if a String is passed
-#  as an arg to a func where an Object is expected,
-#  the above error occurs.  jdb doesnt notice that this is
-#  legal because String is an instance of Object.
-
-
-# These are variables that can be set to control execution
-
-#pkg=untitled7
-classname=EvalArgs
-#compileOptions=-g
-#java="java_g"
-
-createJavaFile()
-{
-    cat <<EOF > $classname.java.1
-public class $classname {
-
-    static jj1 myjj1;
-    static jj2 myjj2;
-    static oranges myoranges;
-    static boolean jjboolean = true;
-    static byte    jjbyte = 1;
-    static char    jjchar = 'a';
-    static double  jjdouble = 2.2;
-    static float   jjfloat = 3.1f;
-    static int     jjint = 4;
-    static long    jjlong = 5;
-    static short   jjshort = 6;
-    static int[]   jjintArray = {7, 8};
-    static float[] jjfloatArray = {9.1f, 10.2f};
-
-
-    public static void main(String args[]) {
-        myjj1 = new jj1();
-        myjj2 = new jj2();
-        myoranges = new oranges();
-
-        // prove that these work
-        System.out.println( ffjj1(myjj1));
-        System.out.println( ffjj1(myjj2));
-
-        System.out.println("$classname.ffoverload($classname.jjboolean) = " +
-                            $classname.ffoverload($classname.jjboolean));
-        System.out.println("$classname.ffoverload($classname.jjbyte) = " +
-                            $classname.ffoverload($classname.jjbyte));
-        System.out.println("$classname.ffoverload($classname.jjchar) = " +
-                            $classname.ffoverload($classname.jjchar));
-        System.out.println("$classname.ffoverload($classname.jjdouble) = " +
-                            $classname.ffoverload($classname.jjdouble));
-
-
-        //This doesn't even compile
-        //System.out.println( "ffintArray(jjfloatArray) = " + ffintArray(jjfloatArray));
-        gus();
-    }
-
-    static void gus() {
-        int x = 0;             // @1 breakpoint
-    }
-
-    public static String ffjj1(jj1 arg) {
-        return arg.me;
-    }
-
-    public static String ffjj2(jj2 arg) {
-        return arg.me;
-    }
-
-    static String ffboolean(boolean p1) {
-        return "ffbool: p1 = " + p1;
-    }
-
-    static String ffbyte(byte p1) {
-        return "ffbyte: p1 = " + p1;
-    }
-
-    static String ffchar(char p1) {
-        return "ffchar: p1 = " + p1;
-    }
-
-    static String ffdouble(double p1) {
-        return "ffdouble: p1 = " + p1;
-    }
-
-    static String fffloat(float p1) {
-        return "fffloat: p1 = " + p1;
-    }
-
-    static String ffint(int p1) {
-        return "ffint: p1 = " + p1;
-    }
-
-    static String fflong(long p1) {
-        return "fflong: p1 = " + p1;
-    }
-
-    static String ffshort(short p1) {
-        return "ffshort: p1 = " + p1;
-    }
-
-    static String ffintArray(int[] p1) {
-        return "ffintArray: p1 = " + p1;
-    }
-
-    // Overloaded funcs
-    public static String ffoverload(jj1 arg) {
-        return arg.me;
-    }
-
-    static String ffoverload(boolean p1) {
-        return "ffoverload: boolean p1 = " + p1;
-    }
-/***
-    static String ffoverload(byte p1) {
-        return "ffoverload: byte p1 = " + p1;
-    }
-***/
-    static String ffoverload(char p1) {
-        return "ffoverload: char p1 = " + p1;
-    }
-
-    static String ffoverload(double p1) {
-        return "ffoverload: double p1 = " + p1;
-    }
-
-    static String ffoverload(float p1) {
-        return "ffoverload: float p1 = " + p1;
-    }
-/***
-    static String ffoverload(int p1) {
-        return "ffoverload: int p1 = " + p1;
-    }
-***/
-    static String ffoverload(long p1) {
-        return "ffoverload: long p1 = " + p1;
-    }
-
-    static String ffoverload(short p1) {
-        return "ffoverload: short p1 = " + p1;
-    }
-
-    static String ffoverload(int[] p1) {
-        return "ffoverload: int array p1 = " + p1;
-    }
-
-  static class jj1 {
-    String me;
-    jj1() {
-        me = "jj1name";
-    }
-    public String toString() {
-        return me;
-    }
-
-  }
-
-  static class jj2 extends jj1 {
-    jj2() {
-        super();
-        me = "jj2name";
-    }
-  }
-
-  static class oranges {
-    oranges() {
-    }
-  }
-}
-
-
-
-EOF
-}
-
-# drive jdb by sending cmds to it and examining its output
-dojdbCmds()
-{
-    setBkpts @1
-    runToBkpt @1
-
-    # verify that it works ok when arg types are the same as
-    # the param types
-    cmd eval "$classname.ffboolean($classname.jjboolean)"
-    cmd eval "$classname.ffbyte($classname.jjbyte)"
-    cmd eval "$classname.ffchar($classname.jjchar)"
-    cmd eval "$classname.ffdouble($classname.jjdouble)"
-    cmd eval "$classname.fffloat($classname.jjfloat)"
-    cmd eval "$classname.ffint($classname.jjint)"
-    cmd eval "$classname.fflong($classname.jjlong)"
-    cmd eval "$classname.ffshort($classname.jjshort)"
-    cmd eval "$classname.ffintArray($classname.jjintArray)"
-    cmd eval "$classname.ffjj1($classname.myjj1)"
-
-    # Provide a visual break in the output
-    cmd print 1
-
-    # Verify mixing primitive types works ok
-    # These should work even though the arg types are
-    # not the same because there is only one
-    # method with each name.
-    cmd eval "$classname.ffbyte($classname.jjint)"
-    cmd eval "$classname.ffchar($classname.jjdouble)"
-    cmd eval "$classname.ffdouble($classname.jjfloat)"
-    cmd eval "$classname.fffloat($classname.jjshort)"
-    cmd eval "$classname.ffint($classname.jjlong)"
-    cmd eval "$classname.fflong($classname.jjchar)"
-    cmd eval "$classname.ffshort($classname.jjbyte)"
-
-    cmd print 1
-
-    # Verify that passing a subclass object works
-    cmd eval "$classname.ffjj1($classname.myjj2)"
-    cmd eval "$classname.myjj1.toString().equals("jj1name")"
-
-    cmd print 1
-
-    # Overloaded methods.  These should pass
-    # because there is an exact  match.
-    cmd eval "$classname.ffoverload($classname.jjboolean)"
-
-    cmd eval "$classname.ffoverload($classname.jjchar)"
-    cmd eval "$classname.ffoverload($classname.jjdouble)"
-    cmd eval "$classname.ffoverload($classname.jjfloat)"
-    cmd eval "$classname.ffoverload($classname.jjlong)"
-    cmd eval "$classname.ffoverload($classname.jjshort)"
-    cmd eval "$classname.ffoverload($classname.jjintArray)"
-    cmd eval "$classname.ffoverload($classname.myjj1)"
-    cmd eval "$classname.ffoverload($classname.myjj2)"
-    jdbFailIfPresent "Arguments match no method"
-
-    cmd print 1
-    cmd print '"These should fail with msg Arguments match multiple methods"'
-
-    # These overload calls should fail because ther
-    # isn't an exact match and jdb isn't smart  enough
-    # to figure out which of several possibilities
-    # should be called
-    cmd eval "$classname.ffoverload($classname.jjbyte)"
-    jdbFailIfNotPresent "Arguments match multiple methods" 3
-
-    cmd eval "$classname.ffoverload($classname.jjint)"
-    jdbFailIfNotPresent "Arguments match multiple methods" 3
-
-    cmd print 1
-    cmd print '"These should fail with InvalidTypeExceptions"'
-
-    cmd eval "$classname.ffboolean($classname.jjbyte)"
-    jdbFailIfNotPresent "InvalidTypeException" 3
-
-    cmd eval "$classname.ffintArray($classname.jjint)"
-    jdbFailIfNotPresent "InvalidTypeException" 3
-
-    cmd eval "$classname.ffintArray($classname.jjfloatArray)"
-    jdbFailIfNotPresent "InvalidTypeException" 3
-
-    cmd eval "$classname.ffjj2($classname.myjj1)"
-    jdbFailIfNotPresent "InvalidTypeException" 3
-
-    cmd eval "$classname.ffjj2($classname.myoranges)"
-    jdbFailIfNotPresent "InvalidTypeException" 3
-}
-
-
-mysetup()
-{
-    if [ -z "$TESTSRC" ] ; then
-        TESTSRC=.
-    fi
-
-    for ii in . $TESTSRC $TESTSRC/.. ; do
-        if [ -r "$ii/ShellScaffold.sh" ] ; then
-            . $ii/ShellScaffold.sh
-            break
-        fi
-    done
-}
-
-# You could replace this next line with the contents
-# of ShellScaffold.sh and this script will run just the same.
-mysetup
-
-runit
-pass
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/com/sun/jdi/EvalArraysAsList.java	Thu Aug 30 11:53:49 2018 -0700
@@ -0,0 +1,79 @@
+/*
+ * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8160024
+ * @summary jdb returns invalid argument count if first parameter to Arrays.asList is null
+ * @comment converted from test/jdk/com/sun/jdi/EvalArraysAsList.sh
+ *
+ * @library /test/lib
+ * @build EvalArraysAsList
+ * @run main/othervm EvalArraysAsList
+ */
+
+import lib.jdb.JdbCommand;
+import lib.jdb.JdbTest;
+
+/*
+ * The test checks if evaluation of the expression java.util.Arrays.asList(null, "a")
+ * works normally and does not throw an IllegalArgumentException.
+ */
+class EvalArraysAsListTarg {
+    public static void main(String[] args) {
+        java.util.List<Object> l = java.util.Arrays.asList(null, "a");
+        System.out.println("java.util.Arrays.asList(null, \"a\") returns: " + l);
+        return;    // @1 breakpoint
+    }
+}
+
+
+public class EvalArraysAsList extends JdbTest {
+    public static void main(String argv[]) {
+        new EvalArraysAsList().run();
+    }
+
+    private EvalArraysAsList() {
+        super(DEBUGGEE_CLASS);
+    }
+
+    private static final String DEBUGGEE_CLASS = EvalArraysAsListTarg.class.getName();
+
+    @Override
+    protected void runCases() {
+        setBreakpointsFromTestSource("EvalArraysAsList.java", 1);
+        // Run to breakpoint #1
+        jdb.command(JdbCommand.run());
+
+        final String illegalArgumentException = "IllegalArgumentException";
+
+        evalShouldNotContain("java.util.Arrays.asList(null, null)", illegalArgumentException);
+
+        evalShouldNotContain("java.util.Arrays.asList(null, \"a\")", illegalArgumentException);
+
+        evalShouldNotContain("java.util.Arrays.asList(\"a\", null)", illegalArgumentException);
+
+        jdb.contToExit(1);
+    }
+
+}
--- a/test/jdk/com/sun/jdi/EvalArraysAsList.sh	Thu Aug 30 03:01:49 2018 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,85 +0,0 @@
-#!/bin/sh
-#
-# Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# This code is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License version 2 only, as
-# published by the Free Software Foundation.
-#
-# This code is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-# version 2 for more details (a copy is included in the LICENSE file that
-# accompanied this code).
-#
-# You should have received a copy of the GNU General Public License version
-# 2 along with this work; if not, write to the Free Software Foundation,
-# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-# or visit www.oracle.com if you need additional information or have any
-# questions.
-#
-
-#  @test
-#  @bug 8160024
-#  @summary jdb returns invalid argument count if first parameter to Arrays.asList is null
-#
-#  @run shell/timeout=300 EvalArraysAsList.sh
-#
-#  The test checks if evaluation of the expression java.util.Arrays.asList(null, "a")
-#  works normally and does not throw an IllegalArgumentException.
-
-classname=EvalArraysAsList
-
-createJavaFile()
-{
-    cat <<EOF > $classname.java.1
-public class $classname {
-    public static void main(String[] args) {
-        java.util.List<Object> l = java.util.Arrays.asList(null, "a");
-        System.out.println("java.util.Arrays.asList(null, \\"a\\") returns: " + l);
-        return;    // @1 breakpoint
-    }
-}
-EOF
-}
-
-# drive jdb by sending cmds to it and examining its output
-dojdbCmds()
-{
-    setBkpts @1
-    runToBkpt @1
-
-    cmd eval "java.util.Arrays.asList(null, null)"
-    jdbFailIfPresent "IllegalArgumentException" 3
-
-    cmd eval "java.util.Arrays.asList(null, \"a\")"
-    jdbFailIfPresent "IllegalArgumentException" 3
-
-    cmd eval "java.util.Arrays.asList(\"a\", null)"
-    jdbFailIfPresent "IllegalArgumentException" 3
-}
-
-
-mysetup()
-{
-    if [ -z "$TESTSRC" ] ; then
-        TESTSRC=.
-    fi
-
-    for ii in . $TESTSRC $TESTSRC/.. ; do
-        if [ -r "$ii/ShellScaffold.sh" ] ; then
-            . $ii/ShellScaffold.sh
-            break
-        fi
-    done
-}
-
-# You could replace this next line with the contents
-# of ShellScaffold.sh and this script will run just the same.
-mysetup
-
-runit
-pass
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/com/sun/jdi/EvalInterfaceStatic.java	Thu Aug 30 11:53:49 2018 -0700
@@ -0,0 +1,111 @@
+/*
+ * Copyright (c) 2014, 2018, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8031195
+ * @summary JDB allows evaluation of calls to static interface methods
+ * @comment converted from test/jdk/com/sun/jdi/EvalInterfaceStatic.sh
+ *
+ * @library /test/lib
+ * @build EvalInterfaceStatic
+ * @run main/othervm EvalInterfaceStatic
+ */
+
+import lib.jdb.JdbCommand;
+import lib.jdb.JdbTest;
+
+/*
+ * The test exercises the ability to invoke static methods on interfaces.
+ * Static interface methods are a new feature added in JDK8.
+ *
+ * The test makes sure that it is possible to invoke an interface
+ * static method and that the static methods are not inherited by extending
+ * interfaces.
+ */
+interface EvalStaticInterfaces {
+    static String staticMethod1() {
+        return "base:staticMethod1";
+    }
+
+    static String staticMethod2() {
+        return "base:staticMethod2";
+    }
+
+    public static void main(String[] args) {
+        // prove that these work
+        System.out.println("base staticMethod1(): " + EvalStaticInterfaces.staticMethod1());
+        System.out.println("base staticMethod2(): " + EvalStaticInterfaces.staticMethod2());
+        System.out.println("overridden staticMethod2(): " + ExtendedEvalStaticInterfaces.staticMethod2());
+        System.out.println("base staticMethod3(): " + ExtendedEvalStaticInterfaces.staticMethod3());
+
+        gus();
+    }
+
+    static void gus() {
+        int x = 0;             // @1 breakpoint
+    }
+}
+
+interface ExtendedEvalStaticInterfaces extends EvalStaticInterfaces {
+    static String staticMethod2() {
+        return "extended:staticMethod2";
+    }
+
+    static String staticMethod3() {
+        return "extended:staticMethod3";
+    }
+}
+
+
+public class EvalInterfaceStatic extends JdbTest {
+    public static void main(String argv[]) {
+        new EvalInterfaceStatic().run();
+    }
+
+    private EvalInterfaceStatic() {
+        super(DEBUGGEE_CLASS);
+    }
+
+    private static final String DEBUGGEE_CLASS = EvalStaticInterfaces.class.getName();
+
+    @Override
+    protected void runCases() {
+        setBreakpointsFromTestSource("EvalInterfaceStatic.java", 1);
+        // Run to breakpoint #1
+        jdb.command(JdbCommand.run());
+
+        evalShouldContain("EvalStaticInterfaces.staticMethod1()", "base:staticMethod1");
+
+        evalShouldContain("EvalStaticInterfaces.staticMethod2()", "base:staticMethod2");
+
+        evalShouldNotContain("ExtendedEvalStaticInterfaces.staticMethod1()", "base:staticMethod1");
+
+        evalShouldContain("ExtendedEvalStaticInterfaces.staticMethod2()", "extended:staticMethod2");
+
+        evalShouldContain("ExtendedEvalStaticInterfaces.staticMethod3()", "extended:staticMethod3");
+
+        jdb.contToExit(1);
+    }
+
+}
--- a/test/jdk/com/sun/jdi/EvalInterfaceStatic.sh	Thu Aug 30 03:01:49 2018 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,126 +0,0 @@
-#!/bin/sh
-
-#
-# Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# This code is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License version 2 only, as
-# published by the Free Software Foundation.
-#
-# This code is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-# version 2 for more details (a copy is included in the LICENSE file that
-# accompanied this code).
-#
-# You should have received a copy of the GNU General Public License version
-# 2 along with this work; if not, write to the Free Software Foundation,
-# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-# or visit www.oracle.com if you need additional information or have any
-# questions.
-#
-
-#  @test
-#  @bug 8031195
-#  @summary JDB allows evaluation of calls to static interface methods
-#  @author Jaroslav Bachorik
-#
-#  @run shell/timeout=300 EvalInterfaceStatic.sh
-
-#  The test exercises the ability to invoke static methods on interfaces.
-#  Static interface methods are a new feature added in JDK8.
-#
-#  The test makes sure that it is, at all, possible to invoke an interface
-#  static method and that the static methods are not inherited by extending
-#  interfaces.
-
-classname=EvalStaticInterfaces
-
-createJavaFile()
-{
-    cat <<EOF > $classname.java.1
-public interface $classname {
-    static String staticMethod1() {
-        return "base:staticMethod1";
-    }
-
-    static String staticMethod2() {
-        return "base:staticMethod2";
-    }
-
-    public static void main(String[] args) {
-        // prove that these work
-        System.out.println("base staticMethod1(): " + $classname.staticMethod1());
-        System.out.println("base staticMethod2(): " + $classname.staticMethod2());
-        System.out.println("overridden staticMethod2(): " + Extended$classname.staticMethod2());
-        System.out.println("base staticMethod3(): " + Extended$classname.staticMethod3());
-
-        gus();
-    }
-
-    static void gus() {
-        int x = 0;             // @1 breakpoint
-    }
-}
-
-interface Extended$classname extends $classname {
-    static String staticMethod2() {
-        return "extended:staticMethod2";
-    }
-
-    static String staticMethod3() {
-        return "extended:staticMethod3";
-    }
-}
-
-
-
-EOF
-}
-
-# drive jdb by sending cmds to it and examining its output
-dojdbCmds()
-{
-    setBkpts @1
-    runToBkpt @1
-
-    cmd eval "$classname.staticMethod1()"
-    jdbFailIfNotPresent "base:staticMethod1" 2
-
-    cmd eval "$classname.staticMethod2()"
-    jdbFailIfNotPresent "base:staticMethod2" 2
-
-    cmd eval "Extended$classname.staticMethod1()"
-    jdbFailIfPresent "base:staticMethod1" 2
-
-    cmd eval "Extended$classname.staticMethod2()"
-    jdbFailIfNotPresent "extended:staticMethod2" 2
-
-    cmd eval "Extended$classname.staticMethod3()"
-    jdbFailIfNotPresent "extended:staticMethod3" 2
-}
-
-
-mysetup()
-{
-    if [ -z "$TESTSRC" ] ; then
-        TESTSRC=.
-    fi
-
-    for ii in . $TESTSRC $TESTSRC/.. ; do
-        if [ -r "$ii/ShellScaffold.sh" ] ; then
-            . $ii/ShellScaffold.sh
-            break
-        fi
-    done
-}
-
-# You could replace this next line with the contents
-# of ShellScaffold.sh and this script will run just the same.
-mysetup
-
-runit
-pass
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/jdk/com/sun/jdi/GetLocalVariables3Test.java	Thu Aug 30 11:53:49 2018 -0700
@@ -0,0 +1,80 @@
+/*
+ * Copyright (c) 2002, 2018, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 4448658
+ * @summary javac produces the inconsistent variable debug in while loops.
+ * @comment converted from test/jdk/com/sun/jdi/GetLocalVariables3Test.sh
+ *
+ * @library /test/lib
+ * @compile -g GetLocalVariables3Test.java
+ * @run main/othervm GetLocalVariables3Test
+ */
+
+import jdk.test.lib.process.OutputAnalyzer;
+import lib.jdb.JdbCommand;
+import lib.jdb.JdbTest;
+
+
+class GetLocalVariables3Targ {
+    public static void main(String[] args) {
+        System.out.println("Howdy!");
+        int i = 1, j, k;
+        while ((j = i) > 0) {
+            k = j; i = k - 1;    // @1 breakpoint
+        }
+        System.out.println("Goodbye from GetLocalVariables3Targ!");
+    }
+}
+
+
+public class GetLocalVariables3Test extends JdbTest {
+    public static void main(String argv[]) {
+        new GetLocalVariables3Test().run();
+    }
+
+    private GetLocalVariables3Test() {
+        super(DEBUGGEE_CLASS);
+    }
+
+    private static final String DEBUGGEE_CLASS = GetLocalVariables3Targ.class.getName();
+
+    @Override
+    protected void runCases() {
+        setBreakpointsFromTestSource("GetLocalVariables3Test.java", 1);
+        // Run to breakpoint #1
+        jdb.command(JdbCommand.run());
+
+        jdb.command(JdbCommand.locals());
+
+        jdb.contToExit(1);
+
+        new OutputAnalyzer(getJdbOutput())
+                .shouldContain("j = 1");
+        new OutputAnalyzer(getDebuggeeOutput())
+                .shouldContain("Howdy")
+                .shouldContain("Goodbye from GetLocalVariables3Targ");
+    }
+
+}
--- a/test/jdk/com/sun/jdi/GetLocalVariables3Test.sh	Thu Aug 30 03:01:49 2018 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,82 +0,0 @@
-#!/bin/sh
-
-#
-# Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved.
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# This code is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License version 2 only, as
-# published by the Free Software Foundation.
-#
-# This code is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-# version 2 for more details (a copy is included in the LICENSE file that
-# accompanied this code).
-#
-# You should have received a copy of the GNU General Public License version
-# 2 along with this work; if not, write to the Free Software Foundation,
-# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-# or visit www.oracle.com if you need additional information or have any
-# questions.
-#
-
-#
-#  @test
-#  @bug 4448658
-#  @summary javac produces the inconsistent variable debug in while loops.
-#  @author Tim Bell
-#
-#  @run shell GetLocalVariables3Test.sh
-#
-classname=GetLocalVariables3Targ
-
-createJavaFile()
-{
-    cat <<EOF > $classname.java.1
-public class GetLocalVariables3Targ {
-    public static void main(String[] args) {
-        System.out.println("Howdy!");
-        int i = 1, j, k;
-        while ((j = i) > 0) {
-            k = j; i = k - 1;    // @1 breakpoint
-        }
-        System.out.println("Goodbye from GetLocalVariables3Targ!");
-    }
-}
-EOF
-}
-
-# This is called to feed cmds to jdb.
-dojdbCmds()
-{
-   setBkpts @1
-   runToBkpt @1
-   cmd locals
-   cmd allowExit cont
-}
-
-mysetup()
-{
-    compileOptions="-g"
-    if [ -z "$TESTSRC" ] ; then
-        TESTSRC=.
-    fi
-
-    for ii in . $TESTSRC $TESTSRC/.. ; do
-        if [ -r "$ii/ShellScaffold.sh" ] ; then
-            . $ii/ShellScaffold.sh
-            break
-        fi
-    done
-}
-
-mysetup
-
-runit
-jdbFailIfNotPresent "j = 1"
-debuggeeFailIfNotPresent "Howdy"
-debuggeeFailIfNotPresent "Goodbye from GetLocalVariables3Targ"
-pass
--- a/test/jdk/com/sun/jdi/JdbExprTest.java	Thu Aug 30 03:01:49 2018 -0700
+++ b/test/jdk/com/sun/jdi/JdbExprTest.java	Thu Aug 30 11:53:49 2018 -0700
@@ -67,7 +67,7 @@
 
     @Override
     protected void runCases() {
-        setBreakpoints(System.getProperty("test.src") + "/JdbExprTest.java", 1);
+        setBreakpointsFromTestSource("JdbExprTest.java", 1);
         // Run to breakpoint #1
         execCommand(JdbCommand.run())
                 .shouldContain("Breakpoint hit");
--- a/test/jdk/com/sun/jdi/JdbMethodExitTest.java	Thu Aug 30 03:01:49 2018 -0700
+++ b/test/jdk/com/sun/jdi/JdbMethodExitTest.java	Thu Aug 30 11:53:49 2018 -0700
@@ -197,13 +197,13 @@
 
     @Override
     protected void runCases() {
-        setBreakpoints(System.getProperty("test.src") + "/JdbMethodExitTest.java", 1);
+        setBreakpointsFromTestSource("JdbMethodExitTest.java", 1);
 
         // test all possible return types
         execCommand(JdbCommand.run())
                 .shouldContain("Breakpoint hit");
         Integer threadId = Integer.parseInt(
-                new OutputAnalyzer(jdb.getDebuggeeOutput())
+                new OutputAnalyzer(getDebuggeeOutput())
                         .firstMatch("^threadid=(.*)$", 1));
         jdb.command(JdbCommand.untrace());
 
@@ -299,7 +299,7 @@
         new OutputAnalyzer(reply.stream().collect(Collectors.joining(lineSeparator)))
                 .shouldMatch("Method exited: .*JdbMethodExitTestTarg.traceExit1");
 
-        new OutputAnalyzer(jdb.getJdbOutput())
+        new OutputAnalyzer(getJdbOutput())
                 .shouldContain("Breakpoint hit");
     }
 }
--- a/test/jdk/com/sun/jdi/lib/jdb/Jdb.java	Thu Aug 30 03:01:49 2018 -0700
+++ b/test/jdk/com/sun/jdi/lib/jdb/Jdb.java	Thu Aug 30 11:53:49 2018 -0700
@@ -38,6 +38,7 @@
 import java.util.regex.Pattern;
 import java.util.stream.Collectors;
 import jdk.test.lib.JDKToolFinder;
+import jdk.test.lib.Utils;
 import jdk.test.lib.process.ProcessTools;
 import jdk.test.lib.process.StreamPumper;
 
@@ -158,7 +159,7 @@
     // waits until the process shutdown or crash
     public boolean waitFor(long timeout, TimeUnit unit) {
         try {
-            return jdb.waitFor(timeout, unit);
+            return jdb.waitFor(Utils.adjustTimeout(timeout), unit);
         } catch (InterruptedException e) {
             return false;
         }
@@ -180,7 +181,7 @@
         // shutdown debuggee
         if (debuggee.isAlive()) {
             try {
-                debuggee.waitFor(10, TimeUnit.SECONDS);
+                debuggee.waitFor(Utils.adjustTimeout(10), TimeUnit.SECONDS);
             } catch (InterruptedException e) {
                 // ignore
             } finally {
--- a/test/jdk/com/sun/jdi/lib/jdb/JdbCommand.java	Thu Aug 30 03:01:49 2018 -0700
+++ b/test/jdk/com/sun/jdi/lib/jdb/JdbCommand.java	Thu Aug 30 11:53:49 2018 -0700
@@ -120,7 +120,7 @@
     boolean allowExit = false;
 
     public JdbCommand(String cmd) {
-        this.cmd = cmd.endsWith(ls) ? cmd.substring(0, cmd.length() - 1) : cmd;
+        this.cmd = cmd;
     }
 
     public JdbCommand allowExit() {
@@ -129,8 +129,6 @@
     }
 
 
-    private static final String ls = System.getProperty("line.separator");
-
     public static JdbCommand run(String ... params) {
         return new JdbCommand("run " + Arrays.stream(params).collect(Collectors.joining(" ")));
     }
@@ -147,6 +145,28 @@
     public static JdbCommand stopAt(String targetClass, int lineNum) {
         return new JdbCommand("stop at " + targetClass + ":" + lineNum);
     }
+    public static JdbCommand stopIn(String targetClass, String methodName) {
+        return new JdbCommand("stop in " + targetClass + "." + methodName);
+    }
+
+    // exception type used by catch/ignore
+    public enum ExType{
+        uncaught,
+        caught,
+        all
+    }
+    public static JdbCommand catch_(String classId) {
+        return new JdbCommand("catch " + classId);
+    }
+    public static JdbCommand catch_(ExType eType, String classId) {
+        return catch_(eType.toString() + " " + classId);
+    }
+    public static JdbCommand ignore(String classId) {
+        return new JdbCommand("ignore " + classId);
+    }
+    public static JdbCommand ignore(ExType eType, String classId) {
+        return ignore(eType.toString() + " " + classId);
+    }
 
     public static JdbCommand step() {
         return new JdbCommand("step");
@@ -154,11 +174,25 @@
     public static JdbCommand stepUp() {
         return new JdbCommand("step up");
     }
+    public static JdbCommand next() {
+        return new JdbCommand("next");
+    }
 
+    // where [thread id] | all
+    public static JdbCommand where(String threadId) {
+        return new JdbCommand("where " + threadId);
+    }
+    public static JdbCommand eval(String expr) {
+        return new JdbCommand("eval " + expr);
+    }
     public static JdbCommand print(String expr) {
         return new JdbCommand("print " + expr);
     }
 
+    public static JdbCommand locals() {
+        return new JdbCommand("locals");
+    }
+
     public static JdbCommand set(String lvalue, String expr) {
         return new JdbCommand("set " + lvalue + " = " + expr);
     }
--- a/test/jdk/com/sun/jdi/lib/jdb/JdbTest.java	Thu Aug 30 03:01:49 2018 -0700
+++ b/test/jdk/com/sun/jdi/lib/jdb/JdbTest.java	Thu Aug 30 11:53:49 2018 -0700
@@ -46,6 +46,16 @@
     protected Jdb jdb;
     protected final String debuggeeClass;   // shortland for jdbOptions.debuggeeClass
 
+    // returns the whole jdb output as a string
+    public String getJdbOutput() {
+        return jdb == null ? "" : jdb.getJdbOutput();
+    }
+
+    // returns the whole debuggee output as a string
+    public String getDebuggeeOutput() {
+        return jdb == null ? "" : jdb.getDebuggeeOutput();
+    }
+
     public void run() {
         try {
             setup();
@@ -109,12 +119,26 @@
         return bps.size();
     }
 
-    protected int setBreakpoints(String debuggeeSourcePath, int id) {
-        return setBreakpoints(jdb, debuggeeClass, debuggeeSourcePath, id);
+    // sets breakpoints to the lines parsed by {@code parseBreakpoints}
+    // from the file from test source directory.
+    // returns number of the breakpoints set.
+    protected int setBreakpointsFromTestSource(String debuggeeFileName, int id) {
+        return setBreakpoints(jdb, debuggeeClass, System.getProperty("test.src") + "/" + debuggeeFileName, id);
     }
 
     protected OutputAnalyzer execCommand(JdbCommand cmd) {
         List<String> reply = jdb.command(cmd);
         return new OutputAnalyzer(reply.stream().collect(Collectors.joining(lineSeparator)));
     }
+    // helpers for "eval" jdb command.
+    // executes "eval <expr>" and verifies output contains the specified text
+    protected void evalShouldContain(String expr, String expectedString) {
+        execCommand(JdbCommand.eval(expr))
+                .shouldContain(expectedString);
+    }
+    // executes "eval <expr>" and verifies output does not contain the specified text
+    protected void evalShouldNotContain(String expr, String unexpectedString) {
+        execCommand(JdbCommand.eval(expr))
+                .shouldNotContain(unexpectedString);
+    }
 }