I would like to create junit report programmatically using ant. I’ve seen that this question has been asked before here: Ant:create JUnit report task programmatically and here: Creating JUnit report programmatically. My code is little different and I don’t know where all that stuff goes.
My code:
<?xml version="1.0" encoding="UTF-8"?>
<project name="myproject" default="junitreport" basedir=".">
<target name="junitreport">
<junitreport todir="./testreport">
<fileset dir="./junitreports">
<include name="*.xml"/>
</fileset>
<report format="noframes" todir="./testreport"/>
</junitreport>
</target>
</project>
Source code :
FileSet fs = new FileSet();
fs.setDir(new File("./junitreports"));
fs.createInclude().setName("*.xml");
XMLResultAggregator aggregator = new XMLResultAggregator();
aggregator.addFileSet(fs);
AggregateTransformer transformer = aggregator.createReport();
transformer.setTodir(new File("./testreport"));
Thanks in advance for your help.
You have configured the junitreport ant task but you should also execute it.