test/hotspot/jtreg/serviceability/dcmd/framework/InvalidCommandTest.java
changeset 53707 67537bbafd7f
parent 47216 71c04702a3d5
child 54460 6733a9176cce
--- a/test/hotspot/jtreg/serviceability/dcmd/framework/InvalidCommandTest.java	Thu Feb 07 09:55:57 2019 +0100
+++ b/test/hotspot/jtreg/serviceability/dcmd/framework/InvalidCommandTest.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
@@ -33,6 +33,7 @@
  * @test
  * @summary Test of invalid diagnostic command (tests all DCMD executors)
  * @library /test/lib
+ *          /vmTestbase
  * @modules java.base/jdk.internal.misc
  *          java.compiler
  *          java.management
@@ -53,7 +54,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 +72,7 @@
     public void jmx() {
         run(new JMXExecutor());
     }
+
+    private static class Process extends TestJavaProcess {
+    }
 }