4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
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 import static jdk.testlibrary.Asserts.*;
25
26 import java.io.File;
27 import java.io.IOException;
28 import java.nio.file.Files;
29 import java.nio.file.Path;
30 import java.nio.file.Paths;
31 import java.util.List;
32
33 import jdk.test.lib.process.OutputAnalyzer;
34 import jdk.test.lib.process.ProcessTools;
35 import jdk.test.lib.Utils;
36
37 /*
38 * @test
39 * @bug 7104647 7154822
40 * @summary Unit test for jcmd utility. The test will send different diagnostic
41 * command requests to the current java process.
42 *
43 * @library /lib/testlibrary
44 * @library /test/lib
45 *
46 * @build jdk.testlibrary.*
47 * @run main/othervm -XX:+UsePerfData TestJcmdSanity
48 */
49 public class TestJcmdSanity {
50
51 private static final String TEST_SRC = System.getProperty("test.src").trim();
52 private static final String[] VM_ARGS = new String[] { "-XX:+UsePerfData" };
53 private static final String JCMD_COMMAND_REGEX = "(\\w|\\.)*";
54 private static final String PERF_COUNTER_REGEX = "(\\w|\\.)*\\=.*";
55
56 public static void main(String[] args) throws Exception {
57 testJcmdPidHelp();
58 testJcmdPidHelpHelp();
59 testJcmdPid_f();
60 testJcmdPidPerfCounterPrint();
61 testJcmdPidBigScript();
62 }
63
64 /**
65 * jcmd -J-XX:+UsePerfData pid help
66 */
|
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
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 import static jdk.test.lib.Asserts.*;
25
26 import java.io.File;
27 import java.io.IOException;
28 import java.nio.file.Files;
29 import java.nio.file.Path;
30 import java.nio.file.Paths;
31 import java.util.List;
32
33 import jdk.test.lib.process.OutputAnalyzer;
34 import jdk.test.lib.process.ProcessTools;
35 import jdk.test.lib.Utils;
36
37 /*
38 * @test
39 * @bug 7104647 7154822
40 * @summary Unit test for jcmd utility. The test will send different diagnostic
41 * command requests to the current java process.
42 *
43 * @library /test/lib
44 *
45 * @run main/othervm -XX:+UsePerfData TestJcmdSanity
46 */
47 public class TestJcmdSanity {
48
49 private static final String TEST_SRC = System.getProperty("test.src").trim();
50 private static final String[] VM_ARGS = new String[] { "-XX:+UsePerfData" };
51 private static final String JCMD_COMMAND_REGEX = "(\\w|\\.)*";
52 private static final String PERF_COUNTER_REGEX = "(\\w|\\.)*\\=.*";
53
54 public static void main(String[] args) throws Exception {
55 testJcmdPidHelp();
56 testJcmdPidHelpHelp();
57 testJcmdPid_f();
58 testJcmdPidPerfCounterPrint();
59 testJcmdPidBigScript();
60 }
61
62 /**
63 * jcmd -J-XX:+UsePerfData pid help
64 */
|