test/sun/tools/jcmd/TestJcmdDefaults.java

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


  22  */
  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.Utils;
  33 
  34 /**
  35  * Unit test for jcmd utility. Tests jcmd options which do not send
  36  * requests to a specific JVM process.
  37  */
  38 /*
  39  * @test
  40  * @bug 7104647
  41  * @library /lib/testlibrary

  42  * @run main TestJcmdDefaults
  43  */
  44 public class TestJcmdDefaults {
  45 
  46     private static final String TEST_SRC = System.getProperty("test.src").trim();
  47     private static final String[] VM_ARGS = new String[] { "-XX:+UsePerfData" };
  48     private static final String JCMD_LIST_REGEX = "^\\d+\\s*.*";
  49 
  50     public static void main(String[] args) throws Exception {
  51         testJcmdUsage("-h");
  52         testJcmdUsage("-help");
  53         testJcmdDefaults();
  54         testJcmdDefaults("-l");
  55     }
  56 
  57     /**
  58      * jcmd -J-XX:+UsePerfData -h
  59      * jcmd -J-XX:+UsePerfData -help
  60      */
  61     private static void testJcmdUsage(String... jcmdArgs) throws Exception {




  22  */
  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.Utils;
  33 
  34 /**
  35  * Unit test for jcmd utility. Tests jcmd options which do not send
  36  * requests to a specific JVM process.
  37  */
  38 /*
  39  * @test
  40  * @bug 7104647
  41  * @library /lib/testlibrary
  42  * @build jdk.testlibrary.*
  43  * @run main TestJcmdDefaults
  44  */
  45 public class TestJcmdDefaults {
  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_LIST_REGEX = "^\\d+\\s*.*";
  50 
  51     public static void main(String[] args) throws Exception {
  52         testJcmdUsage("-h");
  53         testJcmdUsage("-help");
  54         testJcmdDefaults();
  55         testJcmdDefaults("-l");
  56     }
  57 
  58     /**
  59      * jcmd -J-XX:+UsePerfData -h
  60      * jcmd -J-XX:+UsePerfData -help
  61      */
  62     private static void testJcmdUsage(String... jcmdArgs) throws Exception {