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);
}
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);
}
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);
}
use of jdk.testlibrary.OutputAnalyzer in project jdk8u_jdk by JetBrains.
the class TestJstatdUsage method testUsage.
private static void testUsage(String option) throws Exception {
JDKToolLauncher launcher = JDKToolLauncher.createUsingTestJDK("jstatd");
launcher.addToolArg(option);
ProcessBuilder processBuilder = new ProcessBuilder(launcher.getCommand());
OutputAnalyzer output = new OutputAnalyzer(processBuilder.start());
output.shouldContain("usage: jstatd [-nr] [-p port] [-n rminame]");
output.shouldHaveExitValue(1);
}
use of jdk.testlibrary.OutputAnalyzer in project jdk8u_jdk by JetBrains.
the class TestJpsJarRelative method main.
public static void main(String[] args) throws Throwable {
String testJdk = System.getProperty("test.jdk", "?");
String testSrc = System.getProperty("test.src", "?");
File jar = JpsHelper.buildJar("JpsBase");
List<String> cmd = new ArrayList<>();
cmd.addAll(JpsHelper.getVmArgs());
cmd.add("-Dtest.jdk=" + testJdk);
cmd.add("-Dtest.src=" + testSrc);
cmd.add("-jar");
cmd.add("." + File.separator + jar.getName());
cmd.add("monkey");
ProcessBuilder processBuilder = ProcessTools.createJavaProcessBuilder(cmd.toArray(new String[cmd.size()]));
OutputAnalyzer output = new OutputAnalyzer(processBuilder.start());
System.out.println(output.getOutput());
output.shouldHaveExitValue(0);
}
Aggregations