【发布时间】:2012-04-05 05:39:12
【问题描述】:
我想知道如何为 WSClient 执行一些集成测试。我的项目是用 maven 构建的。
为了测试配置初始化和一些请求,我认为启动 SoapUI Mock 服务是个好主意。然后我进入了从一些帖子中检索到的配置。
在我的 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>
我的名为 MyMock 的 MockService 应该在 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
提前和亲切的问候,
鲁本
【问题讨论】:
-
你看到什么样的错误?
-
我编辑了我的问题。谢谢。
标签: java maven maven-plugin soapui