On Wed, 23 Apr 2025 21:05:29 GMT, Alexander Zvegintsev <[email protected]>
wrote:
>> few more clipboard tests are opensourced. Some of them are in problemlist.
>
> Alexander Zvegintsev has updated the pull request incrementally with one
> additional commit since the last revision:
>
> use ProcessTools
test/jdk/java/awt/Clipboard/LostOwnershipChainTest/SystemClipboard2ProcTest.java
line 115:
> 113:
> 114: Process process = ProcessTools.startProcess("Child", pb);
> 115: OutputAnalyzer outputAnalyzer = new OutputAnalyzer(process);
OutputAnalyzer is not really needed here, as output is printed by
`ProcessTools`, exit value can be received from `process.exitValue()` , however
it brings the `shouldHaveExitValue` method and prints some useful info like:
Command line: [.../jdk/bin/java -cp ... -ea SystemClipboardOwner ]
[Child]:.../jdk/bin/java -cp ... -ea SystemClipboardOwner
[2025-04-23T20:51:22.569840505Z] Gathering output for process 165156
[2025-04-23T20:51:23.984714408Z] Waiting for completion for process 165156
[2025-04-23T20:51:23.984831108Z] Waiting for completion finished for process
165156
So I decided to use it.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/24806#discussion_r2056877831