test/jdk/sun/tools/jcmd/TestProcessHelper.java
changeset 54460 6733a9176cce
parent 53707 67537bbafd7f
child 55386 2f4e214781a1
child 58678 9cf78a70fa4f
--- a/test/jdk/sun/tools/jcmd/TestProcessHelper.java	Mon Apr 08 15:01:39 2019 +0100
+++ b/test/jdk/sun/tools/jcmd/TestProcessHelper.java	Mon Apr 08 17:09:02 2019 +0000
@@ -108,7 +108,7 @@
                     for (String a : arg) {
                         cmd.add(a);
                     }
-                    testProcessHelper(cmd);
+                    testProcessHelper(cmd, TEST_PROCESS_MAIN_CLASS);
                 }
             }
         }
@@ -130,7 +130,7 @@
                 for (String a : arg) {
                     cmd.add(a);
                 }
-                testProcessHelper(cmd);
+                testProcessHelper(cmd, jarFile.getAbsolutePath());
             }
         }
 
@@ -156,7 +156,7 @@
                         for (String a : arg) {
                             cmd.add(a);
                         }
-                        testProcessHelper(cmd);
+                        testProcessHelper(cmd, MODULE_NAME + "/" + TEST_PROCESS_MAIN_CLASS);
                     }
                 }
             }
@@ -171,7 +171,7 @@
         }
     }
 
-    private void testProcessHelper(List<String> args) throws Exception {
+    private void testProcessHelper(List<String> args, String expectedValue) throws Exception {
         ProcessBuilder pb = new ProcessBuilder(args);
         String cmd = pb.command().stream().collect(Collectors.joining(" "));
         System.out.println("Starting the process:" + cmd);
@@ -179,7 +179,7 @@
         if (!p.isAlive()) {
             throw new RuntimeException("Cannot start the process: " + cmd);
         }
-        checkMainClass(p, TEST_PROCESS_MAIN_CLASS);
+        checkMainClass(p, expectedValue);
     }
 
     private File prepareJar() throws Exception {