Want to create JUnit report programmatically? You have configured the junitreport ant task but you should also execute it.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | Project project = new Project(); project.setName("myproject"); project.init(); Target target = new Target(); target.setName("junitreport"); project.addTarget(target); FileSet fs = new FileSet(); fs.setDir(new File("./junitreports")); fs.createInclude().setName("*.xml"); XMLResultAggregator aggregator = new XMLResultAggregator(); aggregator.setProject(project); aggregator.addFileSet(fs); AggregateTransformer transformer = aggregator.createReport(); transformer.setTodir(new File("./testreport")); target.addTask(aggregator); project.executeTarget("junitreport"); |
If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.