commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rodney Waldhoff <rwaldh...@icarus.apache.org>
Subject [collections] maven test versus ant test
Date Thu, 31 Oct 2002 16:52:48 GMT
I notice that with collections at least, and probably other mavenized
commons projects, the command "ant test" and the command "maven test" run
different test suites.

On the ant side (build.xml), "ant test" runs the test suite defined by
org.apache.commons.collections.TestAll.

On the maven side (project.xml), "maven test" runs a suite of tests
defined (it seems) as everything under src/test, modulo a fairly
large number of abstract and TestAll classes enumerated in the project.xml
file. (And by the way, currently it seems there are at least some tests
not hooked in to the TestAll chain, notably ClassMap).

I think it's pretty obvious that we should keep the suites run by "ant
test" and "maven test" in sync, but I think I can justify it too: (1) gump
is running ant test, and so will not pick up failures if the two aren't in
sync (which is what's happening right now--TestClassMap fails, but gump's
not reporting it); (2) some developers are gonna use ant, some developers
are gonna use maven, so if the two test target/goals aren't in sync, we're
not all running the same tests.

The simplest way to cause this, it seems to me, is to simply include
"org/apache/commons/collections/TestAll.java" under <unitTest>, rather
than trying to enumerate the exclusions, which means developers need to
add an addTest call to TestAll when adding new TestCase classes (which is
a feature IMO).  This also changes the output so we see the results of the
whole suite summarized rather than TestCase by TestCase results.  Any
complaints or alternative solutions?

On a related note, one feature of the ant-based builds that I miss dearly
in maven is the "test.entry" convention, which allows one to call:
 ant test
  - to run all tests
 ant -Dtest.entry=org.apache.commons.foo.TestBar test
  - to run the tests in TestBar only
 ant -Dtest.entry=org.apache.commons.foo.TestAll test
  - to run all the tests in the foo package
which is extremely convienient when working with large test suites, or
when you're making rapid changes to a small set of classes.  I presume
there is some what to do something similiar with maven?

 - Rod


--
To unsubscribe, e-mail:   <mailto:commons-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:commons-dev-help@jakarta.apache.org>


Mime
View raw message