-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
Allow functionality of Suite, Parameterized and BlockJUnit4ClassRunnerWithParameters to be reused in custom Runners #1338
Comments
We don't have a schedule for 4.13. In the past we did releases when someone had time to do the work. Perhaps we should start by tagging bugs and pull requests that we want to go in 4.13. Adding public methods to these classes that would only used for code reuse seems odd. The average user would be confused about when to use them. Extracting a class with helper methods might make more sense. The only downside is we would need to support these methods forever so it might make maintenance a pain. What would a parameterized suite look like? What happens when you try to run one class of the suite in isolation in an IDE? JUnit5 doesn't have a Runner abstraction, and instead has other extension points. Have you looked at those? |
Hi @kcooney ,
I have solutions for these, but I think they should be left as implementation details to the users. Again, first of all we need to have the functionality of Suite, Parameterized etc. accessible to reuse it.
That would be ok for me. I also thought about separate helper classes in the first place, but I thought the functionality of these would be too tightly coupled to the original classes. In addition, users in general use How many of these helper classes would you like to have and how would you name them?
From
From
Yes, I had a look at these and I find them very promising! However I wanted to provide a near-term solution for JUnit 4. When will JUnit 5 be released? |
@kcooney , I'd appreciate a feedback on short notice :-) |
@PeterWippermann JUnit 5 M1 was released last week. The roadmap for the GA release is available here: https://github.com/junit-team/junit5/wiki#roadmap |
I am sick so I have been slow to respond. I guess it depends on how willing the team is to support these proposed public methods going forward given that we would almost certainly not implement a parameterized suite in JUnit 4.x. I haven't had time to take a look at those APIs. Given that 4.13 won't be released for several months you would have to copy and paste anyway for the time being, so I suggest not waiting on us to add the APIs. |
@kcooney I understand, although that's a bit disappointing. |
Yes, we will maintain JUnit 4 afterwards. |
Didn't mean to imply that we would not maintain 4.x. Most of the team is focused on 5.x so responses to pull requests has been slower than normal. Also, for larger changes, we have sometimes asked if the user has considered 5.x, which slows discussions and reduces the number of commits. One advantage to trying what you want in 5.x is it would give us additional feedback on the 5.x APIs. |
That's good news!
|
@PeterWippermann I couldn't find most of the methods you wanted to extract. Why don't you send us a pull where you just change them to public static methods, and we'll see which ones make sense to make visible externally and where they belong? |
For the period before this issue can be solved, I set up a project that provides exactly this functionality and makes it available for reuse: https://github.com/PeterWippermann/parameterized-suite |
As of version 4.12 there is much encapsulated functionality in
Suite
,Parameterized
andBlockJUnit4ClassRunnerWithParameters
, which is hidden in private methods and not available for custom implementations ofRunner
for reuse.I find it very interesting to implement a parameterized Suite. But since accessing the code of the already existing classes is not possible, I'd have to copy a lot of private methods from there. Instead I'd like to refactor the classes and make this functionality publicly available via
static
methods, e.g. from Parameterized:public static allParameters(TestClass)
.If I prepare a pull request for these changes, would it be accepted by the team? Does is make sense at all in regard to the upcoming release of JUnit5? When will JUnit 4.13 be released?
The text was updated successfully, but these errors were encountered: