On Mon, 11 Dec 2023 09:15:50 GMT, Stefan Karlsson <stef...@openjdk.org> wrote:

> [JDK-8315097](https://bugs.openjdk.org/browse/JDK-8315097): 'Rename 
> createJavaProcessBuilder' changed the name of the ProcessTools helper 
> functions used to create `ProcessBuilder`s used to spawn new java test 
> processes.
> 
> We now have `createTestJavaProcessBuilder` and 
> `createLimitedTestJavaProcess`. The former prepends jvm options from jtreg, 
> while the latter doesn't.
> 
> With these functions it is common to see the following pattern in tests:
> 
> ProcessBuilder pb = ProcessTools.createTestJavaProcessBuilder(...);
> OutputAnalyzer output = executeProcess(pb);
> 
> 
> We have a couple of thin wrapper in `ProcessTools` that does exactly this, so 
> that the code can be written as a one-liner:
> 
> OutputAnalyzer output = ProcessTools.executeTestJvm();
> 
> 
> I propose that we name this functions using the same naming scheme we used 
> for `createTestJavaProcessBuilder` and `createLimitedTestJavaProcessBuilder`. 
> That is, we change `executeTestJvm` to `executeTestJava` and add a new 
> `executeLimitedTestJava` function.

This pull request has now been integrated.

Changeset: cbe329b9
Author:    Stefan Karlsson <stef...@openjdk.org>
URL:       
https://git.openjdk.org/jdk/commit/cbe329b90ac1488836d4852fead79aa26c082114
Stats:     262 lines in 89 files changed: 73 ins; 1 del; 188 mod

8321713: Harmonize executeTestJvm with create[Limited]TestJavaProcessBuilder

Reviewed-by: lkorinth, lmesnik

-------------

PR: https://git.openjdk.org/jdk/pull/17049

Reply via email to