< prev index next >

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

Print this page

        

@@ -31,25 +31,21 @@
 
 import org.testng.annotations.Test;
 
 /*
  * @test
- * @bug 8221730
  * @summary Test of diagnostic command VM.version (tests all DCMD executors)
  * @library /test/lib
  *          /vmTestbase
+ * @build   TestJavaProcess
  * @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.*");
     }
 

@@ -58,38 +54,14 @@
         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);
+        TestProcessLauncher t = new TestProcessLauncher(Process.class.getName());
         try {
             t.launch();
-            String moduleName = t.getModuleName();
-            run(new MainClassJcmdExecutor(moduleName));
+            run(new MainClassJcmdExecutor(Process.class.getName()));
         } finally {
             t.quit();
         }
     }
 

@@ -101,6 +73,7 @@
     @Test
     public void jmx() {
         run(new JMXExecutor());
     }
 
+    private static class Process extends TestJavaProcess{}
 }
< prev index next >