Running SoapUI Integration Tests in Hudson

Recently i’ve been wondering how to automate webservice(SOAP) integration tests. My first idea was to use soamoa, but it seems a bit buggy at the moment and the last version seems quite a while ago.

But SoapUI does offer a native maven plugin, which can run SoapUI testcases directly. So I set up a small maven project, and add a soapUI testcase like this:

<build>
 <plugins>
   <plugin>
     <groupId>eviware</groupId>
     <artifactId>maven-soapui-plugin</artifactId>
     <version>3.6.1</version>
     <executions>
       <execution>
         <id>SoapUITest1</id>
         <configuration>
           <projectFile>src/test/soapui/SoapUITest1-project.xml</projectFile>
           <outputFolder>${project.build.directory}/surefire-reports</outputFolder>
           <junitReport>true</junitReport>
           <exportAll>true</exportAll>
           <printReport>false</printReport>
         </configuration>
         <goals>
           <goal>test</goal>
         </goals>
         <phase>test</phase>
       </execution>
     </executions>
    </plugin>
  </plugins>
 </build>

Now, when i run “mvn test” from the command line, everything looks fine and the tests get correctly executed. But after I import the project in Hudson, i can’t see the test results 🙁 This seems to be a bug in Hudson, the only workaround at this point seems to create a freeform project in hudson instead of a maven2 one, add a maven2 step (mvn test), then add “**/target/surefire-reports/*.xml” under “Publish junit test results”. Now Hudson correctly does display all test results on the project page.

The only point left is to run multiple SoapUI projects from one maven project, for this one needs to add multiple <execution> tags, maybe the future versions of the soapui-maven-plugin will support easier configuration.

This entry was posted in java, Testing and tagged , , , . Bookmark the permalink.

Leave a Reply