我想知道如何为WSClient执行一些集成测试。我的项目是用maven构建的。在Maven测试中集成的SoapUI模拟
为了测试配置初始化和一些请求,我认为启动SoapUI模拟服务是个好主意。然后我进入从某些帖子检索的配置。
在我的pom.xml
<plugin>
<groupId>eviware</groupId>
<artifactId>maven-soapui-plugin</artifactId>
<version>4.0.1</version>
<executions>
<execution>
<id>StartupMock</id>
<configuration>
<projectFile>src/test/soapui/MyMock-soapui-project.xml</projectFile>
<outputFolder>${project.build.directory}/surefire-reports</outputFolder>
<junitReport>true</junitReport>
<host>http://127.0.0.1:8181</host>
<mockService>DataProviderMock</mockService>
</configuration>
<goals>
<goal>test</goal>
</goals>
<phase>test</phase>
</execution>
</executions>
</plugin>
我MockService称为MyMock应该已经开始http://127.0.0.1:8181/somepath在我的WSClient可以发送请求。但我在mvn test
阶段无法开始模拟。
这是测试WSClients的合适方式吗?在那种情况下,问题或错误配置在哪里?
编辑:没有错误。我无法看到该端口8181
上的模拟聆听。我看到(从soapui.log)唯一的消息是:
2012-03-21 10:17:21,011 WARN [SoapUI] Missing folder [D:\proyectos\everest-utils\everest-bridge\trunk\.\ext] for external libraries
2012-03-21 10:17:21,392 INFO [DefaultSoapUICore] initialized soapui-settings from [C:\Users\rromero\soapui-settings.xml]
2012-03-21 10:17:23,205 INFO [WsdlProject] Loaded project from [file:/D:/proyectos/everest-utils/everest-bridge/trunk/src/test/soapui/MyMock-soapui-project.xml]
2012-03-21 10:17:23,891 INFO [SoapUITestCaseRunner] Running soapUI tests in project [DataProvider]
2012-03-21 10:17:23,894 INFO [SoapUITestCaseRunner] Running Project [MyMock], runType = SEQUENTIAL
2012-03-21 10:17:23,900 INFO [SoapUITestCaseRunner] Project [MyMock] finished with status [FINISHED] in 0ms
比你提前和亲切的问候,
鲁
你看到了什么样的错误? – nwinkler 2012-03-21 07:54:42
我编辑了我的问题。谢谢。 – 2012-03-21 09:22:44