test/hotspot/jtreg/serviceability/dcmd/framework/VMVersionTest.java
changeset 53707 67537bbafd7f
parent 47216 71c04702a3d5
child 54460 6733a9176cce
--- a/test/hotspot/jtreg/serviceability/dcmd/framework/VMVersionTest.java	Thu Feb 07 09:55:57 2019 +0100
+++ b/test/hotspot/jtreg/serviceability/dcmd/framework/VMVersionTest.java	Fri Feb 08 09:41:45 2019 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -27,6 +27,7 @@
 import jdk.test.lib.dcmd.MainClassJcmdExecutor;
 import jdk.test.lib.dcmd.FileJcmdExecutor;
 import jdk.test.lib.dcmd.JMXExecutor;
+import nsk.share.jdi.ArgumentHandler;
 
 import org.testng.annotations.Test;
 
@@ -34,6 +35,8 @@
  * @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
@@ -53,7 +56,13 @@
 
     @Test
     public void mainClass() {
-        run(new MainClassJcmdExecutor());
+        TestProcessLauncher t = new TestProcessLauncher(Process.class.getName());
+        try {
+            t.launch();
+            run(new MainClassJcmdExecutor(Process.class.getName()));
+        } finally {
+            t.quit();
+        }
     }
 
     @Test
@@ -65,4 +74,6 @@
     public void jmx() {
         run(new JMXExecutor());
     }
+
+    private static class Process extends TestJavaProcess{}
 }