Hi,
Quite often when contributing in JBoss projects, I create extra
protected methods (i.e. setters)
to make my life a lot simpler when coding unit tests. People have
different opinions (such as
the messaging guys who believe every single UT should be coded to the
public API), but I
personally believe that you shouldn't be necessarily forced to set up
a complete environment
to run a specific UT. There're a lot of situations where it makes
sense to do this, but others where
not, and in the latter, having "shortcut" set up methods helps.
Sometimes, this "shortcut" methods are already there but other times
are not, hence my tendency
to create these protected methods. Now, wouldn't it be nice if
there's a Java tag
that could be applied to this methods to indicate that:
"this method is only here to make my unit-testing-coding-life easier
and so, should only be called from
unit tests, not from production code"
I had a quick look around and could not find anything. Do people
agree/disagree with creating such tag?
Cheers,
Galder