test/sun/tools/jcmd/TestJcmdSanity.java

Print this page
rev 9907 : 8034960: Serviceability tests using @library failing with java.lang.NoClassDefFoundError


  23 
  24 import static jdk.testlibrary.Asserts.*;
  25 
  26 import java.io.File;
  27 import java.io.IOException;
  28 import java.util.List;
  29 
  30 import jdk.testlibrary.JcmdBase;
  31 import jdk.testlibrary.OutputAnalyzer;
  32 import jdk.testlibrary.ProcessTools;
  33 import jdk.testlibrary.Utils;
  34 
  35 /**
  36  * Unit test for jcmd utility. The test will send different diagnostic command
  37  * requests to the current java process.
  38  */
  39 /*
  40  * @test
  41  * @bug 7104647 7154822
  42  * @library /lib/testlibrary

  43  * @run main TestJcmdSanity
  44  */
  45 public class TestJcmdSanity {
  46 
  47     private static final String TEST_SRC = System.getProperty("test.src").trim();
  48     private static final String[] VM_ARGS = new String[] { "-XX:+UsePerfData" };
  49     private static final String JCMD_COMMAND_REGEX = "(\\w|\\.)*";
  50     private static final String PERF_COUNTER_REGEX = "(\\w|\\.)*\\=.*";
  51 
  52     public static void main(String[] args) throws Exception {
  53         testJcmdPidHelp();
  54         testJcmdPidHelpHelp();
  55         testJcmdPid_f();
  56         testJcmdPidPerfCounterPrint();
  57         testJcmdPidBigScript();
  58     }
  59 
  60     /**
  61      * jcmd -J-XX:+UsePerfData pid help
  62      */




  23 
  24 import static jdk.testlibrary.Asserts.*;
  25 
  26 import java.io.File;
  27 import java.io.IOException;
  28 import java.util.List;
  29 
  30 import jdk.testlibrary.JcmdBase;
  31 import jdk.testlibrary.OutputAnalyzer;
  32 import jdk.testlibrary.ProcessTools;
  33 import jdk.testlibrary.Utils;
  34 
  35 /**
  36  * Unit test for jcmd utility. The test will send different diagnostic command
  37  * requests to the current java process.
  38  */
  39 /*
  40  * @test
  41  * @bug 7104647 7154822
  42  * @library /lib/testlibrary
  43  * @build jdk.testlibrary.*
  44  * @run main TestJcmdSanity
  45  */
  46 public class TestJcmdSanity {
  47 
  48     private static final String TEST_SRC = System.getProperty("test.src").trim();
  49     private static final String[] VM_ARGS = new String[] { "-XX:+UsePerfData" };
  50     private static final String JCMD_COMMAND_REGEX = "(\\w|\\.)*";
  51     private static final String PERF_COUNTER_REGEX = "(\\w|\\.)*\\=.*";
  52 
  53     public static void main(String[] args) throws Exception {
  54         testJcmdPidHelp();
  55         testJcmdPidHelpHelp();
  56         testJcmdPid_f();
  57         testJcmdPidPerfCounterPrint();
  58         testJcmdPidBigScript();
  59     }
  60 
  61     /**
  62      * jcmd -J-XX:+UsePerfData pid help
  63      */