Forum Discussion

ripplegupta's avatar
ripplegupta
Contributor
9 years ago

URGENT HELP!! How do I begin to implement a custom JUnitReportCollector?

I have already seen lot of blogs and post but not much clear about how can i modify existing junitreportcollector class to generate custom report. I need success test step as well in my report.

 

My current implementation just run mvn test over xml file like:

 

<plugin>
<groupId>com.smartbear</groupId>
<artifactId>ready-api-maven-plugin</artifactId>
<version>${readyApiVersion}</version>

<dependencies>
<dependency>
<groupId>com.microsoft.sqlserver</groupId>
<artifactId>sqljdbc4</artifactId>
<version>${sqlVersion}</version>
</dependency>
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>${pgVersion}</version>
</dependency>
</dependencies>
<executions>
<execution>
<phase>test</phase>
<goals>
<goal>test</goal>
</goals>
<configuration>
<projectFile>${basedir}/scripts/dortal/myproject.xml</projectFile>
<outputFolder>${basedir}/target/surefire-reports</outputFolder>
<testSuite>${soapui.test-suite}</testSuite>
<testCase>${soapui.test-case}</testCase>
<junitReport>true</junitReport>
<printReport>true</printReport>
<environment>Default environment</environment>
<settingsFile>${basedir}/soapui-settings.xml</settingsFile>
<projectProperties>
<value>JDBC=${sqlJdbc}</value>
<value>qe_id=${Id}</value>
<value>AuthEndpoint=${AuthEndpoint}</value>
</projectProperties>
</configuration>
</execution>
</executions>
</plugin>

 

Can somebody help here?

  • Any help?

    Only thing i am stuck on is how to instantiate my custom class using standard licensed plugin.

    • rupert_anderson's avatar
      rupert_anderson
      Valued Contributor

      Hi,

       

      Do you mean you have written a custom Java or Groovy class that you want to use with SoapUI?

       

      Have you seen the standard way to add libraries to SoapUI:

       

      http://rupertanderson.com/blog/1-how-to-develop-add-and-use-a-custom-groovy-library-in-soapui/

       

      ?

       

      The same approach can be used when running from Maven, but the location of the bin/ext folder defaults to the Maven project root. It can also be set by a parameter mvn integration-test "-Dsoapui.ext.libraries=src/test/resources"

       

      Is this anything like what you mean't?

       

      Regards,

      Rupert

      • ripplegupta's avatar
        ripplegupta
        Contributor

        Hi Rupert, thanks for answering.

         

        I wanted to use method of my class named "MyJunitReportCollector" instead of  "JunitReportCollector" that is used by default in ready api maven plugin. Something like method override.

         

        But looks like that is not allowed but we can add listeners having my custom code that can run after each step and server my purpose.

         

        I have groovy code that do step level reporting but i want that to add in my repo instead of  of in events in project.