Skip to content
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

Consider migrating from JUnit 3/4 to JUnit Jupiter & JUnit 5 #189

Open
jbduncan opened this issue Jan 14, 2018 · 1 comment
Open

Consider migrating from JUnit 3/4 to JUnit Jupiter & JUnit 5 #189

jbduncan opened this issue Jan 14, 2018 · 1 comment

Comments

@jbduncan
Copy link
Contributor

If we decide this is worth doing, we will have to take the following things into account.

  1. We should prefer JUnit Jupiter API's assertThrows over the try..fail..catch idiom
  2. We might want to use assertAll over just writing assertions one line after another, so that all potential assertion errors can be gathered and thrown together as one exception for easier debugging.
  3. We'll have to use assertTimeout or assertTimeoutPreemptively where we would have used @Test(timeout=...) or @Rule public Timeout timeout = ...
  4. We should consider using assertIterableEquals and assertLinesMatch where normal collection equality assertions are insufficient.
  5. And finally, if we use any custom @Rules or @Runners, we will need to find alternative extensions for JUnit Jupiter/5.
@jrtom
Copy link
Owner

jrtom commented Jan 16, 2018

I'm willing to consider this, but IMO, it's something we can address after 3.0 is released.
I'm more interested in adapting our tests to use Truth for most things, honestly.

Addressing a few of the points (in ignorance of how JUnit 5/Jupiter work, since I haven't used or researched them, just going from your description above):
(2) I have mixed feelings about assertAll. Seems like you might need fewer test runs to uncover all of your errors, but it might be harder to read the outputs.
(3) I think that this is a non-issue: none of our tests have timeouts at the moment (and I wouldn't expect them to need to).
(4) Using Truth should help considerably with these scenarios.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants