This is a very short post on how you can test your webservices build in the OSB or SOA Suite. We are going to use SoapUI for our tests, Maven for our build process, SVN as our repository and Jenkins as our Continuous Integration server.
First we need a service which we want to test. Lets use a very simple Hello service. All this service does is greet the user. This looks like this in SoapUI:
We can make a few simple assertions like for our testcase:
Now save your soapUI project. You can save this for example in a test directory in your OSB project. Something like this.
Now check the whole OSB project into SVN. Now how are we going to make it possible for Jenkins to run my SoapUI tests? We are going to use Maven for that using the SoapUI plugin. You can create a pom.xml under your OSB project which can look like this:
4.0.0 nl.redrock HelloService HelloService jar 1.0 eviwarePluginRepository http://www.eviware.com/repository/maven2/ eviware maven-soapui-plugin 4.0.0 verify soapui-tests ${basedir}/Test/HelloService-soapui-project.xml ${basedir}/target/soapui true true true soapui-settings.xml test com.oracle ojdbc5 11.1.0 org.apache.maven.plugins maven-surefire-report-plugin target/site/soapui target/soapui/
You can see here that we use the maven-soapui-plugin plugin to point to the soapui project. I also added an extra dependency for an oracle driver because I might want to do some database actions in SoapUI using Groovy to test if some values actually have reached the database. You can locally test if the build works by running >mvn test
If it all works, check in the whole project into SVN or your any other versioning system you are using. Next we want to create a job in Jenkins which runs the test. Go to your Jenkins machine and create a new job.
Next configure your job to your liking. In the Source Code Management section, enter the path of the repository where your pom.xml is located.
Next you want to configure it’s build pattern. This is all very straight forward so I won’t go into many details here.
And finally set some parameters for the output.
Save the job and run it. In the console output you can see that it retrieves the project from SVN and call the Maven action which then runs the SoapUI tests using the Maven plugin. Now you can automaticaly test your service whenever you want and keep this man happy 🙂
Pingback: continuous-integration-using-oracle-soa-suite-12c