jdk/test/com/sun/tools/attach/StartManagementAgent.java
changeset 25182 1f6766bac82c
parent 24980 dbf4ae2cafa4
child 25983 12cac8cfce4a
--- a/jdk/test/com/sun/tools/attach/StartManagementAgent.java	Tue Jul 01 11:47:36 2014 +0200
+++ b/jdk/test/com/sun/tools/attach/StartManagementAgent.java	Tue Jul 01 15:00:33 2014 +0200
@@ -40,7 +40,7 @@
  * @test
  * @summary Test for VirtualMachine.startManagementAgent and VirtualMachine.startLocalManagementAgent
  * @library /lib/testlibrary
- * @run build Application Shutdown
+ * @run build Application jdk.testlibrary.*
  * @run main StartManagementAgent
  */
 
@@ -51,20 +51,17 @@
  */
 public class StartManagementAgent {
     public static void main(String[] args) throws Throwable {
-        final String pidFile = "StartManagementAgent.Application.pid";
         ProcessThread processThread = null;
-        RunnerUtil.ProcessInfo info = null;
         try {
-            processThread = RunnerUtil.startApplication(pidFile);
-            info = RunnerUtil.readProcessInfo(pidFile);
-            runTests(info.pid);
+            processThread = RunnerUtil.startApplication();
+            runTests(processThread.getPid());
         } catch (Throwable t) {
             System.out.println("StartManagementAgent got unexpected exception: " + t);
             t.printStackTrace();
             throw t;
         } finally {
             // Make sure the Application process is stopped.
-            RunnerUtil.stopApplication(info.shutdownPort, processThread);
+            RunnerUtil.stopApplication(processThread);
         }
     }
 
@@ -104,7 +101,7 @@
 
     private static final int MAX_RETRIES = 10;
 
-    public static void runTests(int pid) throws Exception {
+    public static void runTests(long pid) throws Exception {
         VirtualMachine vm = VirtualMachine.attach(""+pid);
         try {