RFR: 8354455: [TestBug] Remove JUnit Vintage Engine with JUnit 4 [v2]
Andy Goryachev
angorya at openjdk.org
Mon Apr 14 20:34:46 UTC 2025
On Sat, 12 Apr 2025 00:23:07 GMT, Marius Hanl <mhanl at openjdk.org> wrote:
>> These are the remaining bits and pieces in order to completely remove the JUnit Vintage Engine, and therefore JUnit 4 from JavaFX.
>> After that, we should either document, that JUnit5 is used (just as information) or close [JDK-8296284](https://bugs.openjdk.org/browse/JDK-8296284) (Since you can not use JUnit4 anymore).
>>
>> This also removes the `org.hamcrest` dependency, which is actually only used in one test where it can easily be replaced by a `Predicate` (instead of `Matcher`). I'm not convinced that we should keep that dependency for just one test.
>>
>> ~Note: I could not get the `:swt` tests to compile/test, in order to run the tests.
>> I need some guidance here how to instruct `Gradle` to compile this module (and if I need anything else? like swt?).~
>>
>> ~Also, this probably needs an extra ticket in the JBS?~
>
> Marius Hanl has updated the pull request incrementally with one additional commit since the last revision:
>
> Fix SWT Tests
The test run was successful on my macOS 15.4 running this command:
(git reflog -1; gradle --continue -PFULL_TEST=true -PUSE_ROBOT=true -PSWT_TEST=true cleanTest test --no-daemon -x :web:test --info 2>&1) | tee ~/`date +"test-%Y-%m%d-%H%M%S"`.log
... however, my test run is not indicative because of this:
SWT tests are disabled on MAC, because Gradle test runner does not handle -XstartOnFirstThread properly (https://issues.gradle.org/browse/GRADLE-3290).
```
we probably need to enable the SWT tests on mac because the issue seems to have been resolved in 2021:
https://github.com/gradle/gradle/issues/864
modules/javafx.swt/src/test/java/test/javafx/embed/swt/SWTTest.java line 46:
> 44: }
> 45:
> 46: protected final void runOnSwtThread(Runnable runnable) throws Throwable {
I like this solution - does not depend on whimsy of junit.
tests/system/src/test/java/test/robot/javafx/scene/NodeInitializationStressTest.java line 29:
> 27: import static org.junit.jupiter.api.Assertions.fail;
> 28: import static org.junit.jupiter.api.Assumptions.assumeFalse;
> 29:
oops, my mistake! thanks for correcting it.
-------------
Marked as reviewed by angorya (Reviewer).
PR Review: https://git.openjdk.org/jfx/pull/1774#pullrequestreview-2765009036
PR Comment: https://git.openjdk.org/jfx/pull/1774#issuecomment-2802912256
PR Review Comment: https://git.openjdk.org/jfx/pull/1774#discussion_r2042636260
PR Review Comment: https://git.openjdk.org/jfx/pull/1774#discussion_r2042550484
More information about the openjfx-dev
mailing list