RFR: 8332922: Test java/io/IO/IO.java fails when /usr/bin/expect not exist [v2]
SendaoYan
syan at openjdk.org
Sun May 26 07:24:17 UTC 2024
On Sun, 26 May 2024 06:16:44 GMT, Alan Bateman <alanb at openjdk.org> wrote:
>> test/jdk/java/io/IO/IO.java line 64:
>>
>>> 62: expect = Paths.get("/usr/bin/expect"); // os-specific path
>>> 63: if (!Files.exists(expect) || !Files.isExecutable(expect)) {
>>> 64: System.out.println("jtreg.SkippedException: '" + expect + "' not found");
>>
>> SkippedException works with jtreg tests only. For jUnit you need to use [Assumptions.abort](https://junit.org/junit5/docs/5.9.1/api/org.junit.jupiter.api/org/junit/jupiter/api/Assumptions.html#abort(java.lang.String))
>
>> SkippedException works with jtreg tests only. For jUnit you need to use [Assumptions.abort](https://junit.org/junit5/docs/5.9.1/api/org.junit.jupiter.api/org/junit/jupiter/api/Assumptions.html#abort(java.lang.String))
>
> Yes, the Assumptions API should be used here. We use that in several JUnit tests that skip when tests when they can't run and you want it to fail the test.
Thanks for the review and suggest. The code has been updated according the suggest. Thanks.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/19403#discussion_r1615075147
More information about the core-libs-dev
mailing list