You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by Erik Hatcher <er...@earthlink.net> on 2001/06/04 04:11:48 UTC
JUnit task - capturing system state with results
I'm starting to make a patch to the JUnit task such that it captures a
snapshot of the system state as part of the test results. What properties
should be captured to give the necessary information for interpretting test
results?
Currently I'm grabbing these:
Project.getUserProperties()
Project.getProperties()
Should I be capturing anything else? I'm mirroring the behavior of the
properties by first building a collection from getUserProperties and then
overlaying any non-existing properties into it from getProperties, so that
getUserProperties takes precedence. If this is not correct, please let me
know.
I have (locally only, of course) modified the JUnitTask.java file to capture
these properties and will also be modifying XMLJUnitResultFormatter.java
file to pull these properties from the JUnitTest instance and put them into
the XML result as well as add the output of these properties in XSL so that
the <junitreport> tag will include this in the HTML results.
Any comments or suggestions before I get too deep into this? There are
only a few places that I'll be modifying code, it seems, though. I'll
forward my code modifications back to this list for review and inclusion as
soon as I implement these changes.
Thanks,
Erik
Re: JUnit task - capturing system state with results
Posted by Stefan Bodewig <bo...@apache.org>.
Erik Hatcher <er...@earthlink.net> wrote:
> Currently I'm grabbing these:
>
> Project.getUserProperties()
> Project.getProperties()
user-properties are a subset of properties, so you might as well stick
to the later.
> Should I be capturing anything else?
Various versions: JDK, Ant, JUnit if possible, OS - see what the test
target it Ant's own build file does. All these things are properties,
but they have a special meaning and are worth to be listed separately
IMHO.
> I have (locally only, of course) modified the JUnitTask.java file to
> capture these properties and will also be modifying
> XMLJUnitResultFormatter.java file to pull these properties from the
> JUnitTest instance and put them into the XML result as well as add
> the output of these properties in XSL so that the <junitreport> tag
> will include this in the HTML results.
Maybe it would be better to add a setContext - or the like - method to
JUnitResultFormatter where you pass in all the stuff and let the
Formatters decide what they want to do with the information?
Cheers
Stefan