Running SoapUI mocks and tests from Java and JUnit is relatively easy to do, as we essentially run the same Java classes that the command line and Maven plugins use. In the first part of this recipe, we will look at running the SoapUIMockServiceRunner
and SoapUITestCaseRunner
files directly. Then, we will look at doing the same via a JUnit runner.
In both cases, we'll run the SOAPMock-soapui-project.xml
project as before. All the code is contained in the chapter 5
samples' /java/
folder.
The samples are easy to run from Eclipse (or a similar IDE) and also from the command line. The minimum you need is a SoapUI and a JDK (this recipe uses JDK 1.7.x).
Unless you're using an IDE, which bundles JUnit, you might need to download the JUnit library (junit-4.11.jar
is also included in the /java/
chapter 5 samples folder).