Forum Discussion

Jacob_Hassing's avatar
Jacob_Hassing
Contributor
16 years ago

junit report from SoapUIProTestCaseRunner

hi i run a test suite from junit,
i want to generate a junit style report from the run, and i am really guessin here as i cant find it documented.

i have following testcase :
SoapUIProTestCaseRunner runner = new SoapUIProTestCaseRunner();
WsdlProject project = new WsdlProject("F:\\Test\\Soapui\\soapui-project.xml" );

JUnitReportCollector reportCollector = new JUnitReportCollector();
System.setProperty("script.library", "F:\\Test\\Soapui\\scripts");
runner.setProjectFile( "F:\\Test\\Soapui\\soapui-project.xml" );
runner.setEndpoint("http://andenserver:8085/danid/services/IdentityServiceV1R13");
runner.setSettingsFile("C:\\Users\\mwl\\soapui-settings.xml");
runner.setTestSuite("theSuite");
runner.run();
runner.exportJUnitReports(reportCollector, "C:\\Users\\mwl\\tmp", project);

i have tried putting exportJUnitReports before and after run method.
i both cases i get an empty junit report

3 Replies

  • Hi!

    What about the following instead:

    SoapUIProTestCaseRunner runner = new SoapUIProTestCaseRunner();
    System.setProperty("script.library", "F:\\Test\\Soapui\\scripts");
    runner.setProjectFile( "F:\\Test\\Soapui\\soapui-project.xml" );
    runner.setEndpoint("http://andenserver:8085/danid/services/IdentityServiceV1R13");
    runner.setSettingsFile("C:\\Users\\mwl\\soapui-settings.xml");
    runner.setTestSuite("theSuite");           
    runner.setJUnitReports( true );
    runner.setOutputFolder( "C:\\Users\\mwl\\tmp" )
    runner.run();     

    ?

    Does that work ok?

    regards!

    /Ole
    eviware.com
  • chen's avatar
    chen
    Occasional Contributor
    Hi,

    Dealing with the same issue, your example:


    SoapUIProTestCaseRunner runner = new SoapUIProTestCaseRunner();
    System.setProperty("script.library", "F:\\Test\\Soapui\\scripts");
    runner.setProjectFile( "F:\\Test\\Soapui\\soapui-project.xml" );
    runner.setEndpoint("http://andenserver:8085/danid/services/IdentityServiceV1R13");
    runner.setSettingsFile("C:\\Users\\mwl\\soapui-settings.xml");
    runner.setTestSuite("theSuite");
    runner.setJUnitReports( true );
    runner.setOutputFolder( "C:\\Users\\mwl\\tmp" )
    runner.run();


    is generating HTML report as well.
    is there a way to use SoapUIProTestCaseRunner (not SoapUITestCaseRunner) to generate junit report in xml format only?
    I've noticed this method setReportFormats(String[]) but couldn't get it to work or control the report format.
    Your help is appreciated.

    Thanks,
    Chen.
  • Hi!

    no, currently it will always generate both the junit xml and corresponding html report. The Report-Format option is for the printable reports, so they are probably not what you want anyway.

    regards!

    /Ole
    eviware.com