On Wed, Oct 27, 2010 at 11:55 AM, Mark Volkmann
<[email protected]>wrote:
>
>
> I wonder though if most people still give their test methods names
> that begin with "test". I do. One reason is so the test methods stand
> out in my IDE within the list of methods in the class. I want some way
> to visually distinguish between test methods and utility methods
> within the test class.
>
Yes but this can be easily solved with a tool. Writing an updated Eclipse
Outline view to group methods by annotations is a matter of a few hours. Hey
I might even go ahead and write it myself.
The thing is: most of the methods in my tests classes are test methods, so
the need for this is not that high, at least to me.
As for naming, yes, old habits die hard and it's easy to just start your
method name with "test", but I find myself being more and more creative with
this now ("shouldThrowException", "userShouldBePresent", etc...). And I
always have the handy `description` attribute if I am in a verbose mood
(@Test(description = "Make sure we have exactly one user named Smith in the
db"), something that you can't do without annotations.
--
Cédric
--
You received this message because you are subscribed to the Google Groups "The
Java Posse" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/javaposse?hl=en.