Skip to content

Commit c9edb91

Browse files
committed
Backport 7e4cb2f09d1219c6ba7bfa77be831a7c7c9b055a
1 parent f30379b commit c9edb91

File tree

1 file changed

+66
-28
lines changed

1 file changed

+66
-28
lines changed

test/lib/jdk/test/lib/process/ProcessTools.java

Lines changed: 66 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -401,12 +401,21 @@ private static void printStack(Thread t, StackTraceElement[] stack) {
401401
}
402402

403403
/**
404-
* Create ProcessBuilder using the java launcher from the jdk to be tested.
405-
* The default jvm options from jtreg, test.vm.opts and test.java.opts, are added.
406-
* <p>
407-
* The command line will be like:
408-
* {test.jdk}/bin/java {test.vm.opts} {test.java.opts} cmds
409-
* Create ProcessBuilder using the java launcher from the jdk to be tested.
404+
* Create ProcessBuilder using the java launcher from the jdk to
405+
* be tested. The default jvm options from jtreg, test.vm.opts and
406+
* test.java.opts, are added.
407+
*
408+
* <p>Unless the "test.noclasspath" property is "true" the
409+
* classpath property "java.class.path" is appended to the command
410+
* line and the environment of the ProcessBuilder is modified to
411+
* remove "CLASSPATH". If the property "test.thread.factory" is
412+
* provided the command args are updated and appended to invoke
413+
* ProcessTools main() and provide the name of the thread factory.
414+
*
415+
* <p>The "-Dtest.thread.factory" is appended to the arguments
416+
* with the thread factory value. The remaining command args are
417+
* scanned for unsupported options and are appended to the
418+
* ProcessBuilder.
410419
*
411420
* @param command Arguments to pass to the java command.
412421
* @return The ProcessBuilder instance representing the java command.
@@ -416,12 +425,21 @@ public static ProcessBuilder createTestJavaProcessBuilder(List<String> command)
416425
}
417426

418427
/**
419-
* Create ProcessBuilder using the java launcher from the jdk to be tested.
420-
* The default jvm options from jtreg, test.vm.opts and test.java.opts, are added.
421-
* <p>
422-
* The command line will be like:
423-
* {test.jdk}/bin/java {test.vm.opts} {test.java.opts} cmds
424-
* Create ProcessBuilder using the java launcher from the jdk to be tested.
428+
* Create ProcessBuilder using the java launcher from the jdk to
429+
* be tested. The default jvm options from jtreg, test.vm.opts and
430+
* test.java.opts, are added.
431+
*
432+
* <p>Unless the "test.noclasspath" property is "true" the
433+
* classpath property "java.class.path" is appended to the command
434+
* line and the environment of the ProcessBuilder is modified to
435+
* remove "CLASSPATH". If the property "test.thread.factory" is
436+
* provided the command args are updated and appended to invoke
437+
* ProcessTools main() and provide the name of the thread factory.
438+
*
439+
* <p>The "-Dtest.thread.factory" is appended to the arguments
440+
* with the thread factory value. The remaining command args are
441+
* scanned for unsupported options and are appended to the
442+
* ProcessBuilder.
425443
*
426444
* @param command Arguments to pass to the java command.
427445
* @return The ProcessBuilder instance representing the java command.
@@ -445,6 +463,18 @@ public static ProcessBuilder createTestJavaProcessBuilder(String... command) {
445463
* it in combination with <b>@requires vm.flagless</b> JTREG
446464
* anotation as to not waste energy and test resources.
447465
*
466+
* <p>Unless the "test.noclasspath" property is "true" the
467+
* classpath property "java.class.path" is appended to the command
468+
* line and the environment of the ProcessBuilder is modified to
469+
* remove "CLASSPATH". If the property "test.thread.factory" is
470+
* provided the command args are updated and appended to invoke
471+
* ProcessTools main() and provide the name of the thread factory.
472+
*
473+
* <p>The "-Dtest.thread.factory" is appended to the arguments
474+
* with the thread factory value. The remaining command args are
475+
* scanned for unsupported options and are appended to the
476+
* ProcessBuilder.
477+
*
448478
* @param command Arguments to pass to the java command.
449479
* @return The ProcessBuilder instance representing the java command.
450480
*/
@@ -467,6 +497,18 @@ public static ProcessBuilder createLimitedTestJavaProcessBuilder(List<String> co
467497
* it in combination with <b>@requires vm.flagless</b> JTREG
468498
* anotation as to not waste energy and test resources.
469499
*
500+
* <p>Unless the "test.noclasspath" property is "true" the
501+
* classpath property "java.class.path" is appended to the command
502+
* line and the environment of the ProcessBuilder is modified to
503+
* remove "CLASSPATH". If the property "test.thread.factory" is
504+
* provided the command args are updated and appended to invoke
505+
* ProcessTools main() and provide the name of the thread factory.
506+
*
507+
* <p>The "-Dtest.thread.factory" is appended to the arguments
508+
* with the thread factory value. The remaining command args are
509+
* scanned for unsupported options and are appended to the
510+
* ProcessBuilder.
511+
*
470512
* @param command Arguments to pass to the java command.
471513
* @return The ProcessBuilder instance representing the java command.
472514
*/
@@ -475,14 +517,12 @@ public static ProcessBuilder createLimitedTestJavaProcessBuilder(String... comma
475517
}
476518

477519
/**
478-
* Executes a test jvm process, waits for it to finish and returns the process output.
479-
* The default jvm options from jtreg, test.vm.opts and test.java.opts, are added.
480-
* The java from the test.jdk is used to execute the command.
481-
* <p>
482-
* The command line will be like:
483-
* {test.jdk}/bin/java {test.vm.opts} {test.java.opts} cmds
484-
* <p>
485-
* The jvm process will have exited before this method returns.
520+
* Executes a test jvm process, waits for it to finish and returns
521+
* the process output.
522+
*
523+
* <p>The process is created using runtime flags set up by:
524+
* {@link #createTestJavaProcessBuilder(String...)}. The
525+
* jvm process will have exited before this method returns.
486526
*
487527
* @param cmds User specified arguments.
488528
* @return The output from the process.
@@ -492,14 +532,12 @@ public static OutputAnalyzer executeTestJvm(List<String> cmds) throws Exception
492532
}
493533

494534
/**
495-
* Executes a test jvm process, waits for it to finish and returns the process output.
496-
* The default jvm options from jtreg, test.vm.opts and test.java.opts, are added.
497-
* The java from the test.jdk is used to execute the command.
498-
* <p>
499-
* The command line will be like:
500-
* {test.jdk}/bin/java {test.vm.opts} {test.java.opts} cmds
501-
* <p>
502-
* The jvm process will have exited before this method returns.
535+
* Executes a test jvm process, waits for it to finish and returns
536+
* the process output.
537+
*
538+
* <p>The process is created using runtime flags set up by:
539+
* {@link #createTestJavaProcessBuilder(String...)}. The
540+
* jvm process will have exited before this method returns.
503541
*
504542
* @param cmds User specified arguments.
505543
* @return The output from the process.

0 commit comments

Comments
 (0)