ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alex Ruiz" <>
Subject Extending JUnit Ant tasks
Date Sun, 10 Jun 2007 19:38:17 GMT
Hello all,

I've been trying to extend JUnit's report without success. The following are
some questions/comments about what I couldn't accomplish:

1. Ant's does
not offer any support for extensibility. It would be nice to have some
methods we could override to add some extra XML elements to the generated
XML report. For example, we can have the method 'protected void
onFailureOrError(Test test, Throwable error, Element errorElement)' which
can be overriden by users and add some extra elements to the XML element
containing the error information. Note that this method should not change
the behavior of XMLJUnitResultFormatter, it just lets users add extra
error/failure info.

2. In the same class it would be nice to have access to the XML document
(may be a protected getter?)

3. The method 'getTestCaseClassName(Test)' in '' is package
protected. Can it be changed to public?

4. I'm using my own XSL files for the junit report task. The problem is that
I need to hook up my own XSL extensions. This is what I have:

<xsl:stylesheet xmlns:xsl="" version="

and in the body of the XSL file I have:
    <xsl:value-of select="java:

and when running my Ant build I get the following:
[junitreport] Loading stylesheet
[junitreport] : Error! Cannot find class 'org.fest.swing.junit.ImageHandler
[junitreport] : Error! Cannot find external method '
org.fest.swing.junit.ImageHandler.decodeBase64AndSaveAsPng' (must be
[junitreport] : Fatal Error! Could not compile stylesheet

I haven't found a way to specify my own class in the junitreport tag. Any

Any help will be greatly appreciated!


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