ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Benz, Michael" <michael.b...@cgi.com>
Subject junit: Custom Formatter - Access to TestCase
Date Tue, 18 Aug 2009 09:42:39 GMT
Dear users,
 
we extended 'junit.framework.TestCase' (let's call it CustomTestCase) to include some custom
information about a test run. Basically we execute a bunch of TestSteps in a TestCase, gather
the results and evaluate in the end. We would like to write this information to xml, with
a custom junit formatter, for further processing.
 
Now the problem is, that we only have access to a 'junit.framework.JUnit4TestCaseFacade' in
an implementation of JUnitResultFormatter. There doesn't seem to be a way to access the 'original'
CustomTestCase objects, which we would need to include the gathered results in the xml file.
The only way we could think of solving this problem is to store the data in a static way,
so we're then able to access it from the JUnitResultFormatter implementation. But that's kinda
ugly :)
 
Are we missing something? Did anyone else encounter similar problems with extending the JUnitResultFormatter?
How can we get access to our CustomTestCase objects in an 'elegant' way?
 
We found a bug somewhat related to this problem: 'https://issues.apache.org/bugzilla/show_bug.cgi?id=38999'
Although it was fixed by introducing a helper class that retrieves the correct class name
but not the actual class/object.
 
We're using Ant 1.7.1.
 
Cheers,
Michael
 
----
Michael Benz
CGI Information Systems and Management Consultants (Deutschland) GmbH
Niederkasseler Lohweg 175 - 40547 Düsseldorf - Germany


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message