tags:

views:

31

answers:

2

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.

A: 

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

duffymo
+1  A: 

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

Alejandro
The noframes option is close to what I'm looking for, but since it still sticks all the style information up in the <head> tag, most web email clients ignore it and display the results unstyled. I'll use the junit-noframes.xsl as a starting point then and just build it custom.
John P
@John P: Good practice (CSS vs inline @style) looks like it makes your task harder. But even M$ Outl**k can handle this HTML format...
Alejandro