JUnit Report single page XSLT for email

2019-07-16 06:04发布

问题:

I have a Junit process that runs a bunch of data integrity tests every night, and I would like to have it email the results in a nicely formatted HTML email. The issue is the HTML formatter built into JUnit uses frames and an external stylesheet so it is not appropriate for email. The plain formatter has the results buried in the midst of a bunch of otherwise worthless data.

I thought it would be simple to find a XSLT stylesheet that formatted the XML output into an email-friendly format, but after a couple hours of googling, I have not been able to find one. If any of you have a email-friendly Junit formatter, I'd be eternally grateful.

回答1:

From http://ant.apache.org/manual/Tasks/junitreport.html

Ant assumes the following concerning the frames and noframes formats :

The frames format uses a stylesheet which is generating output only by redirecting.

The noframes format does not use redirecting and generates one file called junit-noframes.html.

Custom versions of junit-frames.xsl or junit-noframes.xsl must adhere to the above conventions.

Edit: The only web aviable source in here



回答2:

Use the one that Ant's <junitreport> to create the HTML report and email that.



标签: xslt email junit