I want to create test reports generated by JUnit / TestNG PROGRAMMATICALLY. So, that rules out ANT. My main concern is to generate XML files which are created by Junit while
You asked nearly the same here If you look at the TestNG doc you can use :
The org.testng.IReporter interface which only has one method: public void generateReport(List suites, String outputDirectory) This method will be invoked by TestNG when all the suites have been run and you can inspect its parameters to access all the information on the run that was just completed.