Prompted by extreme need, I've added per-module unit tests to the jboss 4 build system.
Put your test classes in src/test/<same package as the class they test>
They will be compiled to output/test and output/get/test
To use, add this to your module build file, right before the output (jar) target:
<target name="tests" depends="_default:tests"/>
./build.sh tests -Dtest.pattern=**/MyOwnUnitTestCase*
to match just some tests.
I'm using this for the common and system modules.
I suggest we use these module test targets for real unit tests of anything that doesn't need all of JBoss running. For instance, I have several tests of ServiceController etc that only require an mbean server to be started.
TODO: collect all the results together with the main testsuite for the test report.