On Mon, 15 Nov 2021 16:42:04 GMT, Michael Strauß <mstra...@openjdk.org> wrote:

> One comment about adding new JUnit 5 tests and migrating existing tests. I 
> think there could be value in organizing the tests such that all of the JUnit 
> 5 tests are grouped, rather than mixing tests in the same directory such that 
> some use JUnit 5 and others use JUnit 4. What do you (or others) think? We 
> could either do this with a new JUnit 5 source set in each project, or by 
> using a package naming convention for JUnit 5 tests like we do for robot 
> tests. Maybe `test5.some.pkg`. This needs more thought.

I don't think this is really needed, since the introduction of JUnit 5 I've 
written numerous tests in projects with the bulk of their test classes still 
using JUnit 4. In all cases, the new tests were just mixed with the old tests. 
The mixing of the tests has so far caused no confusion, and in these projects 
the teams involved also didn't feel any need to prioritize migrating all tests 
to JUnit 5. 

Conversion to JUnit 5 usually happens on a test by test basis when other 
changes are made to the test -- existing code is rewritten as needed, usually 
limited to introducing `assertThrows` to replace `@Test(expected = 
Throwable.class)` and updating all static asserts to use the `jupiter` package 
hierarchy instead of the `org.junit` one (just import changes).  Usually this 
is done in a separate commit (a "chore" commit) with another commit containing 
the actual change and new test cases.

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

PR: https://git.openjdk.java.net/jfx/pull/633

Reply via email to