Re: Rework runner concept / intellij or eclipse formatter file?
Stephen Connolly <[email protected]> Fri, 28 Jun 2013 13:49:21 +0100
| Newsgroups | gmane.comp.java.junit.user |
|---|---|
| Message-ID | <CA+nPnMw=G+2gjX6ZztwZVgRfXgSGMPyP1KAYFXC=81Z0Rxm_Ag@mail.gmail.com> |
I think part of the issue is that some people have used runners where rules
would do...
IMHO where a runner makes "sense" is in things like @Theory which mutate
the one-to-one mapping between test methods and tests.
Similarly for data driven tests, etc.
To my mind, a runner should be used for those cases where a single test
method gets reused multiple times, or perhaps where test sequencing is
being applied (though a unit test anti pattern)
As such the runner should actually be a meta annotation on the test
indicator annotation and applying it to the test class is an anti pattern
applied as a short cut to annotation scanning to identify test indicator
annotations and their corresponding runner meta-annotations.
The "injection" use case of test runners should be easy to implement as
@Rule which just leaves rule sequencing to be ensured as deterministic.
My 0.02
On Friday, 28 June 2013, Henning Groß wrote:
> I think the runner concept is one of the bigger flaws in junit. If you want
> a certain behaviour you need to use a specific runner. Often you will want
> more than just one behaviour. For example you may want the spring runner
> with junit and jparams behaviour. Sometimes you will find a way to makr
> that work. Sometimes you just dont. A rework of the runner-concept,
> introducing something like a chain for the behaviour-part would be a good
> idea, i guess. This could either be achieved by introducing a runner that
> does the work or by introducing this concept deeper into the framework. How
> are your thoughts on this? It could only work well when introduced to junit
> and the old concept would get marked deprecated as this makes
> runner-providers like spring migrate to the new concept. I would be willing
> to give it a try and implement this if you think its a good idea. Another
> thing: anyone got junit formatter file?
> Regards, Henning
>
>
> [Non-text portions of this message have been removed]
>
>
>
> ------------------------------------
>
> Yahoo! Groups Links
>
>
>
>
--
Sent from my phone
[Non-text portions of this message have been removed]
------------------------------------
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/junit/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.yahoo.com/group/junit/join
(Yahoo! ID required)
<*> To change settings via email:
[email protected]
[email protected]
<*> To unsubscribe from this group, send an email to:
[email protected]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/