Forum Discussion
Maybe it is better if i reply to my topic after two edits. It seems that Jetty is preventing my method from returning. I have seen that there i an option called "No block" for maven to avoid this type of behaviour. Does anyone have a clue about how to use it, or have something equivalent programatically? I will investigate further but I really would appreciate your help.
Thank you,
Harald
Hi Harald,
Yes, I have use the Maven nonblock option and it does certainly work i.e. if you have a SoapUI project where you need to start the mock first and then progress to run your TestCase, then the noBlock option will allow the Maven script to start the mock and then continue running the tests and exit automatically once they are complete.
Here is an example pom.xml:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>soapui.cookbook.chapter5</groupId>
<artifactId>simple-test</artifactId>
<packaging>jar</packaging>
<version>1.0-SNAPSHOT</version>
<name>simple-test</name>
<url>http://maven.apache.org</url>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
</dependencies>
<pluginRepositories>
<pluginRepository>
<id>SmartBearPluginRepository</id>
<url>http://www.soapui.org/repository/maven2/</url>
</pluginRepository>
</pluginRepositories>
<build>
<plugins>
<plugin>
<groupId>com.smartbear.soapui</groupId>
<artifactId>soapui-maven-plugin</artifactId>
<version>5.0.0</version>
<executions>
<execution>
<phase>test</phase>
<goals>
<goal>mock</goal>
<goal>test</goal>
</goals>
<configuration>
<projectFile>src/test/resources/SOAPMock-soapui-project.xml</projectFile>
<noBlock>true</noBlock>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
Note the same can also be achieved using Gradle or by running SoapUI via Java etc. Have also done recipe's like this in my SoapUI Cookbook (sorry more blatant self publicity! :-))
Hope this helps,
Cheers,
Rupert
Related Content
Recent Discussions
- 4 days agoemoya