-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RunTestOnContext for JUnit 5 #100
Comments
Good idea @DavideD, would you like to try to contribute it? |
I can try but I might need some help. |
I think yes you can copy or take inspiration from what's been done there. |
@DavideD any progress on this contribution? |
No, sorry. I didn't have time |
jUnit5 has a mechanism for intercepting test method calls. This could be used to get a Vert.x context then run the test on this context. @jponge the jUnit5 documentation says checkpoints shouldn't be used on Vert.x threads. Can you explain why? This could be a problem if running tests on a Vert.x context. |
That might be a bad explanation in the docs then, can you please point me to the corresponding sentence? |
https://vertx.io/docs/vertx-junit5/java/#_checkpoint_when_there_are_multiple_success_conditions
|
Makes sense. Checkpoints shall be created from the test main thread (e.g., when you enter a test method). Then checkpoints shall be used from anywhere else (e.g., flagging from a callback). This is because we had some users who created new checkpoints on the fly, like in the middle of a callback, but the main test context had already completed because it could not have anticipated that they would even exist. |
Ok. Perhaps we should change the tip wording then, it is confusing. |
Closes eclipse-vertx#100 vertx-unit has a RunTestOnContext rule that had no equivalent in vertx-junit5. Signed-off-by: Thomas Segismont <tsegismont@gmail.com>
There is this rule available for JUnit 4:
It would be nice to have something similar for JUnit 5.
Probably an extension.
The text was updated successfully, but these errors were encountered: