You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by "David C. Hicks" <dh...@i-hicks.org> on 2009/06/16 03:27:17 UTC

Quandary over testing support classes.

Hi gang,

I've been trying to find a reasonable solution to a problem we have with
our Maven-based project.  We have a collection of Builder classes that
can create Model objects for testing purposes.  These are segregated
into a separate module (TestSupport) which has the Model artifact as a
dependency.  This works great for almost everything.  The catch is that
the more complex Model classes have unit tests that rely on these
builders to make the test code easier to read and maintain.  So, in that
case the Model artifact would need to have the TestSupport artifact as a
dependency.  Obviously, this isn't going to fly.  For the time being,
the more complicated unit tests are being held in the TestSupport
module, but this really isn't where they belong.  We need to keep the
Builders in an artifact of their own because they are used by other
modules for unit and functional tests.

I can see an argument that I might hear, that the Model classes should
be simple beans - DTO's, if you will - that have no real need for unit
tests.  That's a step away from OO, though, isn't it?  Maybe we're
trying too hard to be as OO as possible?  I really don't like the idea
of stripping a class of its behavior.

On the other hand, maybe there's a better way to get my Maven build set
up that will solve this problem for me.

Any help?
Thanks,
Dave


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org