Mar 08 2010
Generating JUnit XML output files from FitNesse
I just pushed a small change to JUnit integration support for FitNesse to github; hopefully this should be merged with Uncle Bob’s master branch soon. The change enables you to output test run stats in Junit XML files, which can then be picked up by Hudson, TeamCity and other CI servers and integrated into their test history statistics.
To enable this feature, override the default test listener in the JUnitHelper instance you use for test runs (third constructor argument), and supply a JUnitXMLTestListener instance passing the folder where you want the XML files in the constructor argument. For example:
String htmlOutputDir=new File(System.getProperty("java.io.tmpdir"),
"fitnesse").getAbsolutePath();
String xmlOutputDir=new File(System.getProperty("java.io.tmpdir"),
"fitnesse-xml").getAbsolutePath();
String fitNesseRootDir=".";
JUnitXMLTestListener xmlTestListener=new JUnitXMLTestListener(xmlOutputDir);
JUnitHelper helper =
new JUnitHelper(fitNesseRootDir,htmlOutputDir,xmlTestListener);
helper.assertTestPasses(".....");
Grab the source from my github repository. Also, check out the full example.
![]() |
![]() |


