If we have following test: class AAA{ public static Test suite() { TestSuite suite = new TestSuite(); suite.setName("AllTests"); TestSuite test1 = new TestSuite(); test1.setName("Test1"); test1.addTest(new ATestCase("testA")); test1.addTest(new ATestCase("testB")); TestSuite test2 = new TestSuite(); test2.setName("Test2"); test2.addTest(new BTestCase("testC")); test2.addTest(new BTestCase("testD")); suite.addTest(test1); suite.addTest(test2); return suite; } ...... After run tests - <junit> <test name="AAA" outfile="AAA" todir="AAA"/> <formatter type="xml"/> </junit> we have following XML: <testsuite errors="0" failures="0" name="AAA" tests="4" time="1.701"> .... <testcase classname="ATestCase" name="testA" time="0.047"/> <testcase classname="ATestCase" name="testB" time="0.047"/> <testcase classname="BTestCase" name="testC" time="0.047"/> <testcase classname="BTestCase" name="testD" time="0.047"/> .... <testsuite/> but is better to get like following: <testsuite errors="0" failures="0" name="AllTests" tests="4" time="1.701"> .... <testsuite errors="0" failures="0" name="Test1"> <testcase classname="ATestCase" name="testA" time="0.047"/> <testcase classname="ATestCase" name="testB" time="0.047"/> <testsuite/> <testsuite errors="0" failures="0" name="Test2"> <testcase classname="BTestCase" name="testC" time="0.047"/> <testcase classname="BTestCase" name="testD" time="0.047"/> <testsuite/> .... <testsuite/>
I agree, this would be nice. The current report doesn't really recognize suites, despite the element name "testsuite". It is organized by package and has only a single level of classes. I guess you want an option to organize the report by suite, and an intermediate XML format to support that. This might be appropriate for the legendary junit4 antlib.
See 48529. I did a patch for this, but it didn't get any attention right away. Don't know how hard it is to merge that to the latest version.
Duplicate of bug #48529?