With Soa Suite 11g we can add unit tests (test suites) to our composite applications and start these tests with the ant scripts provided by Oracle. The soa test ant script can start and generate an junit xml which can be read for the result of the test. For more info see my previous blogpost about the ant scripts and the testsuite option in Soa Suite 11g.
So the last step is to combine the test suite feature and the ant scripts of mine and Oracle so we can use it in a continuous build system. I will use Hudson for this.
We start by downloading the lastest hudson war.
Start hudson by setting the java home and path
java -jar hudson.war
this will start Hudson and open a browser and go to http://localhost:8080.
First we install Hudson as a windows service. Just provide the location. I will use c:\java\hudson
This will restart hudson. Now we can configure Hudson
Provide the ant and java location of the jdeveloper 11g R1 home.
Put the soa projects and ant scripts in subversion, so Hudson can check this out
This is how it looks. Very important my ant scripts need this folder paths.
Now we can create a new job.
Configure this new job. We start by adding the svn url.
Then add the ant script ( build.xml ) and fill the target ( deployAll) and for the oracle ant scripts we need to set the basedir java parameter to the jdeveloper bin folder.
And provide the location where Hudson can find the junit xml files.
Now we have to add ant-contrib-1.0XXXX.jar the to the jdeveloper\ant\lib folder and add a environment variable to the ant.bat
I need this for the ant scripts so I can use relative paths.
Let's press build now and look at the result. My example composite application contains two tests, in my case they are both succesfull.
Look at the test.
And the performance.
That's all. This will save you a lot of testing time and off course Hudson can blame the person who checked in as last.
Here is my test project and ant scripts