Re: [Net] JUnit 5 migration discussion

2024-03-04 Thread Elric V
Following Rob's suggestion, I migrated FTPSClientTest from @Parameterized to @Nested The result so far can be found here: https://github.com/apache/commons-net/pull/227/commits/b14ee39cca486bda106758a48d31c91ad52d0d83 Basically the test methods were moved from FTPSClientTest.java [1] to Abst

Re: [Net] JUnit 5 migration discussion

2024-03-01 Thread Elric V
On 01/03/2024 16:53, Rob Spoor wrote: You can turn the current parameterized test into an abstract base class; you can even nest it in another class. Then for each set of parameters you use an @Nested sub class that fills in the parameters in the call to its super constructor. Thanks Rob & Al

Re: [Net] JUnit 5 migration discussion

2024-03-01 Thread Rob Spoor
Inheriting test methods and @BeforeEach / @AfterEach methods works just fine. I even have a project that provides interfaces with default test methods. Just implementing these interfaces gives classes all of the test methods. If you override methods, you have to repeat the annotation though. I

Re: [Net] JUnit 5 migration discussion

2024-02-29 Thread Alex Herbert
Use of abstract classes does work in JUnit 5. I've written a lot of JUnit 5 tests that use abstract test classes which define the @ParameterizedTest/@Test fixtures and then concrete child classes that are run by the framework. It is supported but IIRC it is not recommended in the JUnit 5 documentat

Re: [Net] JUnit 5 migration discussion

2024-02-29 Thread sebb
Would it make sense to just convert the JUnit 3 tests to JUnit4? Or would that be a waste of time? On Thu, 29 Feb 2024 at 21:19, Gary Gregory wrote: > > Oops, I mean TestNG. > > Gary > > On Thu, Feb 29, 2024, 3:41 PM Gary Gregory wrote: > > > Thank you for digging into this Eric. > > > > Another

Re: [Net] JUnit 5 migration discussion

2024-02-29 Thread Gary Gregory
Oops, I mean TestNG. Gary On Thu, Feb 29, 2024, 3:41 PM Gary Gregory wrote: > Thank you for digging into this Eric. > > Another component to consider for JUnit 5 migration is Commons VFS. This > one is challenging due to some similar JUnit 3 and 4 heritage issues. > > It is possible that betwee

Re: [Net] JUnit 5 migration discussion

2024-02-29 Thread Gary Gregory
Thank you for digging into this Eric. Another component to consider for JUnit 5 migration is Commons VFS. This one is challenging due to some similar JUnit 3 and 4 heritage issues. It is possible that between Net and VFS, what we need are custom JUnit extensions. I had started a Commons Testing r

[Net] JUnit 5 migration discussion

2024-02-29 Thread Elric V
Hi folks, I recently made some changes to commons-cli to move it from JUnit 4 to JUnit 5. This was mostly straightforward, and I think it went pretty well. Currently looking into doing the same for commons-net, but there are a couple of tricky tests that probably require some up front discuss