Forum Discussion
14 years ago
Hi,
The JUnitReportCollector is a listener object, so needs to be attached to the test cases as they run so that it can gather all of the information it needs.
Currently you are creating a JUnitReportCollector correctly, but not attaching it to the project so it's not getting chance to gather information. Pretty simple fix, just attach the collector to your project ... something like ...
Hopefully that helps
All the best!
<-- awesome, bloke with an afro!! 
The JUnitReportCollector is a listener object, so needs to be attached to the test cases as they run so that it can gather all of the information it needs.
Currently you are creating a JUnitReportCollector correctly, but not attaching it to the project so it's not getting chance to gather information. Pretty simple fix, just attach the collector to your project ... something like ...
def currentProject = new com.eviware.soapui.impl.wsdl.WsdlProjectPro("$projectFullLocation")
def projectRunner=new com.eviware.soapui.SoapUIProTestCaseRunner('ProjectRunner')
def reportCollector = new com.eviware.soapui.report.JUnitReportCollector();
// Attach report collector to project
currentProject.addProjectRunListener(reportCollector)
projectRunner.setIgnoreError(true)
projectRunner.setJUnitReport(true)
projectRunner.setOutputFolder(reportingFolder.toString()+ "/" +currentProject.getName())
projectRunner.runProject(currentProject);
projectRunner.exportJUnitReports(reportCollector, reportingFolder.toString()+ "/"
+ currentProject.getName(), currentProject);
Hopefully that helps
All the best!
<-- awesome, bloke with an afro!! 