test/hotspot/jtreg/serviceability/dcmd/framework/TestProcessLauncher.java
changeset 54460 6733a9176cce
parent 53707 67537bbafd7f
--- a/test/hotspot/jtreg/serviceability/dcmd/framework/TestProcessLauncher.java	Mon Apr 08 15:01:39 2019 +0100
+++ b/test/hotspot/jtreg/serviceability/dcmd/framework/TestProcessLauncher.java	Mon Apr 08 17:09:02 2019 +0000
@@ -26,6 +26,9 @@
 import nsk.share.jpda.*;
 import nsk.share.jdi.*;
 
+import java.nio.file.FileSystems;
+import java.nio.file.Path;
+
 /**
  * Launches a new Java process that uses a communication pipe to interact
  * with the test.
@@ -33,7 +36,10 @@
 
 public class TestProcessLauncher {
 
-    private final String className;
+    protected static final Path USER_DIR = FileSystems.getDefault().getPath(System.getProperty("user.dir", "."));
+    protected static final Path TEST_CLASSES_DIR = FileSystems.getDefault().getPath(System.getProperty("test.classes"));
+
+    protected final String className;
     private final ArgumentHandler argHandler;
 
     private IOPipe pipe;
@@ -55,7 +61,7 @@
         Binder binder = new Binder(argHandler, log);
         binder.prepareForPipeConnection(argHandler);
 
-        String cmd = java + " " + className + " -pipe.port=" + argHandler.getPipePort();
+        String cmd = prepareLaunch(java, argHandler.getPipePort());
 
         Debugee debuggee = binder.startLocalDebugee(cmd);
         debuggee.redirectOutput(log);
@@ -75,4 +81,8 @@
         }
     }
 
+    protected String prepareLaunch(String javaExec, String pipePort) {
+        return  javaExec + " " + className + " -pipe.port=" + pipePort;
+    }
+
 }