Search in sources :

Example 46 with OutputAnalyzer

use of jdk.testlibrary.OutputAnalyzer in project jdk8u_jdk by JetBrains.

the class TestJcmdDefaults method testJcmdUsage.

/**
     * jcmd -J-XX:+UsePerfData -h
     * jcmd -J-XX:+UsePerfData -help
     */
private static void testJcmdUsage(String... jcmdArgs) throws Exception {
    OutputAnalyzer output = JcmdBase.jcmdNoPid(VM_ARGS, jcmdArgs);
    assertNotEquals(output.getExitValue(), 0);
    verifyOutputAgainstFile(output);
}
Also used : OutputAnalyzer(jdk.testlibrary.OutputAnalyzer)

Example 47 with OutputAnalyzer

use of jdk.testlibrary.OutputAnalyzer in project jdk8u_jdk by JetBrains.

the class TestJcmdSanity method testJcmdPidBigScript.

/**
     * Tests that it possible send a file over 1024 bytes large via jcmd -f.
     *
     * jcmd -J-XX:+UsePerfData pid -f dcmd-big-script.txt
     */
private static void testJcmdPidBigScript() throws Exception {
    File scrpitFile = new File(TEST_SRC, "dcmd-big-script.txt");
    OutputAnalyzer output = JcmdBase.jcmd(VM_ARGS, new String[] { "-f", scrpitFile.getAbsolutePath() });
    output.shouldHaveExitValue(0);
    output.shouldNotContain("Exception");
    output.shouldContain(System.getProperty("java.vm.name").trim());
}
Also used : OutputAnalyzer(jdk.testlibrary.OutputAnalyzer) File(java.io.File)

Example 48 with OutputAnalyzer

use of jdk.testlibrary.OutputAnalyzer in project jdk8u_jdk by JetBrains.

the class TestJcmdSanity method testJcmdPidHelpHelp.

/**
     * jcmd -J-XX:+UsePerfData pid help help
     */
private static void testJcmdPidHelpHelp() throws Exception {
    OutputAnalyzer output = JcmdBase.jcmd(VM_ARGS, new String[] { "help", "help" });
    output.shouldHaveExitValue(0);
    verifyOutputAgainstFile(output);
}
Also used : OutputAnalyzer(jdk.testlibrary.OutputAnalyzer)

Example 49 with OutputAnalyzer

use of jdk.testlibrary.OutputAnalyzer in project jdk8u_jdk by JetBrains.

the class TestJcmdSanity method testJcmdPid_f.

/**
     * jcmd -J-XX:+UsePerfData pid -f dcmd-script.txt
     */
private static void testJcmdPid_f() throws Exception {
    File scrpitFile = new File(TEST_SRC, "dcmd-script.txt");
    OutputAnalyzer output = JcmdBase.jcmd(VM_ARGS, new String[] { "-f", scrpitFile.getAbsolutePath() });
    output.shouldHaveExitValue(0);
    verifyOutputAgainstFile(output);
}
Also used : OutputAnalyzer(jdk.testlibrary.OutputAnalyzer) File(java.io.File)

Example 50 with OutputAnalyzer

use of jdk.testlibrary.OutputAnalyzer in project jdk8u_jdk by JetBrains.

the class JstatdTest method runToolsAndVerify.

private void runToolsAndVerify() throws Exception {
    OutputAnalyzer output = runJps();
    verifyJpsOutput(output);
    output = runJstat();
    verifyJstatOutput(output);
}
Also used : OutputAnalyzer(jdk.testlibrary.OutputAnalyzer)

Aggregations

OutputAnalyzer (jdk.testlibrary.OutputAnalyzer)54 File (java.io.File)5 JDKToolLauncher (jdk.testlibrary.JDKToolLauncher)5 ArrayList (java.util.ArrayList)4 PortUnreachableException (java.net.PortUnreachableException)1 LocateRegistry (java.rmi.registry.LocateRegistry)1 Registry (java.rmi.registry.Registry)1 KeyStore (java.security.KeyStore)1 X509Certificate (java.security.cert.X509Certificate)1 Date (java.util.Date)1 HashMap (java.util.HashMap)1 List (java.util.List)1 MissingResourceException (java.util.MissingResourceException)1 ProcessThread (jdk.testlibrary.ProcessThread)1