How to get DATE and TIME in junitreport

P

peter doyle

i'm running junit from an ant build file - and viewing the resulting
xml (transformed by the stylesheet) in my browser

is there a way to force junit to report the DATE and TIME that the
test results were produced ??

thanks

peter.
(e-mail address removed)
 
R

R. Kevin Cole

You can customize junit's stylesheet by adding "Date" to the namespace
as in

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
xmlns:Date="http://www.saxon.com/java/java.util.Date" >

then insert the date elsewhere in the stylesheet, something like this:

Last Modified: <xsl:value-of select="Date:toString(Date:new())" />

Ant's optional.jar library contains two JUnit stylesheets called junit-frames.xsl and
junit-noframes.xsl that can be extracted and modified.


Hope this helps,

Kevin
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,434
Messages
2,571,689
Members
48,796
Latest member
Greg L.

Latest Threads

Top