< prev index next >

test/sun/tools/jcmd/TestJcmdSanity.java

Print this page




  54     private static final String JCMD_COMMAND_REGEX = "(\\w|\\.)*";
  55     private static final String PERF_COUNTER_REGEX = "(\\w|\\.)*\\=.*";
  56 
  57     public static void main(String[] args) throws Exception {
  58         testJcmdPidHelp();
  59         testJcmdPidHelpHelp();
  60         testJcmdPid_f();
  61         testJcmdPidPerfCounterPrint();
  62         testJcmdPidBigScript();
  63     }
  64 
  65     /**
  66      * jcmd -J-XX:+UsePerfData pid help
  67      */
  68     private static void testJcmdPidHelp() throws Exception {
  69         OutputAnalyzer output = JcmdBase.jcmd(VM_ARGS,
  70                 new String[] {"help"});
  71 
  72         output.shouldHaveExitValue(0);
  73         output.shouldNotContain("Exception");
  74         output.shouldContain(Integer.toString(ProcessTools.getProcessId()) + ":");
  75         matchJcmdCommands(output);
  76         output.shouldContain("For more information about a specific command use 'help <command>'.");
  77     }
  78 
  79     /**
  80      * jcmd -J-XX:+UsePerfData pid help help
  81      */
  82     private static void testJcmdPidHelpHelp() throws Exception {
  83         OutputAnalyzer output = JcmdBase.jcmd(VM_ARGS,
  84                 new String[] {"help", "help"});
  85 
  86         output.shouldHaveExitValue(0);
  87         verifyOutputAgainstFile(output);
  88     }
  89 
  90     /**
  91      * jcmd -J-XX:+UsePerfData pid PerfCounter.print
  92      */
  93     private static void testJcmdPidPerfCounterPrint() throws Exception {
  94         OutputAnalyzer output = JcmdBase.jcmd(VM_ARGS,




  54     private static final String JCMD_COMMAND_REGEX = "(\\w|\\.)*";
  55     private static final String PERF_COUNTER_REGEX = "(\\w|\\.)*\\=.*";
  56 
  57     public static void main(String[] args) throws Exception {
  58         testJcmdPidHelp();
  59         testJcmdPidHelpHelp();
  60         testJcmdPid_f();
  61         testJcmdPidPerfCounterPrint();
  62         testJcmdPidBigScript();
  63     }
  64 
  65     /**
  66      * jcmd -J-XX:+UsePerfData pid help
  67      */
  68     private static void testJcmdPidHelp() throws Exception {
  69         OutputAnalyzer output = JcmdBase.jcmd(VM_ARGS,
  70                 new String[] {"help"});
  71 
  72         output.shouldHaveExitValue(0);
  73         output.shouldNotContain("Exception");
  74         output.shouldContain(Long.toString(ProcessTools.getProcessId()) + ":");
  75         matchJcmdCommands(output);
  76         output.shouldContain("For more information about a specific command use 'help <command>'.");
  77     }
  78 
  79     /**
  80      * jcmd -J-XX:+UsePerfData pid help help
  81      */
  82     private static void testJcmdPidHelpHelp() throws Exception {
  83         OutputAnalyzer output = JcmdBase.jcmd(VM_ARGS,
  84                 new String[] {"help", "help"});
  85 
  86         output.shouldHaveExitValue(0);
  87         verifyOutputAgainstFile(output);
  88     }
  89 
  90     /**
  91      * jcmd -J-XX:+UsePerfData pid PerfCounter.print
  92      */
  93     private static void testJcmdPidPerfCounterPrint() throws Exception {
  94         OutputAnalyzer output = JcmdBase.jcmd(VM_ARGS,


< prev index next >