The plugin provides tasks for running SoapUI tests and mocks during a Gradle build.
Unfortunately, I don't have much time to contribute anymore. In practice this means far less activity, responsiveness on issues and new releases from my end. |
I am ctively looking for contributors willing to take on maintenance and implementation of the project. If you are interested and would love to see this plugin continue to thrive, shoot me a mail. |
This plugin has a fairly complex dependency tree. To use this plugin successfully we need to override some dependencies through forcing versions or completely substituting modules. See approach SmartBear uses solve jar-hell problem in their maven plugin. As a result your build file can look like this:
buildscript {
ext {
soapUIVersion = '5.3.0.RELEASE' // open source version
// soapUIVersion = '5.1.2.PRO-RELEASE' // pro version
}
repositories {
maven { url 'https://plugins.gradle.org/m2/' }
maven { url 'http://www.soapui.org/repository/maven2/' }
mavenCentral()
}
dependencies {
compile("com.smartbear.soapui:soapui:$soapUIVersion") {
exclude group: 'com.jgoodies', module: 'forms'
exclude group: 'com.jgoodies', module: 'looks'
exclude group: 'com.jgoodies', module: 'binding'
}
}
configurations.all {
resolutionStrategy {
force 'com.jgoodies:binding:2.0.1',
'com.jgoodies:forms:1.0.7',
'com.jgoodies:looks:2.2.0'
}
}
}
apply plugin: 'io.byteshifter.soapui'
But for most common and trivial use-cases, buildscript configuration could be much simpler:
buildscript {
repositories {
jcenter()
maven { url 'https://plugins.gradle.org/m2/' }
maven { url 'http://smartbearsoftware.com/repository/maven2/' }
}
dependencies {
classpath('gradle.plugin.io.byteshifter:soapui-gradle-plugin:5.3.0.RELEASE')
}
}
apply plugin: io.byteshifter.plugins.soapui.SoapUIPlugin
The soapui
plugin pre-defines the following tasks out-of-the-box:
Task Name | Type | Description |
---|---|---|
soaptest | TestTask | Runs the SoapUI tests as specified by the plugin properties. Internally invokes the SoapUITestCaseRunner class as described there. |
soapload | LoadTestTask | Runs the SoapUI loadtests as specified by the plugin properties. Internally invokes the SoapUILoadTestRunner class as described there. |
soaptool | ToolTask | Runs the specified and configured code-generation tool. Internally invokes the SoapUIToolRunner class as described there. |
soapmock | MockServiceTask | Runs the specified and configured code-generation tool. Internally invokes the SoapUIMockServiceRunner class as described there. |
To configure the SoapUI test task you can choose to set the following properties within the test
closure of the
soapui
extension:
projectFile
: Specified the name of the SoapUI project file to usetestSuite
: Specifies the name of the TestSuite to runtestCase
: Specifies the name of the TestCase to runendpoint
: Overrides the service endpoint to be invoked by any TestRequestshost
: Overrides the target host:port to be invoked by any TestRequestsusername
: Overrides the username used by any TestRequests runpassword
: Overrides the password used by any TestRequests rundomain
: Overrides the domain used by any TestRequests runprintReport
: Controls if a small test report should be printed to the console (true/false)outputFolder
: Set which folder results/reports are saved tojunitReport
: Turns on creation of JUnit-reports, (true/false)exportAll
: Controls if all test requests should be exported (default only exports errors), (true/false)settingsFile
: Specifies SoapUI settings file to usewssPasswordType
: Specifies WSS password typeprojectPassword
: Specifies password for encrypted projectsettingsFilePassword
: Specifies password for encrypted settings fileglobalProperties
: Sets global propertiesprojectProperties
: Sets project propertiessaveAfterRun
: Saves project file after runtestFailIgnore
: Ignore failed tests.
To configure the SoapUI load test task you can choose to set the following properties within the load
closure of the
soapui
extension:
projectFile
: Specified the name of the SoapUI project file to usetestSuite
: Specifies the name of the TestSuite to runtestCase
: Specifies the name of the TestCase to runloadTest
: Specifies the name of the LoadTest to runlimit
: Overrides the limit of executed LoadTestsendpoint
: Overrides the service endpoint to be invoked by any TestRequestshost
: Overrides the target host:port to be invoked by any TestRequestsusername
: Overrides the username used by any TestRequests runpassword
: Overrides the password used by any TestRequests rundomain
: Overrides the domain used by any TestRequests runprintReport
: Controls if a small test report should be printed to the console (true/false)outputFolder
: Set which folder results/reports are saved tosettingsFile
: Specifies SoapUI settings file to usewssPasswordType
: Specifies WSS password typeprojectPassword
: Specifies password for encrypted projectsettingsFilePassword
: Specifies password for encrypted settings filesaveAfterRun
: Saves project file after runthreadcount
: Number of threads in loadtest.
projectFile
: Specified the name of the SoapUI project file to useiface
: Specifies the interface to generate fortool
: Specifies the tool(s) to run, a comma-separated list of axis1, axis2, dotnet, gsoap, jaxb, wstools, wsconsume, ora, wscompile, wsi, wsimport, xfire or xmlbeanssettingsFile
: Specifies SoapUI settings file to useprojectPassword
: Specifies password for encrypted projectsettingsFilePassword
: Specifies password for encrypted settings fileoutputFolder
: Set which folder results/reports are saved to
projectFile
: Specified the name of the SoapUI project file to usemockService
: Specified the MockService to runport
: The local port to listen on, overrides the port configured for the MockServicepath
: The local path to listen on, overrides the path configured for the MockServicenoBlock
: Turns off blocking when MockRunner has startedsettingsFile
: Specifies SoapUI settings file to useprojectPassword
: Specifies password for encrypted projectsettingsFilePassword
: Specifies password for encrypted settings filesaveAfterRun
: Saves project file after run
soapui {
test {
projectFile = 'sample-soapui-project.xml'
testSuite = 'OleTest'
printReport = true
junitReport = true
}
load {
projectFile = 'sample-soapui-load-project.xml'
printReport = true
}
tool {
projectFile = 'sample-soapui-tool-project.xml'
iface = 'IOrderService'
tool = 'wsi,axis1,axis2'
}
}
There may be times when you have multiple test suites inside the same SoapUI project. You wouldn't want to maintain several Gradle projects, so the plugin uses convention mapping. This means you can have many tasks, but override the properties at runtime. Here's an example:
soapui {
test {
projectFile = 'sample-soapui-project.xml'
printReport = true
junitReport = true
}
}
import io.byteshifter.plugins.soapui.tasks.TestTask
task testSuiteA(type: TestTask) {
testSuite = 'SuiteA'
}
task testSuiteB(type: TestTask) {
testSuite = 'SuiteB'
}
What you should notice in the example above is that we still use the soapui
convention block with the nested test
section. You may also have noticed that we have defined 2 new tasks of type TestTask
. The TestTask
is what runs the SoapUITestCaseRunner
. The only difference between the 2 tasks is that they set their own value for testSuite
. Through the magic of convention mapping the rest of the values are inherited.
In case of many TestSuites you might want use such approach to reduce a lot of duplications in your build script code:
[
'SuiteA',
'SuiteB',
// ...
'SuiteZ',
].each { suite ->
tasks.create(name: suite, type: io.byteshifter.plugins.soapui.tasks.TestTask) {
testSuite = suite
}
}
Please, note: to run all of the TestSuites in this case, you can use only gradle soaptest
command.
Previously, versions between soapui-gradle-plugin and SoapUI test runner was't synchronized. But after version 5.0.1 we will try to keep them synchronized as soon as newer SoapUI will be released.
soapui-gradle-plugin | SoapUI test runner |
---|---|
0.2 | 5.0.1 |
5.1.0 | 5.1.0 |
... | ... |
5.3.1-RC | 5.3.1-RC |
5.3.0.RELEASE | 5.3.0 |
Using Open Source Version: We do recommend use SoapUI runner version 5.3.0 - it's last fully featured and quite stable version of SoapUI. Version 5.3.1-RC1 was not released. Version 5.4.0 is very limited: LoadUI integration has been removed. To create and run advanced load tests, use LoadUI Pro, which is part of the ReadyAPI application suite.
- Issue Tracker: github.com/byte-shifter-ltd/soapui-gradle-plugin/issues
- Source Code: github.com/byte-shifter-ltd/soapui-gradle-plugin
The project is licensed under the MIT license.