Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » junitreport generates incorrect output when run w/ AntRunner
junitreport generates incorrect output when run w/ AntRunner [message #310091] Mon, 20 November 2006 21:45 Go to next message
Michael Giroux is currently offline Michael GirouxFriend
Messages: 287
Registered: July 2009
Senior Member
The junitreport ANT task is based on an xslt that makes stacktrace output
readable by replacing newlines with <br> tags. When junitreport is invoked
by AntRunner, the newlines are not replaced w/ <br> and appear to be deleted
completely.

I suspect this is due to the fact that the template calls extension
functions as in:
<xsl:template name="br-replace">
<xsl:param name="word"/>
<xsl:param name="br"><br/></xsl:param>
<xsl:value-of select='stringutils:replace(string($word),"&#xA;",$br)'/ >
</xsl:template>

the stringutils package is declared at the top of the template as:
xmlns:stringutils="xalan://org.apache.tools.ant.util.StringUtils"

but it does not appear to be processed.

I'm not expert here, so perhaps someone can give a hint as to what is not
configured correctly?

Or perhaps this is candidate for a bug report?

Thanks
Michael Giroux
Re: junitreport generates incorrect output when run w/ AntRunner [message #310106 is a reply to message #310091] Tue, 21 November 2006 15:51 Go to previous messageGo to next message
Michael Giroux is currently offline Michael GirouxFriend
Messages: 287
Registered: July 2009
Senior Member
It would seem that this issue is related to getting the correct version of
xalan onto the classpath. The junitreport task uses xalan to transform the
xml files into html. According to the XALAN document at
http://xml.apache.org/xalan-j/extensionslib.html the string extensions are
supported by default.

Suggestions, or pointers to documentation will be appreciated.

Michael
Re: junitreport generates incorrect output when run w/ AntRunner [message #310456 is a reply to message #310106] Mon, 04 December 2006 16:41 Go to previous messageGo to next message
Michael Giroux is currently offline Michael GirouxFriend
Messages: 287
Registered: July 2009
Senior Member
In my efforts to diagnose this issue, I have added some <xsl:comment>
entries to the xsl files
that I thought were being used in
eclipse\plugins\org.apache.ant_1.6.5\etc\junit-frames.xsl.
To my surprise, the comments were not included in the generated output.

I also added some java script comments (// some comment) to some of the
javascript
generation. These are not being emmitted either.

Finally I renamed the xsl files from junit-frames.xsl to xjunit-frames.xsl
to confirm that
these are the files being used. To my great surprise, the transformation
ran w/o error.

This leads to a question -
Where exactly is the AntRunner finding the xsl files for the <junitreport>
task?

Michael


"Michael Giroux" <michael.giroux@bull.com> wrote in message
news:ejv7a5$ai4$1@utils.eclipse.org...
> It would seem that this issue is related to getting the correct version of
> xalan onto the classpath. The junitreport task uses xalan to transform
> the xml files into html. According to the XALAN document at
> http://xml.apache.org/xalan-j/extensionslib.html the string extensions are
> supported by default.
>
> Suggestions, or pointers to documentation will be appreciated.
>
> Michael
>
Re: junitreport generates incorrect output when run w/ AntRunner [message #310459 is a reply to message #310456] Mon, 04 December 2006 17:27 Go to previous messageGo to next message
Michael Giroux is currently offline Michael GirouxFriend
Messages: 287
Registered: July 2009
Senior Member
"Michael Giroux" <michael.giroux@bull.com> wrote in message
news:el1j4i$t1u$1@utils.eclipse.org...
> This leads to a question -
> Where exactly is the AntRunner finding the xsl files for the <junitreport>
> task?

Well, I discovered that the template is coming from the ant-junit.jar in the
ant plugin. The <junitreport> task must specify styldir for the <report>
element to use files in any other location.

Michael
Re: junitreport generates incorrect output when run w/ AntRunner [message #310460 is a reply to message #310091] Mon, 04 December 2006 18:00 Go to previous message
Michael Giroux is currently offline Michael GirouxFriend
Messages: 287
Registered: July 2009
Senior Member
With some research, I have discovered that the problem is not related to
using AntRunner.

"Michael Giroux" <michael.giroux@bull.com> wrote in message
news:ejt7l9$on4$1@utils.eclipse.org...
> The junitreport ANT task is based on an xslt that makes stacktrace output
> readable by replacing newlines with <br> tags. When junitreport is
> invoked by AntRunner, the newlines are not replaced w/ <br> and appear to
> be deleted completely.
>
> I suspect this is due to the fact that the template calls extension
> functions as in:
> <xsl:template name="br-replace">
> <xsl:param name="word"/>
> <xsl:param name="br"><br/></xsl:param>
> <xsl:value-of select='stringutils:replace(string($word),"&#xA;",$br)'/ >
> </xsl:template>

The replace function is acting as if there is not replacement string and the
NL is being deleted completely.

I have changed the value of param br to other strings, and these are all
injected into the text, so it seems the problem has to do with the
definition of the replacement value.

I'll go off to the xalan mailing list to ask about this.

Michael
Previous Topic:Exception in thread "Java indexing" java.lang.OutOfMemoryError: Java heap space
Next Topic:Error Navigation
Goto Forum:
  


Current Time: Wed Jul 17 03:36:28 GMT 2024

Powered by FUDForum. Page generated in 0.03758 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top