Integration With Java Applications

To integrate ReadyAPI tests in your Java applications, add the ReadyAPI libraries to your project and then call the needed methods from your code.

ReadyAPI tests can also be run from popular test frameworks, such as JUnit or TestNG.

Prepare for Running ReadyAPI Tests

To prepare your application for running ReadyAPI tests, you need to import the ReadyAPI libraries to your project:

  • If you use Maven, add the following dependencies to your pom.xml file:

-- or --

  • Manually import .jar files from the <ReadyAPI installation directory>\lib folder to your application project.

After that, you can use the ReadyAPI Runner classes to run your tests.

Available Classes

Your tests have access to the following classes:

Class

Description

SoapUIProTestCaseRunner

Contains methods you use to work with functional tests.

SoapUIProSecurityTestRunner

Contains methods you use to work with security tests.

LoadUIProjectRunner

Contains methods you use to work with load tests.

SoapUIMockServiceRunner

Contains methods used to start and stop virtual APIs.

Starting Tests

To start your ReadyAPI tests, use the following code:

Reporting and Exporting Functional Web Service Tests

Runner classes support creating reports for a tests run. To do this, enable the option to create a report and set the report output folder:

Exported files have the following names: <TestSuite>-<TestCase>-<TestStep Name>-<Count>-<Status>.txt. They will appear in the report folder you have specified.

For example, you can have the following file: TestSuite 1-TestCase 1-Request Step 1-0-OK.txt. If you run the test step several times during the test case run, ReadyAPI will save each run as an individual file.

The response attachments will also appear in the report folder. They will have the following name template: <TestSuite>-<TestCase>-<TestStep Name>-<Count>-attachment-<AttachmentCount>.<Extension>. By default, they will have a format matching the content-type. If it is not available, ReadyAPI will save the attachment in .dat format.

See Also

Publication date: