< prev index next >

test/hotspot/jtreg/serviceability/dcmd/framework/VMVersionTest.java

Print this page

        

*** 31,55 **** import org.testng.annotations.Test; /* * @test - * @bug 8221730 * @summary Test of diagnostic command VM.version (tests all DCMD executors) * @library /test/lib * /vmTestbase * @modules java.base/jdk.internal.misc - * java.base/jdk.internal.module * java.compiler * java.management * jdk.internal.jvmstat/sun.jvmstat.monitor * @run testng/othervm -XX:+UsePerfData VMVersionTest */ public class VMVersionTest { - - private static final String TEST_PROCESS_CLASS_NAME = process.TestJavaProcess.class.getName(); - public void run(CommandExecutor executor) { OutputAnalyzer output = executor.execute("VM.version"); output.shouldMatch(".*(?:HotSpot|OpenJDK).*VM.*"); } --- 31,51 ---- import org.testng.annotations.Test; /* * @test * @summary Test of diagnostic command VM.version (tests all DCMD executors) * @library /test/lib * /vmTestbase + * @build TestJavaProcess * @modules java.base/jdk.internal.misc * java.compiler * java.management * jdk.internal.jvmstat/sun.jvmstat.monitor * @run testng/othervm -XX:+UsePerfData VMVersionTest */ public class VMVersionTest { public void run(CommandExecutor executor) { OutputAnalyzer output = executor.execute("VM.version"); output.shouldMatch(".*(?:HotSpot|OpenJDK).*VM.*"); }
*** 58,95 **** run(new PidJcmdExecutor()); } @Test public void mainClass() { ! TestProcessLauncher t = new TestProcessLauncher(TEST_PROCESS_CLASS_NAME); ! try { ! t.launch(); ! run(new MainClassJcmdExecutor(TEST_PROCESS_CLASS_NAME)); ! } finally { ! t.quit(); ! } ! } ! ! @Test ! public void mainClassForJar() { ! TestProcessJarLauncher t = new TestProcessJarLauncher(TEST_PROCESS_CLASS_NAME); ! try { ! t.launch(); ! String jarFile = t.getJarFile(); ! run(new MainClassJcmdExecutor(jarFile)); ! } finally { ! t.quit(); ! } ! } ! ! @Test ! public void mainClassForModule() { ! TestProcessModuleLauncher t = new TestProcessModuleLauncher(TEST_PROCESS_CLASS_NAME); try { t.launch(); ! String moduleName = t.getModuleName(); ! run(new MainClassJcmdExecutor(moduleName)); } finally { t.quit(); } } --- 54,67 ---- run(new PidJcmdExecutor()); } @Test public void mainClass() { ! TestProcessLauncher t = new TestProcessLauncher(Process.class.getName()); try { t.launch(); ! run(new MainClassJcmdExecutor(Process.class.getName())); } finally { t.quit(); } }
*** 101,106 **** --- 73,79 ---- @Test public void jmx() { run(new JMXExecutor()); } + private static class Process extends TestJavaProcess{} }
< prev index next >