├── .gitignore ├── .travis.yml ├── CONTRIBUTING.md ├── LICENSE ├── README.md ├── build.gradle ├── config └── codenarc │ └── codenarc.xml ├── gradle ├── codenarc.gradle ├── compileGroovy.gradle ├── integTest.gradle ├── jacoco.gradle ├── license.gradle ├── pluginPortal.gradle ├── repositories.gradle ├── soapUIPlugin.gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat └── src ├── integTest ├── groovy │ └── io │ │ └── byteshifter │ │ └── plugins │ │ └── soapui │ │ └── SoapuiPluginIntegSpec.groovy └── resources │ ├── Amazon-soapui-project.xml │ ├── Google Maps-soapui-project.xml │ ├── TemperatureConversions-soapui-project_FAIL.xml │ └── TemperatureConversions-soapui-project_PASS.xml ├── main ├── groovy │ └── io │ │ └── byteshifter │ │ └── plugins │ │ └── soapui │ │ ├── SoapUIPlugin.groovy │ │ ├── extensions │ │ ├── SoapUILoadConvention.groovy │ │ ├── SoapUIMockConvention.groovy │ │ ├── SoapUIPluginExtension.groovy │ │ ├── SoapUISecurityConvention.groovy │ │ ├── SoapUITestConvention.groovy │ │ └── SoapUIToolConvention.groovy │ │ └── tasks │ │ ├── LoadTestTask.groovy │ │ ├── MockServiceTask.groovy │ │ ├── SecurityTestTask.groovy │ │ ├── SoapUITask.groovy │ │ ├── TestTask.groovy │ │ └── ToolTask.groovy └── resources │ └── META-INF │ └── gradle-plugins │ └── io.byteshifter.soapui.properties └── test ├── groovy └── io │ └── byteshifter │ └── plugins │ └── soapui │ ├── SoapUIPluginSpec.groovy │ └── tasks │ ├── LoadTestTaskSpec.groovy │ ├── MockServiceTaskSpec.groovy │ ├── SecurityTestTaskSpec.groovy │ ├── TestTaskSpec.groovy │ └── ToolTaskSpec.groovy └── resources ├── Amazon-soapui-project.xml ├── Google Maps-soapui-project.xml └── calculator-soapui-project.xml /.gitignore: -------------------------------------------------------------------------------- 1 | # Created by http://www.gitignore.io 2 | 3 | ### Intellij ### 4 | # Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm 5 | 6 | ## Directory-based project format 7 | .idea/ 8 | # if you remove the above rule, at least ignore user-specific stuff: 9 | # .idea/workspace.xml 10 | # .idea/tasks.xml 11 | # and these sensitive or high-churn files: 12 | # .idea/dataSources.ids 13 | # .idea/dataSources.xml 14 | # .idea/sqlDataSources.xml 15 | # .idea/dynamic.xml 16 | 17 | ## File-based project format 18 | *.ipr 19 | *.iws 20 | *.iml 21 | 22 | ## Additional for IntelliJ 23 | out/ 24 | 25 | # generated by mpeltonen/sbt-idea plugin 26 | .idea_modules/ 27 | 28 | # generated by JIRA plugin 29 | atlassian-ide-plugin.xml 30 | 31 | # generated by Crashlytics plugin (for Android Studio and Intellij) 32 | com_crashlytics_export_strings.xml 33 | 34 | 35 | ### Gradle ### 36 | .gradle 37 | build/ 38 | /.clover 39 | /classes 40 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | env: 2 | matrix: 3 | - TERM=dumb 4 | global: 5 | - secure: o7bQffEMsStS0X7oWJ/i7QWeHoZTqQASLYx0PsfROyTCwVaNnSjuj5jsEIpO2wSppOSVD+tu6LOiCG06XvwWFA79hZh0DzPPq1nbVof4PhScNljYegCG7X6Nihrn38HOj9oxIZ6CJEZPaeyg1OzAPGs0Kir/MDiCcV3W9NDMwHo= 6 | - secure: VHuocNAOIkVh/TcDnTkXQSNBQtstJsCnfsiry4ROk4NCU3TkwkS1VLakhsErwEI1Ri5rl8jSOsYtOUBDfRiJq6nHEg7ilVERz9BVDhTmri6QlQv46OunBDWUrsqJjB1Q6AsEPBl0L1dqTe2RrP3AvmCXglfeFZKoEbWlmDpGSWE= 7 | 8 | language: groovy 9 | jdk: oraclejdk8 10 | 11 | before_cache: 12 | - for lockFile in $(find ~/.gradle -name "*.lock"); 13 | do sudo rm -rf $lockFile; 14 | done 15 | 16 | cache: 17 | directories: 18 | - $HOME/.m2 19 | - $HOME/.gradle 20 | 21 | addons: 22 | apt: 23 | packages: 24 | - bash 25 | 26 | install: true 27 | script: ./gradlew clean build 28 | 29 | after_failure: 30 | - ./gradlew clean check --debug 31 | after_success: 32 | - bash gradlew jacocoTestReport coveralls 33 | # publishing plugin 34 | - test -n "$TRAVIS_TAG" && echo "gradle.publish.key=${GRADLE_PUBLISH_KEY}" >> ~/.gradle/gradle.properties 35 | - test -n "$TRAVIS_TAG" && echo "gradle.publish.secret=${GRADLE_PUBLISH_SECRET}" >> ~/.gradle/gradle.properties 36 | - test -n "$TRAVIS_TAG" && ./gradlew publishPlugin -i 37 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contribution 2 | 3 | Feel free to contribute and help us make it more useful, 4 | but please do not forget about testing or at least 5 | provide us some context with description and 6 | spoaui-test-project.xml file in attachments 7 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 Sion Williams 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Gradle SoapUI plugin 2 | 3 | ![SoapUI Logo](http://www.soapui.org/images/stories/homepage/soapui_logo.png) 4 | 5 | The plugin provides tasks for running SoapUI tests and mocks during a Gradle build. 6 | 7 | 8 | 9 | 10 | 14 | 15 | 16 | 20 | 21 |
11 | Unfortunately, I don't have much time to contribute anymore. In practice this means far less activity, 12 | responsiveness on issues and new releases from my end. 13 |
17 | 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 18 | plugin continue to thrive, shoot me a mail. 19 |
22 | 23 | 24 | ## Build Status 25 | 26 | 29 | [![Build Status](https://travis-ci.org/willis7/soapui-gradle-plugin.svg)](https://travis-ci.org/willis7/soapui-gradle-plugin) 30 | [![Coverage Status](https://coveralls.io/repos/github/byte-shifter-ltd/soapui-gradle-plugin/badge.svg?branch=master)](https://coveralls.io/github/byte-shifter-ltd/soapui-gradle-plugin?branch=master) 31 | 32 | 33 | ## Usage 34 | 35 | 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. 36 | See approach [SmartBear uses solve jar-hell problem in their maven plugin.](http://smartbearsoftware.com/repository/maven2/com/smartbear/soapui/soapui-maven-plugin/5.3.0/soapui-maven-plugin-5.3.0.pom) 37 | As a result your build file can look like this: 38 | 39 | ```groovy 40 | buildscript { 41 | ext { 42 | soapUIVersion = '5.3.0.RELEASE' // open source version 43 | // soapUIVersion = '5.1.2.PRO-RELEASE' // pro version 44 | } 45 | repositories { 46 | maven { url 'https://plugins.gradle.org/m2/' } 47 | maven { url 'http://www.soapui.org/repository/maven2/' } 48 | mavenCentral() 49 | } 50 | dependencies { 51 | compile("com.smartbear.soapui:soapui:$soapUIVersion") { 52 | exclude group: 'com.jgoodies', module: 'forms' 53 | exclude group: 'com.jgoodies', module: 'looks' 54 | exclude group: 'com.jgoodies', module: 'binding' 55 | } 56 | } 57 | configurations.all { 58 | resolutionStrategy { 59 | force 'com.jgoodies:binding:2.0.1', 60 | 'com.jgoodies:forms:1.0.7', 61 | 'com.jgoodies:looks:2.2.0' 62 | } 63 | } 64 | } 65 | 66 | apply plugin: 'io.byteshifter.soapui' 67 | ``` 68 | 69 | But for most common and trivial use-cases, buildscript configuration could be much simpler: 70 | 71 | ```groovy 72 | buildscript { 73 | repositories { 74 | jcenter() 75 | maven { url 'https://plugins.gradle.org/m2/' } 76 | maven { url 'http://smartbearsoftware.com/repository/maven2/' } 77 | } 78 | dependencies { 79 | classpath('gradle.plugin.io.byteshifter:soapui-gradle-plugin:5.3.0.RELEASE') 80 | } 81 | } 82 | 83 | apply plugin: io.byteshifter.plugins.soapui.SoapUIPlugin 84 | ``` 85 | 86 | [Gradle Plugin Portal](https://plugins.gradle.org/plugin/io.byteshifter.soapui) 87 | 88 | 89 | ## Tasks 90 | 91 | The `soapui` plugin pre-defines the following tasks out-of-the-box: 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 |
Task NameTypeDescription
soaptestTestTaskRuns the SoapUI tests as specified by the plugin properties. Internally invokes the SoapUITestCaseRunner class as described there.
soaploadLoadTestTaskRuns the SoapUI loadtests as specified by the plugin properties. Internally invokes the SoapUILoadTestRunner class as described there.
soaptoolToolTaskRuns the specified and configured code-generation tool. Internally invokes the SoapUIToolRunner class as described there.
soapmockMockServiceTaskRuns the specified and configured code-generation tool. Internally invokes the SoapUIMockServiceRunner class as described there.
120 | 121 | 122 | ## Task properties 123 | 124 | ### soaptest properties 125 | 126 | To configure the SoapUI test task you can choose to set the following properties within the `test` closure of the 127 | `soapui` extension: 128 | 129 | * `projectFile` : Specified the name of the SoapUI project file to use 130 | * `testSuite` : Specifies the name of the TestSuite to run 131 | * `testCase` : Specifies the name of the TestCase to run 132 | * `endpoint` : Overrides the service endpoint to be invoked by any TestRequests 133 | * `host` : Overrides the target host:port to be invoked by any TestRequests 134 | * `username` : Overrides the username used by any TestRequests run 135 | * `password` : Overrides the password used by any TestRequests run 136 | * `domain` : Overrides the domain used by any TestRequests run 137 | * `printReport` : Controls if a small test report should be printed to the console (true/false) 138 | * `outputFolder` : Set which folder results/reports are saved to 139 | * `junitReport` : Turns on creation of JUnit-reports, (true/false) 140 | * `exportAll` : Controls if all test requests should be exported (default only exports errors), (true/false) 141 | * `settingsFile` : Specifies SoapUI settings file to use 142 | * `wssPasswordType` : Specifies WSS password type 143 | * `projectPassword` : Specifies password for encrypted project 144 | * `settingsFilePassword` : Specifies password for encrypted settings file 145 | * `globalProperties` : Sets global properties 146 | * `projectProperties` : Sets project properties 147 | * `saveAfterRun` : Saves project file after run 148 | * `testFailIgnore` : Ignore failed tests. 149 | 150 | ### loadtest properties 151 | 152 | To configure the SoapUI load test task you can choose to set the following properties within the `load` closure of the 153 | `soapui` extension: 154 | 155 | * `projectFile` : Specified the name of the SoapUI project file to use 156 | * `testSuite` : Specifies the name of the TestSuite to run 157 | * `testCase` : Specifies the name of the TestCase to run 158 | * `loadTest` : Specifies the name of the LoadTest to run 159 | * `limit` : Overrides the limit of executed LoadTests 160 | * `endpoint` : Overrides the service endpoint to be invoked by any TestRequests 161 | * `host` : Overrides the target host:port to be invoked by any TestRequests 162 | * `username` : Overrides the username used by any TestRequests run 163 | * `password` : Overrides the password used by any TestRequests run 164 | * `domain` : Overrides the domain used by any TestRequests run 165 | * `printReport` : Controls if a small test report should be printed to the console (true/false) 166 | * `outputFolder` : Set which folder results/reports are saved to 167 | * `settingsFile` : Specifies SoapUI settings file to use 168 | * `wssPasswordType` : Specifies WSS password type 169 | * `projectPassword` : Specifies password for encrypted project 170 | * `settingsFilePassword` : Specifies password for encrypted settings file 171 | * `saveAfterRun` : Saves project file after run 172 | * `threadcount` : Number of threads in loadtest. 173 | 174 | ### tool properties 175 | 176 | * `projectFile` : Specified the name of the SoapUI project file to use 177 | * `iface` : Specifies the interface to generate for 178 | * `tool` : Specifies the tool(s) to run, a comma-separated list of axis1, axis2, dotnet, gsoap, jaxb, wstools, wsconsume, ora, wscompile, wsi, wsimport, xfire or xmlbeans 179 | * `settingsFile` : Specifies SoapUI settings file to use 180 | * `projectPassword` : Specifies password for encrypted project 181 | * `settingsFilePassword` : Specifies password for encrypted settings file 182 | * `outputFolder` : Set which folder results/reports are saved to 183 | 184 | ### mock properties 185 | 186 | * `projectFile` : Specified the name of the SoapUI project file to use 187 | * `mockService` : Specified the MockService to run 188 | * `port` : The local port to listen on, overrides the port configured for the MockService 189 | * `path` : The local path to listen on, overrides the path configured for the MockService 190 | * `noBlock` : Turns off blocking when MockRunner has started 191 | * `settingsFile` : Specifies SoapUI settings file to use 192 | * `projectPassword` : Specifies password for encrypted project 193 | * `settingsFilePassword` : Specifies password for encrypted settings file 194 | * `saveAfterRun` : Saves project file after run 195 | 196 | 197 | ## Full Example 198 | 199 | ```groovy 200 | soapui { 201 | test { 202 | projectFile = 'sample-soapui-project.xml' 203 | testSuite = 'OleTest' 204 | printReport = true 205 | junitReport = true 206 | } 207 | load { 208 | projectFile = 'sample-soapui-load-project.xml' 209 | printReport = true 210 | } 211 | tool { 212 | projectFile = 'sample-soapui-tool-project.xml' 213 | iface = 'IOrderService' 214 | tool = 'wsi,axis1,axis2' 215 | } 216 | } 217 | ``` 218 | 219 | 220 | ## Complex Example 221 | 222 | 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: 223 | 224 | ```groovy 225 | soapui { 226 | test { 227 | projectFile = 'sample-soapui-project.xml' 228 | printReport = true 229 | junitReport = true 230 | } 231 | } 232 | 233 | import io.byteshifter.plugins.soapui.tasks.TestTask 234 | 235 | task testSuiteA(type: TestTask) { 236 | testSuite = 'SuiteA' 237 | } 238 | 239 | task testSuiteB(type: TestTask) { 240 | testSuite = 'SuiteB' 241 | } 242 | ``` 243 | 244 | 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. 245 | 246 | 247 | ## Tons of TestSuites for enterprise-grade SoapUI test projects 248 | 249 | In case of many TestSuites you might want use such approach to reduce a lot of duplications in your build script code: 250 | 251 | ```groovy 252 | [ 253 | 'SuiteA', 254 | 'SuiteB', 255 | // ... 256 | 'SuiteZ', 257 | 258 | ].each { suite -> 259 | tasks.create(name: suite, type: io.byteshifter.plugins.soapui.tasks.TestTask) { 260 | testSuite = suite 261 | } 262 | } 263 | ``` 264 | 265 | Please, note: to run all of the TestSuites in this case, you can use only `gradle soaptest` command. 266 | 267 | 268 | ## SoapUI test runner and plugin versions mapping 269 | 270 | Previously, versions between soapui-gradle-plugin and SoapUI test runner was't synchronized. 271 | But after version 5.0.1 we will try to keep them synchronized as soon as newer SoapUI will be released. 272 | 273 | | soapui-gradle-plugin | SoapUI test runner | 274 | | -------------------- | ------------------ | 275 | | 0.2 | 5.0.1 | 276 | | 5.1.0 | 5.1.0 | 277 | | ... | ... | 278 | | 5.3.1-RC | 5.3.1-RC | 279 | | 5.3.0.RELEASE | 5.3.0 | 280 | 281 | Using Open Source Version: 282 | We do recommend use SoapUI runner version 5.3.0 - it's last fully featured and quite stable version of SoapUI. 283 | Version 5.3.1-RC1 was not released. 284 | Version 5.4.0 is very limited: LoadUI integration has been removed. 285 | To create and run advanced load tests, use LoadUI Pro, which is part of the ReadyAPI application suite. 286 | 287 | ## Contribute 288 | 289 | - Issue Tracker: [github.com/byte-shifter-ltd/soapui-gradle-plugin/issues](https://github.com/byte-shifter-ltd/soapui-gradle-plugin/issues) 290 | - Source Code: [github.com/byte-shifter-ltd/soapui-gradle-plugin](https://github.com/byte-shifter-ltd/soapui-gradle-plugin) 291 | 292 | 293 | ## License 294 | 295 | The project is licensed under the MIT license. 296 | 297 | 298 | 304 | -------------------------------------------------------------------------------- /build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | ext { 3 | soapUIVersion = '5.3.0' 4 | jgoodiesBindingVersion = '2.0.1' 5 | jgoodiesFormsVersion = '1.0.7' 6 | jgoodiesLooksVersion = '2.2.0' 7 | gradleApiVersion = 2.12 8 | projectUrl = 'https://github.com/byte-shifter-ltd/soapui-gradle-plugin' 9 | pluginDescription = 'Gradle plugin for running SoapUI test projects using testrunner' 10 | } 11 | apply from: "$rootDir/gradle/repositories.gradle" 12 | } 13 | 14 | plugins { 15 | id 'idea' 16 | id 'groovy' 17 | id 'jacoco' 18 | id 'com.github.kt3k.coveralls' version '2.8.1' 19 | id 'com.gradle.plugin-publish' version '0.10.0' 20 | id 'com.github.hierynomus.license' version '0.14.0' 21 | } 22 | 23 | apply from: "$rootDir/gradle/repositories.gradle" 24 | apply from: "$rootDir/gradle/compileGroovy.gradle" 25 | apply from: "$rootDir/gradle/integTest.gradle" 26 | apply from: "$rootDir/gradle/codenarc.gradle" 27 | apply from: "$rootDir/gradle/jacoco.gradle" 28 | apply from: "$rootDir/gradle/license.gradle" 29 | apply from: "$rootDir/gradle/pluginPortal.gradle" 30 | apply from: "$rootDir/gradle/soapUIPlugin.gradle" 31 | -------------------------------------------------------------------------------- /config/codenarc/codenarc.xml: -------------------------------------------------------------------------------- 1 | 16 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | -------------------------------------------------------------------------------- /gradle/codenarc.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'codenarc' 2 | 3 | codenarc { 4 | configFile = file("$projectDir/config/codenarc/codenarc.xml") 5 | //reportFormat = 'console' 6 | //reportFormat = 'html' 7 | reportFormat = 'text' 8 | ignoreFailures = false 9 | reportsDir = file("$buildDir/codenarc") 10 | } 11 | -------------------------------------------------------------------------------- /gradle/compileGroovy.gradle: -------------------------------------------------------------------------------- 1 | task sourcesJar(type: Jar, dependsOn: classes) { 2 | classifier = 'sources' 3 | from sourceSets.main.allSource 4 | } 5 | 6 | task javadocJar(type: Jar, dependsOn: javadoc) { 7 | classifier = 'javadoc' 8 | from javadoc.destinationDir 9 | } 10 | 11 | build.dependsOn sourcesJar, javadocJar 12 | -------------------------------------------------------------------------------- /gradle/integTest.gradle: -------------------------------------------------------------------------------- 1 | /** 2 | * Integration Testing 3 | */ 4 | sourceSets { 5 | integTest { 6 | java.srcDir file('src/integTest/groovy') 7 | resources.srcDir file('src/integTest/resources') 8 | compileClasspath = sourceSets.main.output + configurations.testRuntime 9 | runtimeClasspath = output + compileClasspath 10 | } 11 | } 12 | 13 | task integTest(type: Test, group: 'verification') { 14 | testClassesDir = sourceSets.integTest.output.classesDir 15 | // // gradle API 4 deprecations recommends use instead: 16 | // testClassesDirs = sourceSets.integTest.output.classesDirs 17 | classpath = sourceSets.integTest.runtimeClasspath 18 | reports.html.setDestination(file("$buildDir/reports/integTests")) 19 | } 20 | -------------------------------------------------------------------------------- /gradle/jacoco.gradle: -------------------------------------------------------------------------------- 1 | jacocoTestReport { 2 | reports { 3 | xml.enabled true 4 | csv.enabled false 5 | html.setDestination(file("$buildDir/reports/jacocoTestReport")) 6 | } 7 | } 8 | 9 | test.finalizedBy jacocoTestReport 10 | -------------------------------------------------------------------------------- /gradle/license.gradle: -------------------------------------------------------------------------------- 1 | license { 2 | header rootProject.file('LICENSE') 3 | includes([ 4 | '**/*.java', 5 | '**/*.groovy', 6 | ]) 7 | } 8 | -------------------------------------------------------------------------------- /gradle/pluginPortal.gradle: -------------------------------------------------------------------------------- 1 | version = "$soapUIVersion-20180922.SNAPSHOT" 2 | description = project.pluginDescription 3 | group = 'io.byteshifter' 4 | 5 | pluginBundle { 6 | website = project.projectUrl 7 | vcsUrl = "${project.projectUrl}.git" 8 | description = project.pluginDescription 9 | tags = [ 10 | 'soapui', 11 | 'testing', 12 | 'soap', 13 | 'rest', 14 | 'testrunner', 15 | ] 16 | plugins { 17 | soapuiPlugin { 18 | id = "${group}.soapui" 19 | description = project.pluginDescription 20 | displayName = project.pluginDescription 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /gradle/repositories.gradle: -------------------------------------------------------------------------------- 1 | repositories { 2 | if (project.hasProperty('internalArtifactRepository')) { 3 | maven { url project.internalArtifactRepository } 4 | } else { 5 | jcenter() 6 | mavenCentral() 7 | maven { url 'https://plugins.gradle.org/m2/' } 8 | maven { url 'http://smartbearsoftware.com/repository/maven2/' } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /gradle/soapUIPlugin.gradle: -------------------------------------------------------------------------------- 1 | targetCompatibility = sourceCompatibility = JavaVersion.VERSION_1_6 2 | 3 | wrapper { 4 | gradleVersion = project.gradleApiVersion 5 | } 6 | 7 | idea { 8 | module { 9 | testSourceDirs += file('src/integTest/groovy') 10 | } 11 | } 12 | 13 | dependencies { 14 | compile gradleApi() 15 | compile localGroovy() 16 | 17 | compile "com.smartbear.soapui:soapui:$soapUIVersion", { 18 | exclude group: 'com.jgoodies', module: 'forms' 19 | exclude group: 'com.jgoodies', module: 'looks' 20 | exclude group: 'com.jgoodies', module: 'binding' 21 | exclude group: 'org.codehaus.groovy' 22 | } 23 | 24 | testCompile 'com.netflix.nebula:nebula-test:7.1.0', { 25 | exclude group: 'org.codehaus.groovy' 26 | } 27 | } 28 | 29 | configurations.all { 30 | resolutionStrategy { 31 | // force current SoapUI versions of dependencies + right spock version 32 | force "com.jgoodies:binding:$jgoodiesBindingVersion", 33 | "com.jgoodies:forms:$jgoodiesFormsVersion", 34 | "com.jgoodies:looks:$jgoodiesLooksVersion", 35 | 'org.spockframework:spock-core:1.0-groovy-2.4' 36 | } 37 | } 38 | 39 | defaultTasks 'build' 40 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/willis7/soapui-gradle-plugin/1d9bc0a7544dcb6ac72cb588c83816ba45d7f7c4/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Wed Apr 20 11:40:18 BST 2016 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.12-bin.zip 7 | -------------------------------------------------------------------------------- /gradlew: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | ############################################################################## 4 | ## 5 | ## Gradle start up script for UN*X 6 | ## 7 | ############################################################################## 8 | 9 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 10 | DEFAULT_JVM_OPTS="" 11 | 12 | APP_NAME="Gradle" 13 | APP_BASE_NAME=`basename "$0"` 14 | 15 | # Use the maximum available, or set MAX_FD != -1 to use that value. 16 | MAX_FD="maximum" 17 | 18 | warn ( ) { 19 | echo "$*" 20 | } 21 | 22 | die ( ) { 23 | echo 24 | echo "$*" 25 | echo 26 | exit 1 27 | } 28 | 29 | # OS specific support (must be 'true' or 'false'). 30 | cygwin=false 31 | msys=false 32 | darwin=false 33 | case "`uname`" in 34 | CYGWIN* ) 35 | cygwin=true 36 | ;; 37 | Darwin* ) 38 | darwin=true 39 | ;; 40 | MINGW* ) 41 | msys=true 42 | ;; 43 | esac 44 | 45 | # Attempt to set APP_HOME 46 | # Resolve links: $0 may be a link 47 | PRG="$0" 48 | # Need this for relative symlinks. 49 | while [ -h "$PRG" ] ; do 50 | ls=`ls -ld "$PRG"` 51 | link=`expr "$ls" : '.*-> \(.*\)$'` 52 | if expr "$link" : '/.*' > /dev/null; then 53 | PRG="$link" 54 | else 55 | PRG=`dirname "$PRG"`"/$link" 56 | fi 57 | done 58 | SAVED="`pwd`" 59 | cd "`dirname \"$PRG\"`/" >/dev/null 60 | APP_HOME="`pwd -P`" 61 | cd "$SAVED" >/dev/null 62 | 63 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 64 | 65 | # Determine the Java command to use to start the JVM. 66 | if [ -n "$JAVA_HOME" ] ; then 67 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 68 | # IBM's JDK on AIX uses strange locations for the executables 69 | JAVACMD="$JAVA_HOME/jre/sh/java" 70 | else 71 | JAVACMD="$JAVA_HOME/bin/java" 72 | fi 73 | if [ ! -x "$JAVACMD" ] ; then 74 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 75 | 76 | Please set the JAVA_HOME variable in your environment to match the 77 | location of your Java installation." 78 | fi 79 | else 80 | JAVACMD="java" 81 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 82 | 83 | Please set the JAVA_HOME variable in your environment to match the 84 | location of your Java installation." 85 | fi 86 | 87 | # Increase the maximum file descriptors if we can. 88 | if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then 89 | MAX_FD_LIMIT=`ulimit -H -n` 90 | if [ $? -eq 0 ] ; then 91 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then 92 | MAX_FD="$MAX_FD_LIMIT" 93 | fi 94 | ulimit -n $MAX_FD 95 | if [ $? -ne 0 ] ; then 96 | warn "Could not set maximum file descriptor limit: $MAX_FD" 97 | fi 98 | else 99 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" 100 | fi 101 | fi 102 | 103 | # For Darwin, add options to specify how the application appears in the dock 104 | if $darwin; then 105 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" 106 | fi 107 | 108 | # For Cygwin, switch paths to Windows format before running java 109 | if $cygwin ; then 110 | APP_HOME=`cygpath --path --mixed "$APP_HOME"` 111 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` 112 | JAVACMD=`cygpath --unix "$JAVACMD"` 113 | 114 | # We build the pattern for arguments to be converted via cygpath 115 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` 116 | SEP="" 117 | for dir in $ROOTDIRSRAW ; do 118 | ROOTDIRS="$ROOTDIRS$SEP$dir" 119 | SEP="|" 120 | done 121 | OURCYGPATTERN="(^($ROOTDIRS))" 122 | # Add a user-defined pattern to the cygpath arguments 123 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then 124 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" 125 | fi 126 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 127 | i=0 128 | for arg in "$@" ; do 129 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` 130 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option 131 | 132 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition 133 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` 134 | else 135 | eval `echo args$i`="\"$arg\"" 136 | fi 137 | i=$((i+1)) 138 | done 139 | case $i in 140 | (0) set -- ;; 141 | (1) set -- "$args0" ;; 142 | (2) set -- "$args0" "$args1" ;; 143 | (3) set -- "$args0" "$args1" "$args2" ;; 144 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;; 145 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; 146 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 147 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 148 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; 149 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; 150 | esac 151 | fi 152 | 153 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules 154 | function splitJvmOpts() { 155 | JVM_OPTS=("$@") 156 | } 157 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS 158 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" 159 | 160 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" 161 | -------------------------------------------------------------------------------- /gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 12 | set DEFAULT_JVM_OPTS= 13 | 14 | set DIRNAME=%~dp0 15 | if "%DIRNAME%" == "" set DIRNAME=. 16 | set APP_BASE_NAME=%~n0 17 | set APP_HOME=%DIRNAME% 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windows variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | if "%@eval[2+2]" == "4" goto 4NT_args 53 | 54 | :win9xME_args 55 | @rem Slurp the command line arguments. 56 | set CMD_LINE_ARGS= 57 | set _SKIP=2 58 | 59 | :win9xME_args_slurp 60 | if "x%~1" == "x" goto execute 61 | 62 | set CMD_LINE_ARGS=%* 63 | goto execute 64 | 65 | :4NT_args 66 | @rem Get arguments from the 4NT Shell from JP Software 67 | set CMD_LINE_ARGS=%$ 68 | 69 | :execute 70 | @rem Setup the command line 71 | 72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if "%ERRORLEVEL%"=="0" goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 85 | exit /b 1 86 | 87 | :mainEnd 88 | if "%OS%"=="Windows_NT" endlocal 89 | 90 | :omega 91 | -------------------------------------------------------------------------------- /src/integTest/groovy/io/byteshifter/plugins/soapui/SoapuiPluginIntegSpec.groovy: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2014 Sion Williams 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | package io.byteshifter.plugins.soapui 25 | 26 | import nebula.test.IntegrationSpec 27 | import nebula.test.functional.ExecutionResult 28 | 29 | /** 30 | * @author Sion Williams 31 | * @author Iain Adams 32 | */ 33 | class SoapuiPluginIntegSpec extends IntegrationSpec { 34 | 35 | def setup() { 36 | copyResources('TemperatureConversions-soapui-project_PASS.xml', 'example-pass.xml') 37 | copyResources('TemperatureConversions-soapui-project_FAIL.xml', 'example-fail.xml') 38 | } 39 | 40 | def 'apply plugin, setup and run SoapUI test which passes'() { 41 | setup: 42 | buildFile << ''' 43 | apply plugin: 'io.byteshifter.soapui' 44 | 45 | soapui{ 46 | test{ 47 | printReport = true 48 | projectFile = "$projectDir/example-pass.xml" 49 | } 50 | } 51 | '''.stripIndent() 52 | fork = true 53 | 54 | when: 55 | ExecutionResult result = runTasksSuccessfully('soaptest') 56 | 57 | then: 58 | result.standardOutput.contains('Total TestCases: 4 (0 failed)') 59 | } 60 | 61 | def 'apply plugin, setup and run SoapUI test which fails'() { 62 | setup: 63 | buildFile << ''' 64 | apply plugin: 'io.byteshifter.soapui' 65 | 66 | soapui{ 67 | test{ 68 | printReport = true 69 | projectFile = "$projectDir/example-fail.xml" 70 | } 71 | } 72 | '''.stripIndent() 73 | fork = true 74 | 75 | when: 76 | ExecutionResult result = runTasksWithFailure('soaptest') 77 | 78 | then: 79 | result.standardOutput.contains('Total TestCases: 4 (1 failed)') 80 | } 81 | } 82 | -------------------------------------------------------------------------------- /src/integTest/resources/TemperatureConversions-soapui-project_FAIL.xml: -------------------------------------------------------------------------------- 1 | 2 | http://webservices.daehosting.com/services/TemperatureConversions.wso<xml-fragment/>UTF-8http://webservices.daehosting.com/services/TemperatureConversions.wso 3 | 4 | 5 | 6 | 15 7 | 8 | 9 | ]]>Global HTTP Settings<xml-fragment/>UTF-8http://webservices.daehosting.com/services/TemperatureConversions.wso 10 | 11 | 12 | 13 | 109 14 | 15 | 16 | ]]>Global HTTP Settings<xml-fragment/>UTF-8http://webservices.daehosting.com/services/TemperatureConversions.wso 17 | 18 | 19 | 20 | 10 21 | 30 22 | 23 | 24 | ]]>Global HTTP Settings<xml-fragment/>UTF-8http://webservices.daehosting.com/services/TemperatureConversions.wso 25 | 26 | 27 | 28 | 109 29 | 10 30 | 31 | 32 | ]]>Global HTTP Settingshttp://webservices.daehosting.com/services/TemperatureConversions.wso?WSDL 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | Converts a Celcius Temperature to a Fahrenheit value 122 | 123 | 124 | 125 | 126 | Converts a Fahrenheit Temperature to a Celcius value 127 | 128 | 129 | 130 | 131 | Windchill temperature calculated with the formula of Steadman 132 | 133 | 134 | 135 | 136 | Windchill temperature calculated with the formula of Steadman 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | DataFlex Web Service to convert temperature values between Celcius and Fahrenheit 221 | 222 | 223 | 224 | 225 | 226 | 227 | 228 | ]]>http://schemas.xmlsoap.org/wsdl/http://webservices.daehosting.com/services/TemperatureConversions.wso<xml-fragment/>UTF-8http://webservices.daehosting.com/services/TemperatureConversions.wso 229 | 230 | 231 | 232 | 121 233 | 234 | 235 | ]]>Global HTTP Settings<xml-fragment/>UTF-8http://webservices.daehosting.com/services/TemperatureConversions.wso 236 | 237 | 238 | 239 | 78 240 | 241 | 242 | ]]>Global HTTP Settings<xml-fragment/>UTF-8http://webservices.daehosting.com/services/TemperatureConversions.wso 243 | 244 | 245 | 246 | 10 247 | 60 248 | 249 | 250 | ]]>Global HTTP Settings<xml-fragment/>UTF-8http://webservices.daehosting.com/services/TemperatureConversions.wso 251 | 252 | 253 | 254 | 70 255 | 11 256 | 257 | 258 | ]]>Global HTTP SettingsSEQUENTIALTemperatureConversionsSoapBinding12CelciusToFahrenheit<xml-fragment/>UTF-8http://webservices.daehosting.com/services/TemperatureConversions.wso 259 | 260 | 261 | 262 | 121 263 | 264 | 265 | ]]>CelciusToFahrenheitResult>249.8falsefalseGlobal HTTP SettingsTemperatureConversionsSoapBinding12FahrenheitToCelcius<xml-fragment/>UTF-8http://webservices.daehosting.com/services/TemperatureConversions.wso 266 | 267 | 268 | 269 | 78 270 | 271 | 272 | ]]>CelciusToFahrenheitResult>249.8falsefalseGlobal HTTP SettingsTemperatureConversionsSoapBinding12WindChillInCelcius<xml-fragment/>UTF-8http://webservices.daehosting.com/services/TemperatureConversions.wso 273 | 274 | 275 | 276 | 10 277 | 60 278 | 279 | 280 | ]]>Global HTTP SettingsTemperatureConversionsSoapBinding12WindChillInFahrenheit<xml-fragment/>UTF-8http://webservices.daehosting.com/services/TemperatureConversions.wso 281 | 282 | 283 | 284 | 70 285 | 11 286 | 287 | 288 | ]]>Global HTTP Settings -------------------------------------------------------------------------------- /src/integTest/resources/TemperatureConversions-soapui-project_PASS.xml: -------------------------------------------------------------------------------- 1 | 2 | http://webservices.daehosting.com/services/TemperatureConversions.wso<xml-fragment/>UTF-8http://webservices.daehosting.com/services/TemperatureConversions.wso 3 | 4 | 5 | 6 | 15 7 | 8 | 9 | ]]>Global HTTP Settings<xml-fragment/>UTF-8http://webservices.daehosting.com/services/TemperatureConversions.wso 10 | 11 | 12 | 13 | 109 14 | 15 | 16 | ]]>Global HTTP Settings<xml-fragment/>UTF-8http://webservices.daehosting.com/services/TemperatureConversions.wso 17 | 18 | 19 | 20 | 10 21 | 30 22 | 23 | 24 | ]]>Global HTTP Settings<xml-fragment/>UTF-8http://webservices.daehosting.com/services/TemperatureConversions.wso 25 | 26 | 27 | 28 | 109 29 | 10 30 | 31 | 32 | ]]>Global HTTP Settingshttp://webservices.daehosting.com/services/TemperatureConversions.wso?WSDL 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | Converts a Celcius Temperature to a Fahrenheit value 122 | 123 | 124 | 125 | 126 | Converts a Fahrenheit Temperature to a Celcius value 127 | 128 | 129 | 130 | 131 | Windchill temperature calculated with the formula of Steadman 132 | 133 | 134 | 135 | 136 | Windchill temperature calculated with the formula of Steadman 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | DataFlex Web Service to convert temperature values between Celcius and Fahrenheit 221 | 222 | 223 | 224 | 225 | 226 | 227 | 228 | ]]>http://schemas.xmlsoap.org/wsdl/http://webservices.daehosting.com/services/TemperatureConversions.wso<xml-fragment/>UTF-8http://webservices.daehosting.com/services/TemperatureConversions.wso 229 | 230 | 231 | 232 | 121 233 | 234 | 235 | ]]>Global HTTP Settings<xml-fragment/>UTF-8http://webservices.daehosting.com/services/TemperatureConversions.wso 236 | 237 | 238 | 239 | 78 240 | 241 | 242 | ]]>Global HTTP Settings<xml-fragment/>UTF-8http://webservices.daehosting.com/services/TemperatureConversions.wso 243 | 244 | 245 | 246 | 10 247 | 60 248 | 249 | 250 | ]]>Global HTTP Settings<xml-fragment/>UTF-8http://webservices.daehosting.com/services/TemperatureConversions.wso 251 | 252 | 253 | 254 | 70 255 | 11 256 | 257 | 258 | ]]>Global HTTP SettingsSEQUENTIALTemperatureConversionsSoapBinding12CelciusToFahrenheit<xml-fragment/>UTF-8http://webservices.daehosting.com/services/TemperatureConversions.wso 259 | 260 | 261 | 262 | 121 263 | 264 | 265 | ]]>CelciusToFahrenheitResult>249.8falsefalseGlobal HTTP SettingsTemperatureConversionsSoapBinding12FahrenheitToCelcius<xml-fragment/>UTF-8http://webservices.daehosting.com/services/TemperatureConversions.wso 266 | 267 | 268 | 269 | 78 270 | 271 | 272 | ]]>Global HTTP SettingsTemperatureConversionsSoapBinding12WindChillInCelcius<xml-fragment/>UTF-8http://webservices.daehosting.com/services/TemperatureConversions.wso 273 | 274 | 275 | 276 | 10 277 | 60 278 | 279 | 280 | ]]>Global HTTP SettingsTemperatureConversionsSoapBinding12WindChillInFahrenheit<xml-fragment/>UTF-8http://webservices.daehosting.com/services/TemperatureConversions.wso 281 | 282 | 283 | 284 | 70 285 | 11 286 | 287 | 288 | ]]>Global HTTP Settings -------------------------------------------------------------------------------- /src/main/groovy/io/byteshifter/plugins/soapui/SoapUIPlugin.groovy: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2014 Sion Williams 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | package io.byteshifter.plugins.soapui 25 | 26 | import io.byteshifter.plugins.soapui.extensions.* 27 | import io.byteshifter.plugins.soapui.tasks.* 28 | import org.gradle.api.Plugin 29 | import org.gradle.api.Project 30 | 31 | /** 32 | * SoapUI implementation of the plugin interface 33 | * 34 | * @author Sion Williams 35 | */ 36 | class SoapUIPlugin implements Plugin { 37 | 38 | @Override 39 | void apply(Project project) { 40 | // Create and install the extension object 41 | SoapUIPluginExtension soapUIPluginExtension = project.extensions.create( 'soapui', SoapUIPluginExtension ) 42 | soapUIPluginExtension.extensions.create( 'tool', SoapUIToolConvention ) 43 | soapUIPluginExtension.extensions.create( 'security', SoapUISecurityConvention ) 44 | soapUIPluginExtension.extensions.create( 'load', SoapUILoadConvention ) 45 | soapUIPluginExtension.extensions.create( 'test', SoapUITestConvention ) 46 | soapUIPluginExtension.extensions.create( 'mock', SoapUIMockConvention ) 47 | 48 | configSoapTest( project, soapUIPluginExtension ) 49 | configSoapTool( project, soapUIPluginExtension ) 50 | configSoapMock( project, soapUIPluginExtension ) 51 | configSoapLoad( project, soapUIPluginExtension ) 52 | configSoapSecurityTest( project, soapUIPluginExtension ) 53 | } 54 | 55 | /** 56 | * Configures soap test task. 57 | * 58 | * @param project Project 59 | * @param soapUIPluginExtension SoapUIPluginExtension 60 | */ 61 | private void configSoapTest(Project project, SoapUIPluginExtension soapUIPluginExtension) { 62 | project.task( 'soaptest', type: TestTask) { 63 | conventionMapping.projectFile = { soapUIPluginExtension.test.projectFile } 64 | conventionMapping.settingsFile = { soapUIPluginExtension.test.settingsFile } 65 | conventionMapping.projectPassword = { soapUIPluginExtension.test.projectPassword } 66 | conventionMapping.settingsPassword = { soapUIPluginExtension.test.settingsPassword } 67 | 68 | conventionMapping.testSuite = { soapUIPluginExtension.test.testSuite } 69 | conventionMapping.testCase = { soapUIPluginExtension.test.testCase } 70 | conventionMapping.username = { soapUIPluginExtension.test.username } 71 | conventionMapping.password = { soapUIPluginExtension.test.password } 72 | conventionMapping.wssPasswordType = { soapUIPluginExtension.test.wssPasswordType } 73 | conventionMapping.domain = { soapUIPluginExtension.test.domain } 74 | conventionMapping.host = { soapUIPluginExtension.test.host } 75 | conventionMapping.endpoint = { soapUIPluginExtension.test.endpoint } 76 | conventionMapping.skip = { soapUIPluginExtension.test.skip } 77 | conventionMapping.globalProperties = { soapUIPluginExtension.test.globalProperties } 78 | conventionMapping.projectProperties = { soapUIPluginExtension.test.projectProperties } 79 | conventionMapping.outputFolder = { soapUIPluginExtension.test.outputFolder } 80 | conventionMapping.soapuiProperties = { soapUIPluginExtension.test.soapuiProperties } 81 | conventionMapping.printReport = { soapUIPluginExtension.test.printReport } 82 | conventionMapping.interactive = { soapUIPluginExtension.test.interactive } 83 | conventionMapping.exportAll = { soapUIPluginExtension.test.exportAll } 84 | conventionMapping.junitReport = { soapUIPluginExtension.test.junitReport } 85 | conventionMapping.testFailIgnore = { soapUIPluginExtension.test.testFailIgnore } 86 | conventionMapping.saveAfterRun = { soapUIPluginExtension.test.saveAfterRun } 87 | } 88 | } 89 | 90 | /** 91 | * Configures tool task. 92 | * 93 | * @param project Project 94 | * @param soapUIPluginExtension SoapUIPluginExtension 95 | */ 96 | private void configSoapTool(Project project, SoapUIPluginExtension soapUIPluginExtension) { 97 | project.task( 'soaptool', type: ToolTask ) { 98 | conventionMapping.projectFile = { soapUIPluginExtension.tool.projectFile } 99 | conventionMapping.settingsFile = { soapUIPluginExtension.tool.settingsFile } 100 | conventionMapping.projectPassword = { soapUIPluginExtension.tool.projectPassword } 101 | conventionMapping.settingsPassword = { soapUIPluginExtension.tool.settingsPassword } 102 | 103 | conventionMapping.iface = { soapUIPluginExtension.tool.iface } 104 | conventionMapping.tool = { soapUIPluginExtension.tool.tool } 105 | conventionMapping.outputFolder = { soapUIPluginExtension.tool.outputFolder } 106 | conventionMapping.soapuiProperties = { soapUIPluginExtension.tool.soapuiProperties } 107 | } 108 | } 109 | 110 | /** 111 | * Configures mock task. 112 | * 113 | * @param project Project 114 | * @param soapUIPluginExtension SoapUIPluginExtension 115 | */ 116 | private void configSoapMock(Project project, SoapUIPluginExtension soapUIPluginExtension) { 117 | project.task( 'soapmock', type: MockServiceTask ) { 118 | conventionMapping.projectFile = { soapUIPluginExtension.mock.projectFile } 119 | conventionMapping.settingsFile = { soapUIPluginExtension.mock.settingsFile } 120 | conventionMapping.projectPassword = { soapUIPluginExtension.mock.projectPassword } 121 | conventionMapping.settingsPassword = { soapUIPluginExtension.mock.settingsPassword } 122 | 123 | conventionMapping.skip = { soapUIPluginExtension.mock.skip } 124 | conventionMapping.globalProperties = { soapUIPluginExtension.mock.globalProperties } 125 | conventionMapping.projectProperties = { soapUIPluginExtension.mock.projectProperties } 126 | conventionMapping.saveAfterRun = { soapUIPluginExtension.mock.saveAfterRun } 127 | conventionMapping.soapuiProperties = { soapUIPluginExtension.mock.soapuiProperties } 128 | } 129 | } 130 | 131 | /** 132 | * Configures load task. 133 | * 134 | * @param project Project 135 | * @param soapUIPluginExtension SoapUIPluginExtension 136 | */ 137 | private void configSoapLoad(Project project, SoapUIPluginExtension soapUIPluginExtension) { 138 | project.task( 'soaploadtest', type: LoadTestTask ) { 139 | conventionMapping.projectFile = { soapUIPluginExtension.load.projectFile } 140 | conventionMapping.settingsFile = { soapUIPluginExtension.load.settingsFile } 141 | conventionMapping.projectPassword = { soapUIPluginExtension.load.projectPassword } 142 | conventionMapping.settingsPassword = { soapUIPluginExtension.load.settingsPassword } 143 | 144 | conventionMapping.testSuite = { soapUIPluginExtension.load.testSuite } 145 | conventionMapping.testCase = { soapUIPluginExtension.load.testCase } 146 | conventionMapping.username = { soapUIPluginExtension.load.username } 147 | conventionMapping.password = { soapUIPluginExtension.load.password } 148 | conventionMapping.wssPasswordType = { soapUIPluginExtension.load.wssPasswordType } 149 | conventionMapping.domain = { soapUIPluginExtension.load.domain } 150 | conventionMapping.host = { soapUIPluginExtension.load.host } 151 | conventionMapping.endpoint = { soapUIPluginExtension.load.endpoint } 152 | conventionMapping.skip = { soapUIPluginExtension.load.skip } 153 | conventionMapping.outputFolder = { soapUIPluginExtension.load.outputFolder } 154 | conventionMapping.printReport = { soapUIPluginExtension.load.printReport } 155 | conventionMapping.saveAfterRun = { soapUIPluginExtension.load.saveAfterRun } 156 | conventionMapping.loadTest = { soapUIPluginExtension.load.loadTest } 157 | conventionMapping.limit = { soapUIPluginExtension.load.limit } 158 | conventionMapping.threadCount = { soapUIPluginExtension.load.threadCount } 159 | } 160 | } 161 | 162 | /** 163 | * Configures soap security test task. 164 | * 165 | * @param project Project 166 | * @param soapUIPluginExtension SoapUIPluginExtension 167 | */ 168 | private void configSoapSecurityTest(Project project, SoapUIPluginExtension soapUIPluginExtension) { 169 | project.task( 'soapsecuritytest', type: SecurityTestTask ) { 170 | conventionMapping.projectFile = { soapUIPluginExtension.security.projectFile } 171 | conventionMapping.settingsFile = { soapUIPluginExtension.security.settingsFile } 172 | conventionMapping.projectPassword = { soapUIPluginExtension.security.projectPassword } 173 | conventionMapping.settingsPassword = { soapUIPluginExtension.security.settingsPassword } 174 | 175 | conventionMapping.securityTest = { soapUIPluginExtension.security.securityTest } 176 | conventionMapping.testSuite = { soapUIPluginExtension.security.testSuite } 177 | conventionMapping.testCase = { soapUIPluginExtension.security.testCase } 178 | conventionMapping.username = { soapUIPluginExtension.security.username } 179 | conventionMapping.password = { soapUIPluginExtension.security.password } 180 | conventionMapping.wssPasswordType = { soapUIPluginExtension.security.wssPasswordType } 181 | conventionMapping.domain = { soapUIPluginExtension.security.domain } 182 | conventionMapping.host = { soapUIPluginExtension.security.host } 183 | conventionMapping.endpoint = { soapUIPluginExtension.security.endpoint } 184 | conventionMapping.skip = { soapUIPluginExtension.security.skip } 185 | conventionMapping.globalProperties = { soapUIPluginExtension.security.globalProperties } 186 | conventionMapping.projectProperties = { soapUIPluginExtension.security.projectProperties } 187 | conventionMapping.outputFolder = { soapUIPluginExtension.security.outputFolder } 188 | conventionMapping.printReport = { soapUIPluginExtension.security.printReport } 189 | conventionMapping.interactive = { soapUIPluginExtension.security.interactive } 190 | conventionMapping.exportAll = { soapUIPluginExtension.security.exportAll } 191 | conventionMapping.junitReport = { soapUIPluginExtension.security.junitReport } 192 | conventionMapping.testFailIgnore = { soapUIPluginExtension.security.testFailIgnore } 193 | conventionMapping.saveAfterRun = { soapUIPluginExtension.security.saveAfterRun } 194 | } 195 | } 196 | } 197 | -------------------------------------------------------------------------------- /src/main/groovy/io/byteshifter/plugins/soapui/extensions/SoapUILoadConvention.groovy: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2014 Sion Williams 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | package io.byteshifter.plugins.soapui.extensions 25 | 26 | /** 27 | * Defines Load task convention. 28 | * 29 | * @author Sion Williams 30 | */ 31 | class SoapUILoadConvention { 32 | String projectFile 33 | String settingsFile 34 | String projectPassword 35 | String settingsPassword 36 | String loadTest 37 | Integer limit 38 | Integer threadCount 39 | String testSuite 40 | String testCase 41 | String username 42 | String password 43 | String wssPasswordType 44 | String domain 45 | String host 46 | String endpoint 47 | boolean skip 48 | String[] globalProperties 49 | String[] projectProperties 50 | boolean saveAfterRun 51 | boolean printReport 52 | String outputFolder 53 | } 54 | -------------------------------------------------------------------------------- /src/main/groovy/io/byteshifter/plugins/soapui/extensions/SoapUIMockConvention.groovy: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2014 Sion Williams 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | package io.byteshifter.plugins.soapui.extensions 25 | 26 | /** 27 | * Defines the mocking service convention 28 | * 29 | * @author Sion Williams 30 | */ 31 | class SoapUIMockConvention { 32 | String projectFile 33 | String settingsFile 34 | String projectPassword 35 | String settingsPassword 36 | boolean skip 37 | String[] globalProperties 38 | String[] projectProperties 39 | boolean saveAfterRun 40 | Properties soapuiProperties 41 | } 42 | -------------------------------------------------------------------------------- /src/main/groovy/io/byteshifter/plugins/soapui/extensions/SoapUIPluginExtension.groovy: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2014 Sion Williams 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | package io.byteshifter.plugins.soapui.extensions 25 | /** 26 | * SoapUI plug-in extension to expose the properties and methods accessed in the extension block 27 | * 28 | * @author Sion Williams 29 | */ 30 | class SoapUIPluginExtension { 31 | 32 | // the following convention properties are added dynamically when the plugin is applied: 33 | // SoapUIToolConvention tool 34 | // SoapUISecurityConvention security 35 | // SoapUILoadConvention load 36 | // SoapUITestConvention test 37 | // SoapUIMockConvention mock 38 | } 39 | -------------------------------------------------------------------------------- /src/main/groovy/io/byteshifter/plugins/soapui/extensions/SoapUISecurityConvention.groovy: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2014 Sion Williams 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | package io.byteshifter.plugins.soapui.extensions 25 | 26 | /** 27 | * Defines Security task convention. 28 | * 29 | * @author Sion 30 | */ 31 | class SoapUISecurityConvention { 32 | 33 | String projectFile 34 | String settingsFile 35 | String projectPassword 36 | String settingsPassword 37 | 38 | String securityTest 39 | 40 | String testSuite 41 | String testCase 42 | String username 43 | String password 44 | String wssPasswordType 45 | String domain 46 | String host 47 | String endpoint 48 | boolean interactive 49 | boolean exportAll 50 | boolean junitReport 51 | boolean skip 52 | String[] globalProperties 53 | String[] projectProperties 54 | boolean saveAfterRun 55 | boolean printReport 56 | String outputFolder 57 | boolean testFailIgnore 58 | } 59 | -------------------------------------------------------------------------------- /src/main/groovy/io/byteshifter/plugins/soapui/extensions/SoapUITestConvention.groovy: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2014 Sion Williams 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | package io.byteshifter.plugins.soapui.extensions 25 | 26 | /** 27 | * Defines soapui test task convention. 28 | * 29 | * @author Sion Williams 30 | */ 31 | class SoapUITestConvention { 32 | String projectFile 33 | String settingsFile 34 | String projectPassword 35 | String settingsPassword 36 | 37 | String testSuite 38 | String testCase 39 | String username 40 | String password 41 | String wssPasswordType 42 | String domain 43 | String host 44 | String endpoint 45 | boolean skip 46 | String[] globalProperties 47 | String[] projectProperties 48 | String outputFolder 49 | Properties soapuiProperties 50 | boolean interactive 51 | boolean exportAll 52 | boolean junitReport 53 | boolean saveAfterRun 54 | boolean printReport 55 | boolean testFailIgnore 56 | } 57 | -------------------------------------------------------------------------------- /src/main/groovy/io/byteshifter/plugins/soapui/extensions/SoapUIToolConvention.groovy: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2014 Sion Williams 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | package io.byteshifter.plugins.soapui.extensions 25 | 26 | /** 27 | * Defines Tool task convention. 28 | * 29 | * @author Sion 30 | */ 31 | class SoapUIToolConvention { 32 | String projectFile 33 | String settingsFile 34 | String projectPassword 35 | String settingsPassword 36 | 37 | String tool 38 | String iface 39 | String outputFolder 40 | Properties soapuiProperties 41 | } 42 | -------------------------------------------------------------------------------- /src/main/groovy/io/byteshifter/plugins/soapui/tasks/LoadTestTask.groovy: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2014 Sion Williams 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | package io.byteshifter.plugins.soapui.tasks 25 | 26 | import com.eviware.soapui.SoapUI 27 | import com.eviware.soapui.tools.SoapUILoadTestRunner 28 | import org.gradle.api.tasks.Optional 29 | 30 | /** 31 | * Runs soapUI load tests 32 | * task name - loadtest 33 | * 34 | * @author Sion Williams 35 | */ 36 | class LoadTestTask extends SoapUITask { 37 | 38 | /** 39 | * The TestSuite to run 40 | */ 41 | @Optional 42 | String testSuite 43 | 44 | /** 45 | * The TestCase to run 46 | */ 47 | @Optional 48 | String testCase 49 | 50 | /** 51 | * The LoadTest to run 52 | */ 53 | String loadTest 54 | 55 | /** 56 | * The username to use for authentication challenges 57 | */ 58 | @Optional 59 | String username 60 | 61 | /** 62 | * The password to use for authentication challenges 63 | */ 64 | @Optional 65 | String password 66 | 67 | /** 68 | * The WSS password-type to use for any authentications. Setting this will result 69 | * in the addition of WS-Security UsernamePassword tokens to any outgoing request containing 70 | * the specified username and password. Set to either 'Text' or 'Digest' 71 | */ 72 | @Optional 73 | String wssPasswordType 74 | 75 | /** 76 | * The domain to use for authentication challenges 77 | */ 78 | @Optional 79 | String domain 80 | 81 | /** 82 | * The host to use for requests 83 | */ 84 | @Optional 85 | String host 86 | 87 | /** 88 | * Overrides the endpoint to use for requests 89 | */ 90 | @Optional 91 | String endpoint 92 | 93 | /** 94 | * Overrides the LoadTest limit 95 | */ 96 | @Optional 97 | Integer limit 98 | 99 | /** 100 | * Overrides the LoadTest threadCount 101 | */ 102 | @Optional 103 | Integer threadCount 104 | 105 | /** 106 | * Sets the output folder for reports 107 | */ 108 | @Optional 109 | String outputFolder 110 | 111 | /** 112 | * Turns on printing of reports 113 | */ 114 | boolean printReport 115 | 116 | /** 117 | * Tells Test Runner to skip tests. 118 | */ 119 | @Optional 120 | boolean skip 121 | 122 | /** 123 | * Specified global property values 124 | */ 125 | @Optional 126 | String[] globalProperties 127 | 128 | /** 129 | * Specified project property values 130 | */ 131 | @Optional 132 | String[] projectProperties 133 | 134 | /** 135 | * Saves project file after running tests 136 | */ 137 | boolean saveAfterRun 138 | 139 | /** 140 | * SoapUI Properties. 141 | */ 142 | @Optional 143 | Properties soapuiProperties 144 | 145 | LoadTestTask() { 146 | super('Runs soapUI load tests.') 147 | } 148 | 149 | @Override 150 | public void executeAction() { 151 | SoapUILoadTestRunner runner = new SoapUILoadTestRunner( 152 | 'soapUI ' + SoapUI.SOAPUI_VERSION + ' Gradle LoadTest Runner') 153 | runner.projectFile = projectFile 154 | 155 | if (endpoint) { 156 | runner.endpoint = endpoint 157 | } 158 | 159 | if (testSuite) { 160 | runner.testSuite = testSuite 161 | } 162 | 163 | if (testCase) { 164 | runner.testCase = testCase 165 | } 166 | 167 | if (username) { 168 | runner.username = username 169 | } 170 | 171 | if (password) { 172 | runner.password = password 173 | } 174 | 175 | if (wssPasswordType) { 176 | runner.wssPasswordType = wssPasswordType 177 | } 178 | 179 | if (domain) { 180 | runner.domain = domain 181 | } 182 | 183 | if (limit) { 184 | runner.limit = limit.intValue() 185 | } 186 | 187 | if (threadCount) { 188 | runner.threadCount = threadCount.intValue() 189 | } 190 | 191 | if (host) { 192 | runner.host = host 193 | } 194 | 195 | if (outputFolder) { 196 | runner.outputFolder = outputFolder 197 | } 198 | 199 | runner.printReport = printReport 200 | runner.saveAfterRun = saveAfterRun 201 | 202 | if (settingsFile) { 203 | runner.settingsFile = settingsFile 204 | } 205 | 206 | if (projectPassword) { 207 | runner.projectPassword = projectPassword 208 | } 209 | 210 | if (settingsPassword) { 211 | runner.soapUISettingsPassword = settingsPassword 212 | } 213 | 214 | if (globalProperties) { 215 | runner.globalProperties = globalProperties 216 | } 217 | 218 | if (projectProperties) { 219 | runner.projectProperties = projectProperties 220 | } 221 | 222 | if (soapuiProperties != null && soapuiProperties.size() > 0) { 223 | for (Object key : soapuiProperties.keySet()) { 224 | println('Setting ' + (String) key + ' value ' + soapuiProperties.getProperty((String) key)) 225 | System.setProperty((String) key, soapuiProperties.getProperty((String) key)) 226 | } 227 | } 228 | 229 | runner.run() 230 | } 231 | } 232 | -------------------------------------------------------------------------------- /src/main/groovy/io/byteshifter/plugins/soapui/tasks/MockServiceTask.groovy: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2014 Sion Williams 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | package io.byteshifter.plugins.soapui.tasks 25 | 26 | import com.eviware.soapui.SoapUI 27 | import com.eviware.soapui.tools.SoapUIMockServiceRunner 28 | import org.gradle.api.tasks.Optional 29 | 30 | /** 31 | * Runs soapUI mockservice 32 | * task name - mock 33 | * @author Sion Williams 34 | */ 35 | class MockServiceTask extends SoapUITask { 36 | 37 | /** 38 | * The mockservice to run 39 | */ 40 | @Optional 41 | String mockService 42 | 43 | /** 44 | * The path to listen on 45 | */ 46 | @Optional 47 | private String path 48 | 49 | /** 50 | * The port to listen on 51 | */ 52 | @Optional 53 | String port 54 | 55 | /** 56 | * To not wait for input 57 | */ 58 | boolean noBlock 59 | 60 | /** 61 | * Tells Test Runner to skip tests. 62 | */ 63 | @Optional 64 | boolean skip 65 | 66 | /** 67 | * Specified global property values 68 | */ 69 | @Optional 70 | String[] globalProperties 71 | 72 | /** 73 | * Specified project property values 74 | */ 75 | @Optional 76 | String[] projectProperties 77 | 78 | /** 79 | * Saves project file after running tests 80 | */ 81 | boolean saveAfterRun 82 | 83 | /** 84 | * SoapUI Properties. 85 | */ 86 | @Optional 87 | Properties soapuiProperties 88 | 89 | MockServiceTask() { 90 | super('Runs soapUI mock service') 91 | } 92 | 93 | @Override 94 | public void executeAction() { 95 | 96 | SoapUIMockServiceRunner runner = new MySoapUIMockServiceRunner( 97 | 'soapUI ' + SoapUI.SOAPUI_VERSION + ' Gradle MockService Runner') 98 | runner.projectFile = projectFile 99 | 100 | 101 | if (mockService) { 102 | runner.mockService = mockService 103 | } 104 | 105 | if (path) { 106 | runner.path = path 107 | } 108 | 109 | if (port) { 110 | runner.port = port 111 | } 112 | 113 | if (settingsFile) { 114 | runner.settingsFile = settingsFile 115 | } 116 | 117 | runner.block = !noBlock 118 | runner.saveAfterRun = saveAfterRun 119 | 120 | if (projectPassword) { 121 | runner.projectPassword = projectPassword 122 | } 123 | 124 | if (settingsPassword) { 125 | runner.soapUISettingsPassword = settingsPassword 126 | } 127 | 128 | if (globalProperties) { 129 | runner.globalProperties = globalProperties 130 | } 131 | 132 | if (projectProperties) { 133 | runner.projectProperties = projectProperties 134 | } 135 | 136 | if (soapuiProperties != null && soapuiProperties.size() > 0) { 137 | for (Object key : soapuiProperties.keySet()) { 138 | System.out.println('Setting ' + (String) key + ' value ' + soapuiProperties.getProperty((String) key)) 139 | System.setProperty((String) key, soapuiProperties.getProperty((String) key)) 140 | } 141 | } 142 | 143 | runner.run() 144 | } 145 | } 146 | 147 | /* 148 | * This class is a hack 149 | * see https://discuss.gradle.org/t/classpath-hell-soapui-and-gradle-api-logging-conflicts/8830/6?u=sion_williams 150 | */ 151 | class MySoapUIMockServiceRunner extends SoapUIMockServiceRunner { 152 | MySoapUIMockServiceRunner() { super() } 153 | MySoapUIMockServiceRunner(String title) { super(title) } 154 | @Override void initGroovyLog() { } 155 | } 156 | -------------------------------------------------------------------------------- /src/main/groovy/io/byteshifter/plugins/soapui/tasks/SecurityTestTask.groovy: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2014 Sion Williams 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | package io.byteshifter.plugins.soapui.tasks 25 | 26 | import com.eviware.soapui.SoapUI 27 | import com.eviware.soapui.tools.SoapUISecurityTestRunner 28 | import org.gradle.api.tasks.Optional 29 | import org.gradle.api.tasks.TaskAction 30 | 31 | /** 32 | * 33 | * task name - securityTest 34 | * @author Sion Williams 35 | */ 36 | class SecurityTestTask extends SoapUITask { 37 | 38 | /** 39 | * The TestSuite to run project file to test with 40 | */ 41 | @Optional 42 | String testSuite 43 | 44 | /** 45 | * The TestCase to run project file to test with 46 | */ 47 | @Optional 48 | String testCase 49 | 50 | /** 51 | * The username to use for authentication challenges 52 | */ 53 | @Optional 54 | String username 55 | 56 | /** 57 | * The password to use for authentication challenges 58 | */ 59 | @Optional 60 | String password 61 | 62 | /** 63 | * The WSS password-type to use for any authentications. Setting this will 64 | * result in the addition of WS-Security UsernamePassword tokens to any 65 | * outgoing request containing the specified username and password. Set to 66 | * either 'Text' or 'Digest' 67 | */ 68 | @Optional 69 | String wssPasswordType 70 | 71 | /** 72 | * The domain to use for authentication challenges 73 | */ 74 | @Optional 75 | String domain 76 | 77 | /** 78 | * The host to use for requests 79 | */ 80 | @Optional 81 | String host 82 | 83 | /** 84 | * Overrides the endpoint to use for requests 85 | */ 86 | @Optional 87 | String endpoint 88 | 89 | /** 90 | * Sets the output folder for reports 91 | */ 92 | @Optional 93 | String outputFolder 94 | 95 | /** 96 | * Turns on printing of reports 97 | */ 98 | boolean printReport 99 | 100 | /** 101 | * Enabled interactive groovy scripts 102 | */ 103 | boolean interactive 104 | 105 | /** 106 | * Turns on exporting of all results 107 | */ 108 | boolean exportAll 109 | 110 | /** 111 | * Turns on creation of reports in junit style 112 | */ 113 | boolean junitReport 114 | 115 | /** 116 | * Tells Test Runner to skip tests. 117 | */ 118 | @Optional 119 | boolean skip 120 | 121 | /** 122 | * If set ignore failed tests 123 | */ 124 | boolean testFailIgnore 125 | 126 | /** 127 | * Specified global property values soapui.saveAfterRun 128 | */ 129 | @Optional 130 | String[] globalProperties 131 | 132 | /** 133 | * Specified project property values 134 | */ 135 | @Optional 136 | String[] projectProperties 137 | 138 | /** 139 | * Saves project file after running tests 140 | */ 141 | boolean saveAfterRun 142 | 143 | /** 144 | * SoapUI Properties. 145 | */ 146 | @Optional 147 | Properties soapuiProperties 148 | 149 | /** 150 | * Security Test Name 151 | */ 152 | @Optional 153 | String securityTest 154 | 155 | SecurityTestTask() { 156 | super('Runs soapUI security tests') 157 | } 158 | 159 | @TaskAction 160 | public void executeAction() { 161 | 162 | SoapUISecurityTestRunner runner = new SoapUISecurityTestRunner( 163 | 'soapUI ' + SoapUI.SOAPUI_VERSION + ' Gradle Security Test Runner') 164 | runner.projectFile = projectFile 165 | 166 | if (endpoint) { 167 | runner.endpoint = endpoint 168 | } 169 | 170 | if (testSuite) { 171 | runner.testSuite = testSuite 172 | } 173 | 174 | if (testCase) { 175 | runner.testCase = testCase 176 | } 177 | 178 | if (username) { 179 | runner.username = username 180 | } 181 | 182 | if (password) { 183 | runner.password = password 184 | } 185 | 186 | if (wssPasswordType) { 187 | runner.wssPasswordType = wssPasswordType 188 | } 189 | 190 | if (domain) { 191 | runner.domain = domain 192 | } 193 | 194 | if (host) { 195 | runner.host = host 196 | } 197 | 198 | if (outputFolder) { 199 | runner.outputFolder = outputFolder 200 | } 201 | 202 | runner.printReport = printReport 203 | runner.exportAll = exportAll 204 | runner.junitReport = junitReport 205 | runner.enableUI = interactive 206 | runner.ignoreError = testFailIgnore 207 | runner.saveAfterRun = saveAfterRun 208 | 209 | if (settingsFile) { 210 | runner.settingsFile = settingsFile 211 | } 212 | 213 | if (projectPassword) { 214 | runner.projectPassword = projectPassword 215 | } 216 | 217 | if (settingsPassword) { 218 | runner.soapUISettingsPassword = settingsPassword 219 | } 220 | 221 | if (globalProperties) { 222 | runner.globalProperties = globalProperties 223 | } 224 | 225 | if (projectProperties) { 226 | runner.projectProperties = projectProperties 227 | } 228 | 229 | if (soapuiProperties && soapuiProperties.size() > 0){ 230 | for (Object key : soapuiProperties.keySet()) { 231 | System.setProperty((String) key, soapuiProperties.getProperty((String) key)) 232 | } 233 | } 234 | 235 | if (securityTest && securityTest.length() > 0) { 236 | runner.securityTestName = securityTest 237 | } 238 | 239 | runner.run() 240 | } 241 | } 242 | -------------------------------------------------------------------------------- /src/main/groovy/io/byteshifter/plugins/soapui/tasks/SoapUITask.groovy: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2014 Sion Williams 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | package io.byteshifter.plugins.soapui.tasks 25 | 26 | import org.gradle.api.DefaultTask 27 | import org.gradle.api.GradleException 28 | import org.gradle.api.tasks.Input 29 | import org.gradle.api.tasks.Optional 30 | import org.gradle.api.tasks.TaskAction 31 | 32 | /** 33 | * Abstract SoapUI task 34 | * 35 | * @author Sion Williams 36 | */ 37 | abstract class SoapUITask extends DefaultTask { 38 | 39 | /** 40 | * The soapUI project file to test with 41 | */ 42 | @Input 43 | String projectFile 44 | 45 | /** 46 | * Specifies soapUI settings file to use 47 | */ 48 | @Optional 49 | String settingsFile 50 | 51 | /** 52 | * Specifies password for encrypted soapUI project file 53 | */ 54 | @Optional 55 | String projectPassword 56 | 57 | /** 58 | * Specifies password for encrypted soapui-settings file 59 | */ 60 | @Optional 61 | String settingsPassword 62 | 63 | SoapUITask(String description) { 64 | this.description = description 65 | group = 'SoapUI' 66 | } 67 | 68 | @TaskAction 69 | void run() { 70 | executeAction() 71 | 72 | } 73 | 74 | /** 75 | * Catches exception and handles it 76 | */ 77 | private void withExceptionHandling(Closure c) { 78 | if (!getProjectFile()) { 79 | logger.error "soapui-project-file setting is required" 80 | throw new GradleException('soapui-project-file setting is required') 81 | } 82 | 83 | try { 84 | c 85 | } 86 | catch (Exception e) { 87 | logger.error( "Exception caught:", e ) 88 | throw new GradleException(e.message) 89 | } 90 | } 91 | 92 | /** 93 | * Abstract method required to be implemented by subclass 94 | */ 95 | abstract void executeAction() 96 | } 97 | -------------------------------------------------------------------------------- /src/main/groovy/io/byteshifter/plugins/soapui/tasks/TestTask.groovy: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2014 Sion Williams 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | package io.byteshifter.plugins.soapui.tasks 25 | 26 | import com.eviware.soapui.SoapUI 27 | import com.eviware.soapui.tools.SoapUITestCaseRunner 28 | import org.gradle.api.tasks.Optional 29 | 30 | /** 31 | * Runs soapUI functional tests 32 | * task name - soaptest 33 | * @author Sion Williams 34 | */ 35 | class TestTask extends SoapUITask { 36 | /** 37 | * The TestSuite to run project file to test with 38 | */ 39 | @Optional 40 | String testSuite 41 | 42 | /** 43 | * The TestCase to run project file to test with 44 | */ 45 | @Optional 46 | String testCase 47 | 48 | /** 49 | * The username to use for authentication challenges 50 | */ 51 | @Optional 52 | String username 53 | 54 | /** 55 | * The password to use for authentication challenges 56 | */ 57 | @Optional 58 | String password 59 | 60 | /** 61 | * The WSS password-type to use for any authentications. Setting this will 62 | * result in the addition of WS-Security UsernamePassword tokens to any 63 | * outgoing request containing the specified username and password. Set to 64 | * either 'Text' or 'Digest' 65 | */ 66 | @Optional 67 | String wssPasswordType 68 | 69 | /** 70 | * The domain to use for authentication challenges 71 | */ 72 | @Optional 73 | String domain 74 | 75 | /** 76 | * The host to use for requests 77 | */ 78 | @Optional 79 | String host 80 | 81 | /** 82 | * Overrides the endpoint to use for requests 83 | */ 84 | @Optional 85 | String endpoint 86 | 87 | /** 88 | * Sets the output folder for reports 89 | */ 90 | @Optional 91 | String outputFolder 92 | 93 | /** 94 | * Turns on printing of reports 95 | */ 96 | boolean printReport 97 | 98 | /** 99 | * Enabled interactive groovy scripts 100 | */ 101 | boolean interactive 102 | 103 | /** 104 | * Turns on exporting of all results 105 | */ 106 | boolean exportAll 107 | 108 | /** 109 | * Turns on creation of reports in junit style 110 | */ 111 | boolean junitReport = false 112 | 113 | /** 114 | * Tells Test Runner to skip tests. 115 | */ 116 | @Optional 117 | boolean skip 118 | 119 | /** 120 | * If set ignore failed tests 121 | */ 122 | boolean testFailIgnore 123 | 124 | /** 125 | * Specified global property values soapui.saveAfterRun 126 | */ 127 | @Optional 128 | String[] globalProperties 129 | 130 | /** 131 | * Specified project property values 132 | */ 133 | @Optional 134 | String[] projectProperties 135 | 136 | /** 137 | * Saves project file after running tests 138 | */ 139 | boolean saveAfterRun 140 | 141 | /** 142 | * SoapUI Properties. 143 | */ 144 | Properties soapuiProperties 145 | 146 | TestTask() { 147 | super('Runs soapUI functional tests') 148 | } 149 | 150 | 151 | @Override 152 | void executeAction() { 153 | SoapUITestCaseRunner runner = new MySoapUITestCaseRunner( 154 | 'soapUI ' + SoapUI.SOAPUI_VERSION + ' Gradle TestCase Runner') 155 | runner.setProjectFile( getProjectFile() ) 156 | 157 | if (getEndpoint()) { 158 | runner.endpoint = getEndpoint() 159 | logger.debug "Runner endpoint: " + getEndpoint() 160 | } 161 | 162 | if (getTestSuite()) { 163 | runner.testSuite = getTestSuite() 164 | logger.debug "Runner testSuite: " + getTestSuite() 165 | } 166 | 167 | if (getTestCase()) { 168 | runner.testCase = getTestCase() 169 | logger.debug "Runner testCase: " + getTestCase() 170 | } 171 | 172 | if (getUsername()) { 173 | runner.username = getUsername() 174 | logger.debug "Runner username: " + getUsername() 175 | } 176 | 177 | if (getPassword()) { 178 | runner.password = getPassword() 179 | logger.debug "Runner password: " + getPassword() 180 | } 181 | 182 | if (getWssPasswordType()) { 183 | runner.wssPasswordType = getWssPasswordType() 184 | logger.debug "Runner wssPasswordType: " + getWssPasswordType() 185 | } 186 | 187 | if (getDomain()) { 188 | runner.domain = getDomain() 189 | logger.debug "Runner domain: " + getDomain() 190 | } 191 | 192 | if (getHost()) { 193 | runner.host = getHost() 194 | logger.debug "Runner host: " + getHost() 195 | } 196 | 197 | if (getOutputFolder()) { 198 | runner.outputFolder = getOutputFolder() 199 | logger.debug "Runner outputFolder: " + getOutputFolder() 200 | } 201 | 202 | runner.printReport = getPrintReport() 203 | logger.debug "Runner printReport: " + getPrintReport() 204 | 205 | runner.exportAll = getExportAll() 206 | logger.debug "Runner exportAll: " + getExportAll() 207 | 208 | runner.setJUnitReport(getJunitReport()) 209 | logger.debug "Runner junitReport: " + getJunitReport() 210 | 211 | runner.enableUI = getInteractive() 212 | logger.debug "Runner enableUI: " + getInteractive() 213 | 214 | runner.ignoreError = getTestFailIgnore() 215 | logger.debug "Runner ignoreError: " + getTestFailIgnore() 216 | 217 | runner.saveAfterRun = getSaveAfterRun() 218 | logger.debug "Runner saveAfterRun: " + getSaveAfterRun() 219 | 220 | if (getSettingsFile()) { 221 | runner.settingsFile = getSettingsFile() 222 | logger.debug "Runner settingsFile: " + getSettingsFile() 223 | } 224 | 225 | if (getProjectPassword()) { 226 | runner.projectPassword = getProjectPassword() 227 | logger.debug "Runner projectPassword: " + getProjectPassword() 228 | } 229 | 230 | if (getSettingsPassword()) { 231 | runner.soapUISettingsPassword = getSettingsPassword() 232 | logger.debug "Runner soapUISettingsPassword: " + getSettingsPassword() 233 | } 234 | 235 | if (getGlobalProperties()) { 236 | runner.globalProperties = getGlobalProperties() 237 | logger.debug "Runner getGlobalProperties: " + getGlobalProperties() 238 | } 239 | 240 | if (getProjectProperties()) { 241 | runner.projectProperties = getProjectProperties() 242 | logger.debug "Runner projectProperties: " + getProjectProperties() 243 | } 244 | 245 | if (getSoapuiProperties() && getSoapuiProperties().size() > 0 ) { 246 | getSoapuiProperties().keySet().each { key -> 247 | logger.debug "Setting ${key} value ${getSoapuiProperties().getProperty("${key}")}" 248 | System.setProperty((String) key, getSoapuiProperties().getProperty((String) key)) 249 | } 250 | } 251 | 252 | runner.getLog().info('log me!') 253 | runner.run() 254 | logger.info "SoapUI test case runner complete." 255 | } 256 | } 257 | 258 | /* 259 | * This class is a hack, see https://discuss.gradle.org/t/classpath-hell-soapui-and-gradle-api-logging-conflicts/8830/6?u=sion_williams 260 | */ 261 | class MySoapUITestCaseRunner extends SoapUITestCaseRunner { 262 | MySoapUITestCaseRunner() { super() } 263 | MySoapUITestCaseRunner(String title) { super(title) } 264 | @Override void initGroovyLog() { } 265 | } 266 | -------------------------------------------------------------------------------- /src/main/groovy/io/byteshifter/plugins/soapui/tasks/ToolTask.groovy: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2014 Sion Williams 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | package io.byteshifter.plugins.soapui.tasks 25 | 26 | import com.eviware.soapui.SoapUI 27 | import com.eviware.soapui.tools.SoapUIToolRunner 28 | import org.gradle.api.tasks.Optional 29 | 30 | /** 31 | * Runs soapUI tools 32 | * task name - tool 33 | * 34 | * @author Sion 35 | */ 36 | class ToolTask extends SoapUITask { 37 | 38 | /** 39 | * The tool to run 40 | */ 41 | @Optional 42 | String tool 43 | 44 | /** 45 | * The interface to run for 46 | */ 47 | @Optional 48 | String iface 49 | 50 | /** 51 | * Specifies output forder for report created by runned tool 52 | */ 53 | @Optional 54 | String outputFolder 55 | 56 | /** 57 | * SoapUI Properties. 58 | */ 59 | @Optional 60 | Properties soapuiProperties 61 | 62 | ToolTask() { 63 | super('Runs soapUI tools') 64 | } 65 | 66 | @Override 67 | void executeAction() { 68 | 69 | SoapUIToolRunner runner = new SoapUIToolRunner('soapUI ' + SoapUI.SOAPUI_VERSION + ' Gradle Tool Runner') 70 | runner.projectFile = projectFile 71 | 72 | if (iface) { 73 | runner.interface = iface 74 | } 75 | 76 | if (tool) { 77 | runner.tool = tool 78 | } 79 | 80 | if (settingsFile) { 81 | runner.settingsFile = settingsFile 82 | } 83 | 84 | if (projectPassword) { 85 | runner.projectPassword = projectPassword 86 | } 87 | 88 | if (settingsPassword) { 89 | runner.soapUISettingsPassword = settingsPassword 90 | } 91 | 92 | if (outputFolder) { 93 | runner.outputFolder = outputFolder 94 | } 95 | 96 | if (soapuiProperties && soapuiProperties.size() > 0) { 97 | for (Object key : soapuiProperties.keySet()) { 98 | println('Setting ' + (String) key + ' value ' + soapuiProperties.getProperty((String) key)) 99 | System.setProperty((String) key, soapuiProperties.getProperty((String) key)) 100 | } 101 | } 102 | 103 | runner.run() 104 | } 105 | } 106 | -------------------------------------------------------------------------------- /src/main/resources/META-INF/gradle-plugins/io.byteshifter.soapui.properties: -------------------------------------------------------------------------------- 1 | implementation-class=io.byteshifter.plugins.soapui.SoapUIPlugin -------------------------------------------------------------------------------- /src/test/groovy/io/byteshifter/plugins/soapui/SoapUIPluginSpec.groovy: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2014 Sion Williams 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | package io.byteshifter.plugins.soapui 25 | 26 | import io.byteshifter.plugins.soapui.extensions.SoapUIPluginExtension 27 | import nebula.test.PluginProjectSpec 28 | 29 | /** 30 | * Specification for the plugin implementation 31 | * 32 | * @author Sion Williams 33 | */ 34 | class SoapUIPluginSpec extends PluginProjectSpec { 35 | static final String PLUGIN_ID = 'io.byteshifter.soapui' 36 | 37 | @Override 38 | String getPluginName() { 39 | return PLUGIN_ID 40 | } 41 | 42 | def setup() { 43 | project.apply plugin: pluginName 44 | } 45 | 46 | def "apply creates soapui extension"() { 47 | expect: project.extensions.findByName( 'soapui' ) 48 | } 49 | 50 | def "soapui extension has test extension"() { 51 | setup: SoapUIPluginExtension soapUIPluginExtension = project.extensions.findByName( 'soapui' ) 52 | 53 | expect: soapUIPluginExtension.test 54 | } 55 | 56 | def "soapui extension has mock extension"() { 57 | setup: SoapUIPluginExtension soapUIPluginExtension = project.extensions.findByName( 'soapui' ) 58 | 59 | expect: soapUIPluginExtension.mock 60 | } 61 | 62 | def "soapui extension has security extension"() { 63 | setup: SoapUIPluginExtension soapUIPluginExtension = project.extensions.findByName( 'soapui' ) 64 | 65 | expect: soapUIPluginExtension.security 66 | } 67 | 68 | def "soapui extension has load extension"() { 69 | SoapUIPluginExtension soapUIPluginExtension = project.extensions.findByName( 'soapui' ) 70 | 71 | expect: soapUIPluginExtension.load 72 | } 73 | 74 | def "soapui extension has tool extension"() { 75 | SoapUIPluginExtension soapUIPluginExtension = project.extensions.findByName( 'soapui' ) 76 | 77 | expect: soapUIPluginExtension.tool 78 | } 79 | 80 | def "apply creates soaptest task"() { 81 | expect: project.tasks.findByName( 'soaptest' ) 82 | } 83 | 84 | def "apply creates tool task"() { 85 | expect: project.tasks.findByName( 'soaptool' ) 86 | } 87 | 88 | def "apply creates mock task"() { 89 | expect: project.tasks.findByName( 'soapmock' ) 90 | } 91 | 92 | def "apply creates loadtest task"() { 93 | expect: project.tasks.findByName( 'soaploadtest' ) 94 | } 95 | 96 | def "apply creates securitytest task"() { 97 | expect: project.tasks.findByName( 'soapsecuritytest' ) 98 | } 99 | 100 | } 101 | -------------------------------------------------------------------------------- /src/test/groovy/io/byteshifter/plugins/soapui/tasks/LoadTestTaskSpec.groovy: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2014 Sion Williams 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | package io.byteshifter.plugins.soapui.tasks 25 | 26 | import org.gradle.api.GradleException 27 | import org.gradle.api.Project 28 | import org.gradle.api.Task 29 | import org.gradle.testfixtures.ProjectBuilder 30 | import spock.lang.Ignore 31 | import spock.lang.Specification 32 | 33 | /** 34 | * Specification for the loadtest task 35 | * 36 | * @author Sion Williams 37 | */ 38 | class LoadTestTaskSpec extends Specification { 39 | Project project 40 | final static TASK_NAME = 'loadtest' 41 | 42 | def setup() { 43 | project = ProjectBuilder.builder().build() 44 | } 45 | 46 | def "add mock task to project"() { 47 | expect: 48 | project.tasks.findByName(TASK_NAME) == null 49 | when: 50 | project.task(TASK_NAME, type: LoadTestTask) { 51 | projectFile = 'sample-soapui-project.xml' 52 | } 53 | then: 54 | Task task = project.tasks.findByName(TASK_NAME) 55 | task != null 56 | task.group == 'SoapUI' 57 | task.description == 'Runs soapUI load tests.' 58 | 59 | task.projectFile == 'sample-soapui-project.xml' 60 | } 61 | 62 | //TODO Convert to integTest 63 | @Ignore 64 | def "run mock with no project.xml defined"() { 65 | expect: 66 | project.tasks.findByName(TASK_NAME) == null 67 | when: 68 | Task task = project.task(TASK_NAME, type: LoadTestTask) 69 | task.run() 70 | 71 | then: 72 | project.tasks.findByName(TASK_NAME) != null 73 | thrown(GradleException) 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /src/test/groovy/io/byteshifter/plugins/soapui/tasks/MockServiceTaskSpec.groovy: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2014 Sion Williams 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | package io.byteshifter.plugins.soapui.tasks 25 | 26 | import org.gradle.api.GradleException 27 | import org.gradle.api.Project 28 | import org.gradle.api.Task 29 | import org.gradle.testfixtures.ProjectBuilder 30 | import spock.lang.Ignore 31 | import spock.lang.Specification 32 | 33 | /** 34 | * Specification for the mock task 35 | * 36 | * @author Sion Williams 37 | */ 38 | class MockServiceTaskSpec extends Specification { 39 | Project project 40 | final static TASK_NAME = 'mock' 41 | 42 | def setup() { 43 | project = ProjectBuilder.builder().build() 44 | } 45 | 46 | def "add mock task to project"() { 47 | expect: 48 | project.tasks.findByName(TASK_NAME) == null 49 | when: 50 | project.task(TASK_NAME, type: MockServiceTask) { 51 | projectFile = 'sample-soapui-project.xml' 52 | } 53 | then: 54 | Task task = project.tasks.findByName(TASK_NAME) 55 | task != null 56 | task.group == 'SoapUI' 57 | task.description == 'Runs soapUI mock service' 58 | 59 | task.projectFile == 'sample-soapui-project.xml' 60 | } 61 | 62 | //TODO Convert to integTest 63 | @Ignore 64 | def "run mock with no project.xml defined"() { 65 | expect: 66 | project.tasks.findByName(TASK_NAME) == null 67 | when: 68 | Task task = project.task(TASK_NAME, type: MockServiceTask) 69 | task.run() 70 | 71 | then: 72 | project.tasks.findByName(TASK_NAME) != null 73 | thrown(GradleException) 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /src/test/groovy/io/byteshifter/plugins/soapui/tasks/SecurityTestTaskSpec.groovy: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2014 Sion Williams 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | package io.byteshifter.plugins.soapui.tasks 25 | 26 | import org.gradle.api.GradleException 27 | import org.gradle.api.Project 28 | import org.gradle.api.Task 29 | import org.gradle.testfixtures.ProjectBuilder 30 | import spock.lang.Ignore 31 | import spock.lang.Specification 32 | 33 | /** 34 | * Created by Sion on 25/04/2014. 35 | */ 36 | class SecurityTestTaskSpec extends Specification { 37 | Project project 38 | final static TASK_NAME = 'securitytest' 39 | 40 | def setup() { 41 | project = ProjectBuilder.builder().build() 42 | } 43 | 44 | def "add mock task to project"() { 45 | expect: 46 | project.tasks.findByName(TASK_NAME) == null 47 | when: 48 | project.task(TASK_NAME, type: SecurityTestTask) { 49 | projectFile = 'sample-soapui-project.xml' 50 | } 51 | then: 52 | Task task = project.tasks.findByName(TASK_NAME) 53 | task != null 54 | task.group == 'SoapUI' 55 | task.description == 'Runs soapUI security tests' 56 | 57 | task.projectFile == 'sample-soapui-project.xml' 58 | } 59 | 60 | //TODO Convert to integTest 61 | @Ignore 62 | def "run mock with no project.xml defined"() { 63 | expect: 64 | project.tasks.findByName(TASK_NAME) == null 65 | when: 66 | Task task = project.task(TASK_NAME, type: SecurityTestTask) 67 | task.run() 68 | 69 | then: 70 | project.tasks.findByName(TASK_NAME) != null 71 | thrown(GradleException) 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /src/test/groovy/io/byteshifter/plugins/soapui/tasks/TestTaskSpec.groovy: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2014 Sion Williams 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | package io.byteshifter.plugins.soapui.tasks 25 | 26 | import org.gradle.api.GradleException 27 | import org.gradle.api.Project 28 | import org.gradle.api.Task 29 | import org.gradle.testfixtures.ProjectBuilder 30 | import spock.lang.Ignore 31 | import spock.lang.Specification 32 | 33 | /** 34 | * Specification for the soaptest task 35 | * 36 | * @author Sion Williams 37 | */ 38 | class TestTaskSpec extends Specification { 39 | Project project 40 | 41 | def setup() { 42 | project = ProjectBuilder.builder().build() 43 | } 44 | 45 | def "add soapTest tasks to project"() { 46 | expect: 47 | project.tasks.findByName( 'soaptest' ) == null 48 | when: 49 | project.task( 'soaptest', type: TestTask ) { 50 | projectFile = 'sample-soapui-project.xml' 51 | printReport = true 52 | exportAll = true 53 | junitReport = true 54 | interactive = false 55 | testFailIgnore = true 56 | saveAfterRun = false 57 | } 58 | 59 | then: 60 | Task task = project.tasks.findByName( 'soaptest' ) 61 | task != null 62 | task.group == 'SoapUI' 63 | task.description == 'Runs soapUI functional tests' 64 | 65 | task.projectFile == 'sample-soapui-project.xml' 66 | task.printReport == true 67 | task.exportAll == true 68 | task.junitReport == true 69 | task.interactive == false 70 | task.testFailIgnore == true 71 | task.saveAfterRun == false 72 | } 73 | 74 | //TODO Convert to integTest 75 | @Ignore 76 | def "run soapTest with no project.xml defined"() { 77 | expect: 78 | project.tasks.findByName( 'soaptest' ) == null 79 | 80 | when: 81 | Task task = project.task( 'soaptest', type: TestTask) { 82 | printReport = true 83 | exportAll = true 84 | junitReport = true 85 | interactive = false 86 | testFailIgnore = true 87 | saveAfterRun = false 88 | } 89 | task.run() 90 | 91 | then: 92 | project.tasks.findByName( 'soaptest' ) != null 93 | thrown(GradleException) 94 | } 95 | } 96 | -------------------------------------------------------------------------------- /src/test/groovy/io/byteshifter/plugins/soapui/tasks/ToolTaskSpec.groovy: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2014 Sion Williams 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | package io.byteshifter.plugins.soapui.tasks 25 | 26 | import org.gradle.api.GradleException 27 | import org.gradle.api.Project 28 | import org.gradle.api.Task 29 | import org.gradle.testfixtures.ProjectBuilder 30 | import spock.lang.Ignore 31 | import spock.lang.Specification 32 | 33 | /** 34 | * Specification for the tool task 35 | * 36 | * @author Sion Williams 37 | */ 38 | class ToolTaskSpec extends Specification { 39 | Project project 40 | static final TASK_NAME = 'tool' 41 | 42 | def setup() { 43 | project = ProjectBuilder.builder().build() 44 | } 45 | 46 | def "add tool tasks to project"() { 47 | expect: 48 | project.tasks.findByName(TASK_NAME) == null 49 | when: 50 | project.task(TASK_NAME, type: ToolTask) { 51 | projectFile = 'sample-soapui-tool-project.xml' 52 | tool = 'wsi,axis1,axis2' 53 | iface = 'IOrderService' 54 | } 55 | then: 56 | Task task = project.tasks.findByName(TASK_NAME) 57 | task != null 58 | task.group == 'SoapUI' 59 | task.description == 'Runs soapUI tools' 60 | 61 | task.projectFile == 'sample-soapui-tool-project.xml' 62 | task.tool == 'wsi,axis1,axis2' 63 | task.iface == 'IOrderService' 64 | } 65 | 66 | //TODO Convert to integTest 67 | @Ignore 68 | def "run tool task with no project.xml defined"() { 69 | expect: 70 | project.tasks.findByName(TASK_NAME) == null 71 | when: 72 | Task task = project.task(TASK_NAME, type: ToolTask) { 73 | tool = 'wsi,axis1,axis2' 74 | iface = 'IOrderService' 75 | } 76 | task.run() 77 | 78 | then: 79 | project.tasks.findByName(TASK_NAME) != null 80 | thrown(GradleException) 81 | } 82 | } 83 | -------------------------------------------------------------------------------- /src/test/resources/calculator-soapui-project.xml: -------------------------------------------------------------------------------- 1 | 2 | http://localhost:8080/calculator?wsdl 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | ]]>http://schemas.xmlsoap.org/wsdl/http://localhost:8080/calculatorSEQUENTIALCalculatorSoapBindingAdd<xml-fragment/>UTF-8http://localhost:8080/calculator 146 | 147 | 148 | 149 | 8 150 | 6 151 | 152 | 153 | ]]>declare namespace soap='http://schemas.xmlsoap.org/soap/envelope/'; 154 | declare namespace ns1='http://opensourcesoftwareandme.org/'; 155 | 156 | /soap:Envelope/soap:Body/ns1:AddResponse/return14.0falsefalsefalseGlobal HTTP SettingsCalculatorSoapBindingDivide<xml-fragment/>UTF-8http://localhost:8080/calculator 157 | 158 | 159 | 160 | 4 161 | 2 162 | 163 | 164 | ]]>declare namespace soap='http://schemas.xmlsoap.org/soap/envelope/'; 165 | declare namespace ns1='http://opensourcesoftwareandme.org/'; 166 | 167 | /soap:Envelope/soap:Body/ns1:DivideResponse/return2.0falsefalsefalseGlobal HTTP SettingsCalculatorSoapBindingMultiply<xml-fragment/>UTF-8http://localhost:8080/calculator 168 | 169 | 170 | 171 | 9 172 | 5 173 | 174 | 175 | ]]>declare namespace soap='http://schemas.xmlsoap.org/soap/envelope/'; 176 | declare namespace ns1='http://opensourcesoftwareandme.org/'; 177 | 178 | /soap:Envelope/soap:Body/ns1:MultiplyResponse/return45.0falsefalsefalseGlobal HTTP SettingsCalculatorSoapBindingSubtract<xml-fragment/>UTF-8http://localhost:8080/calculator 179 | 180 | 181 | 182 | 7 183 | 1 184 | 185 | 186 | ]]>declare namespace soap='http://schemas.xmlsoap.org/soap/envelope/'; 187 | declare namespace ns2='http://opensourcesoftwareandme.org/'; 188 | 189 | /soap:Envelope/soap:Body/ns2:SubtractResponse/return6.0falsefalsefalseGlobal HTTP SettingsfalseSEQUENCEResponse 1 190 | 191 | 192 | 193 | 14.0 194 | 195 | 196 | ]]>SEQUENCEResponse 1 197 | 198 | 199 | 200 | 2.0 201 | 202 | 203 | ]]>SEQUENCEResponse 1 204 | 205 | 206 | 207 | 45.0 208 | 209 | 210 | ]]>SEQUENCEResponse 1 211 | 212 | 213 | 214 | 6.0 215 | 216 | 217 | ]]> --------------------------------------------------------------------------------