RFR: 8347359: RichTextArea API Tests [v8]

Andy Goryachev angorya at openjdk.org
Wed Apr 23 19:15:52 UTC 2025


On Tue, 22 Apr 2025 23:09:15 GMT, Kevin Rushforth <kcr at openjdk.org> wrote:

>> hmmm...  This pattern was copied from some other test.  We have 32 more instances of this pattern elsewhere.
>> 
>> I suspect it is not avoid declaring a checked exception.
>> What would you suggest?  Forward the `throwable` to `Thread.currentThread().getThreadGroup().uncaughtException(thread, throwable);` unconditionally?
>
> That's interesting that other tests do this. When re-throwing an exception you often need to special case checked exceptions (to wrap them so that the caller doesn't need to explicitly declare it), but the UncaughtExceptionHandler can handle both, so I don't know why it was done that way.
> 
> You might try just unconditionally forwarding all throwables, but not sure.

Turns out, this is required by junit framework to properly handle the failed tests.

If we pass all the Throwables to the thread group, then a RuntimeException thrown from a `@Test` does not mark the unit test as failed, though the stacktrace does appear in `stderr`;  a thrown `Error` will mark the test as failed.

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

PR Review Comment: https://git.openjdk.org/jfx/pull/1677#discussion_r2056736082


More information about the openjfx-dev mailing list