soapUI and JUnit dependency issue

穿精又带淫゛_ 提交于 2019-12-08 06:35:14

问题


I'm trying to use soapUI integrated to JUnit. I've tried to add the dependencies as mentioned here but it doesn't work. Some classes are not found.

In this post, it is proposed to add the soapui/lib directory to the classpath but this is not really a good practice with Maven.

Do you know which dependency(ies) to add to my project in order to integrate soapUI to JUnit?

Thanks


回答1:


Depending on what you're trying to do with SoapUI, you may be able to use its Maven plugin, rather than try to integrate it with JUnit: http://www.soapui.org/Test-Automation/maven-2x.html. You can use this to e.g. start a SoapUI mock server, run integration tests that call a web service, then stop the mock server upon completion of the tests. See also the Failsafe plugin if you want to do this.

Failing that, you could add the Maven plugin to your test classpath. This should also pull in all of the dependencies required to run SoapUI itself:

<dependencies>
  <dependency>
    <groupId>eviware</groupId>
    <artifactId>maven-soapui-plugin</artifactId>
    <version>4.5.0</version>
    <scope>test</scope>
  </dependency>
</dependencies>
<repositories>
  <repository>
    <id>eviware</id>
    <url>http://www.eviware.com/repository/maven2/</url>
  </repository>
</repositories>



回答2:


You need to create an ext folder under your project and add your dependencies there. This is the directory SoapUI runner will look into, for all your external dependencies.



来源:https://stackoverflow.com/questions/10618025/soapui-and-junit-dependency-issue

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!