< prev index next >

test/jdk/sun/tools/jhsdb/BasicLauncherTest.java

Print this page
rev 51731 : imported patch 8210732


   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  */
  23 
  24 /**
  25  * @test
  26  * @summary Basic test for jhsdb launcher
  27  * @library /test/lib
  28  * @library /lib/testlibrary
  29  * @requires vm.hasSAandCanAttach
  30  * @build jdk.testlibrary.*
  31  * @build jdk.test.lib.apps.*
  32  * @run main BasicLauncherTest
  33  */
  34 
  35 import java.io.BufferedReader;
  36 import java.io.IOException;
  37 import java.io.OutputStream;
  38 import java.io.InputStreamReader;
  39 import java.util.ArrayList;
  40 import java.util.List;
  41 import java.util.Arrays;
  42 import java.util.Optional;
  43 import jdk.test.lib.process.OutputAnalyzer;
  44 import jdk.test.lib.process.ProcessTools;
  45 import jdk.test.lib.apps.LingeredApp;
  46 import jdk.test.lib.Platform;
  47 import jdk.test.lib.JDKToolLauncher;
  48 import jdk.testlibrary.Utils;
  49 
  50 public class BasicLauncherTest {
  51 
  52     private static LingeredApp theApp = null;
  53     private static boolean useJavaLauncher = false;
  54 
  55     private static JDKToolLauncher createSALauncher() {
  56         JDKToolLauncher launcher = null;
  57         if (useJavaLauncher) {
  58             // Use java launcher if we need to pass additional parameters to VM
  59             // for debugging purpose
  60             // e.g. -Xlog:class+load=info:file=/tmp/BasicLauncherTest.log
  61             launcher = JDKToolLauncher.createUsingTestJDK("java");
  62             launcher.addToolArg("sun.jvm.hotspot.SALauncher");
  63         }
  64         else {
  65             launcher = JDKToolLauncher.createUsingTestJDK("jhsdb");
  66         }
  67 
  68         return launcher;




   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  */
  23 
  24 /**
  25  * @test
  26  * @summary Basic test for jhsdb launcher
  27  * @library /test/lib

  28  * @requires vm.hasSAandCanAttach

  29  * @build jdk.test.lib.apps.*
  30  * @run main BasicLauncherTest
  31  */
  32 
  33 import java.io.BufferedReader;
  34 import java.io.IOException;
  35 import java.io.OutputStream;
  36 import java.io.InputStreamReader;
  37 import java.util.ArrayList;
  38 import java.util.List;
  39 import java.util.Arrays;
  40 import java.util.Optional;
  41 import jdk.test.lib.process.OutputAnalyzer;
  42 import jdk.test.lib.process.ProcessTools;
  43 import jdk.test.lib.apps.LingeredApp;
  44 import jdk.test.lib.Platform;
  45 import jdk.test.lib.JDKToolLauncher;
  46 import jdk.test.lib.Utils;
  47 
  48 public class BasicLauncherTest {
  49 
  50     private static LingeredApp theApp = null;
  51     private static boolean useJavaLauncher = false;
  52 
  53     private static JDKToolLauncher createSALauncher() {
  54         JDKToolLauncher launcher = null;
  55         if (useJavaLauncher) {
  56             // Use java launcher if we need to pass additional parameters to VM
  57             // for debugging purpose
  58             // e.g. -Xlog:class+load=info:file=/tmp/BasicLauncherTest.log
  59             launcher = JDKToolLauncher.createUsingTestJDK("java");
  60             launcher.addToolArg("sun.jvm.hotspot.SALauncher");
  61         }
  62         else {
  63             launcher = JDKToolLauncher.createUsingTestJDK("jhsdb");
  64         }
  65 
  66         return launcher;


< prev index next >