This could be factored out into a reusable AssertionSet class, perhaps
AssertionSet as=new AssertionSet();
as.assertTrue(.... )
as.assertFalse(....)
as.checkAssertions()
each assert in the set would, if failing, create an exception (and
stack trace) and record that with the string in a list of
failedAsserts. Then the final checkAssertions() method would, if the
asserts list were non empty, print everything out then throw an
overall assert (maybe one that nests all the others)
Alternatively, you could set up all your tests to write to class
variables and then have a whole slew of other tests performing
assertions on the values that you've stored.
If you do it, the exception thrown at the end should be able to
contain all the exceptions/assertions raised, so that the right
reporting tools and formats can handle the lot of them. Selenium can
generate multiple results from a single test case already.
-steve
http://jira.opensymphony.com/browse/TESTNG-177
-Dan