-
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
Listener based Runner #874
Comments
Please note that this is very similar to the I am the author of the Spring TestContext Framework. Thus, if the JUnit team is considering a listener-based API as a plug-in model for JUnit, I would be very happy to participate in such discussions. |
Hi, @sbrannen . Looks like a very clean API. Could you describe some of the benefits of this API outside of spring? |
Looking closer, an API like this is one possible solution to the prolem that people want Rules that act on the class and method level (possibility removing the need for some cases where people create custom runners today) |
There are in fact quite a few, and I could probably write an entire book on the subject. So I'll do my best to briefly outline some of the major benefits here. ;) In general, the For example, Spring's The This wrapped ordering allows additional All Another point of interest is that separate listeners can communicate with each other via the All of the code in the Spring TestContext Framework (TCF) (aside from the In other words, every
That's correct: it could be a viable alternative. However, the From a design perspective, the only thing Spring-specific about the core internals of the TCF is that the Most of this is documented in the Testing chapter of the Spring Reference Manual, but if you have further questions, don't hesitate to ask. Cheers, Sam |
Hi @sbrannen, You have right. The first idea comes from spring test framework. Unfortunately i was not allowed to use Spring. |
Aha. That's why it looked so familiar. ;) Naturally, if JUnit were to adopt such a listener-based API for pluggable extensions, it would have to be generic enough to support any third parties (Spring included). As I mentioned above, the only part of the core of the Spring TestContext Framework (TCF) that is actually tied to Spring (in terms of the It's a common misconception that the TCF can only be used with application contexts, dependency injection, and integration tests. This is, however, simply not true. The TCF can in fact be used in unit testing, and more importantly: the TCF works fine without an Now, having said all that, I realize that the TCF has a natural tie to Spring since it physically has dependencies on |
Hi Junit team,
I like your framework it is very useful for me. The only thing what is a bit pain for me is that how to extend your framework with multiple requirement.
Please see my extension https://bitbucket.org/gege83/junit-extension/wiki/Home
If you can use please notify me.
Thankyou
The text was updated successfully, but these errors were encountered: