« Return to Thread: Recent check-in...

Re: Recent check-in...

by Raffael Herzog-2 :: Rate this Message:

Reply to Author | View in Thread

Am Freitag, 16. Mai 2008 17.23:36 schrieb James Carman:
> I just checked in some changes to the pom.xml files and moved the
> HiveMindTestCase into src/test.  Let me know how it looks for you.
> All test cases passed for me.  I might try to move stuff around into
> the "normal" maven directories, too (src/main/java, etc.)

Well, an open question about this is: How is a user supposed to use that
class now? Right, having it in HiveMind's core framework isn't a nice
solution. On the other hand, moving it to src/test makes this class
unusable for other projects, as it won't ever be included in any artifact.

To avoid dependencies on JUnit/EasyMock, it should actually be a separate
project producing a separate artifact, something like hivemind-test, which
users can include as dependency scoped test. Then again, a whole
sub-project for a single class file seems a bit ridiculous. Also, this
would introduce a circular dependency: HiveMind's test cases need
HiveMindTestCase, so hivemind-test would have to be built before
hivemind-framework. However, HiveMindTestCase won't compile if
hivemind-framework isn't built.

I think, keeping HiveMindTestCase in src/main and declaring the dependencies
on JUnit and EasyMock in the scope "test" is the better solution, if users
should be able to use that class in their own tests.

If JUnit and EasyMock are scoped "test", this scope will be included in the
test scope of projects that depend on hivemind-framework with scope "test"
and "runtime". Unfortunately, in 99% of the cases, my hivemind dependency
is scoped "provided", so I still would have to include them manually (if
I'd like to use HiveMindTestCase). I use TestNG anyway, however, and in my
case, unit tests *never* need HiveMind (maybe a few interfaces like Module
from it, but never a running registry), and assuming, that HiveMind works,
this is what EasyMock is for ... ;)

This throws us back at the question: Is there any need to provide
HiveMindTestCase to the user at all? Tests that need a running HiveMind
registry are integration tests, not unit tests, so users should have no
need for that class.

For a table of which scope translates to which scope in transitive
dependencies, see here:
http://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html#Dependency_Scope

Cheers,
   Raffi

--
The difference between theory and practice is that in theory, there is
no difference, but in practice, there is.

herzog@... · Jabber: herzog@...
PGP Key 0x5FFDB5DB5D1FF5F4 · http://keyserver.pgp.com

 « Return to Thread: Recent check-in...