Skip to content

Commit

Permalink
8318962: Update ProcessTools javadoc with suggestions in 8315097
Browse files Browse the repository at this point in the history
Backport-of: 7e4cb2f09d1219c6ba7bfa77be831a7c7c9b055a
  • Loading branch information
GoeLin committed Apr 5, 2024
1 parent 40b1c4b commit 85ca789
Showing 1 changed file with 66 additions and 28 deletions.
94 changes: 66 additions & 28 deletions test/lib/jdk/test/lib/process/ProcessTools.java
Original file line number Diff line number Diff line change
Expand Up @@ -492,12 +492,21 @@ private static void printStack(Thread t, StackTraceElement[] stack) {
}

/**
* Create ProcessBuilder using the java launcher from the jdk to be tested.
* The default jvm options from jtreg, test.vm.opts and test.java.opts, are added.
* <p>
* The command line will be like:
* {test.jdk}/bin/java {test.vm.opts} {test.java.opts} cmds
* Create ProcessBuilder using the java launcher from the jdk to be tested.
* Create ProcessBuilder using the java launcher from the jdk to
* be tested. The default jvm options from jtreg, test.vm.opts and
* test.java.opts, are added.
*
* <p>Unless the "test.noclasspath" property is "true" the
* classpath property "java.class.path" is appended to the command
* line and the environment of the ProcessBuilder is modified to
* remove "CLASSPATH". If the property "test.thread.factory" is
* provided the command args are updated and appended to invoke
* ProcessTools main() and provide the name of the thread factory.
*
* <p>The "-Dtest.thread.factory" is appended to the arguments
* with the thread factory value. The remaining command args are
* scanned for unsupported options and are appended to the
* ProcessBuilder.
*
* @param command Arguments to pass to the java command.
* @return The ProcessBuilder instance representing the java command.
Expand All @@ -507,12 +516,21 @@ public static ProcessBuilder createTestJavaProcessBuilder(List<String> command)
}

/**
* Create ProcessBuilder using the java launcher from the jdk to be tested.
* The default jvm options from jtreg, test.vm.opts and test.java.opts, are added.
* <p>
* The command line will be like:
* {test.jdk}/bin/java {test.vm.opts} {test.java.opts} cmds
* Create ProcessBuilder using the java launcher from the jdk to be tested.
* Create ProcessBuilder using the java launcher from the jdk to
* be tested. The default jvm options from jtreg, test.vm.opts and
* test.java.opts, are added.
*
* <p>Unless the "test.noclasspath" property is "true" the
* classpath property "java.class.path" is appended to the command
* line and the environment of the ProcessBuilder is modified to
* remove "CLASSPATH". If the property "test.thread.factory" is
* provided the command args are updated and appended to invoke
* ProcessTools main() and provide the name of the thread factory.
*
* <p>The "-Dtest.thread.factory" is appended to the arguments
* with the thread factory value. The remaining command args are
* scanned for unsupported options and are appended to the
* ProcessBuilder.
*
* @param command Arguments to pass to the java command.
* @return The ProcessBuilder instance representing the java command.
Expand All @@ -536,6 +554,18 @@ public static ProcessBuilder createTestJavaProcessBuilder(String... command) {
* it in combination with <b>@requires vm.flagless</b> JTREG
* anotation as to not waste energy and test resources.
*
* <p>Unless the "test.noclasspath" property is "true" the
* classpath property "java.class.path" is appended to the command
* line and the environment of the ProcessBuilder is modified to
* remove "CLASSPATH". If the property "test.thread.factory" is
* provided the command args are updated and appended to invoke
* ProcessTools main() and provide the name of the thread factory.
*
* <p>The "-Dtest.thread.factory" is appended to the arguments
* with the thread factory value. The remaining command args are
* scanned for unsupported options and are appended to the
* ProcessBuilder.
*
* @param command Arguments to pass to the java command.
* @return The ProcessBuilder instance representing the java command.
*/
Expand All @@ -558,6 +588,18 @@ public static ProcessBuilder createLimitedTestJavaProcessBuilder(List<String> co
* it in combination with <b>@requires vm.flagless</b> JTREG
* anotation as to not waste energy and test resources.
*
* <p>Unless the "test.noclasspath" property is "true" the
* classpath property "java.class.path" is appended to the command
* line and the environment of the ProcessBuilder is modified to
* remove "CLASSPATH". If the property "test.thread.factory" is
* provided the command args are updated and appended to invoke
* ProcessTools main() and provide the name of the thread factory.
*
* <p>The "-Dtest.thread.factory" is appended to the arguments
* with the thread factory value. The remaining command args are
* scanned for unsupported options and are appended to the
* ProcessBuilder.
*
* @param command Arguments to pass to the java command.
* @return The ProcessBuilder instance representing the java command.
*/
Expand All @@ -566,14 +608,12 @@ public static ProcessBuilder createLimitedTestJavaProcessBuilder(String... comma
}

/**
* Executes a test jvm process, waits for it to finish and returns the process output.
* The default jvm options from jtreg, test.vm.opts and test.java.opts, are added.
* The java from the test.jdk is used to execute the command.
* <p>
* The command line will be like:
* {test.jdk}/bin/java {test.vm.opts} {test.java.opts} cmds
* <p>
* The jvm process will have exited before this method returns.
* Executes a test jvm process, waits for it to finish and returns
* the process output.
*
* <p>The process is created using runtime flags set up by:
* {@link #createTestJavaProcessBuilder(String...)}. The
* jvm process will have exited before this method returns.
*
* @param cmds User specified arguments.
* @return The output from the process.
Expand All @@ -583,14 +623,12 @@ public static OutputAnalyzer executeTestJvm(List<String> cmds) throws Exception
}

/**
* Executes a test jvm process, waits for it to finish and returns the process output.
* The default jvm options from jtreg, test.vm.opts and test.java.opts, are added.
* The java from the test.jdk is used to execute the command.
* <p>
* The command line will be like:
* {test.jdk}/bin/java {test.vm.opts} {test.java.opts} cmds
* <p>
* The jvm process will have exited before this method returns.
* Executes a test jvm process, waits for it to finish and returns
* the process output.
*
* <p>The process is created using runtime flags set up by:
* {@link #createTestJavaProcessBuilder(String...)}. The
* jvm process will have exited before this method returns.
*
* @param cmds User specified arguments.
* @return The output from the process.
Expand Down

1 comment on commit 85ca789

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.