Functional Web Services Testing Made Easy with SoapUI - Part 3

Once you have downloaded and installed the cobertura plug-in, you need to configure your Job to use the reports generated. Click configure on PetStore_Nightly Job, this will display the Job configuration. Choose Publish Cobertura Coverage Report, and provide the file name pattern that can be used to locate the cobertura xml report files.

 

6. Finally, lets force a build and see the results.

PetStore Dashboard:

 

Cobertura Coverage Report in Hudson:

 

Since we also generated the HTML reports for cobertura within the Ant task, we can take a look at these as well:

P.S: I should mention that when deploying instrumented code using cobertura to an application server, cobertura doesn't update the data file unless the application server is shutdown. So, I used the same workaround as mentioned in the cobertura web site, instead of stopping and starting the server each and every time. I placed the following code in one of the Session Beans, published this as a web service, added a test case for this method and this was the last test case called within SoapUI.

try {
String className = "net.sourceforge.cobertura.coveragedata.ProjectData";
String methodName = "saveGlobalProjectData";
Class saveClass = Class.forName(className);
java.lang.reflect.Method saveMethod = saveClass.getDeclaredMethod(methodName, new Class[0]);
saveMethod.invoke(null,new Object[0]);
} catch (Throwable t) {
}

In this part, you learned about the Ant tasks for running tests written using SoapUI, generating JUnit reports, integrating with CI, and getting code coverage using Cobertura. I've used some popular open source tools like Ant, Hudson, Cobertura and showed you how easy it is to set up a CI environment using these tools and run functional tests for your web services written using SoapUI.

You can go ahead start building web services with great confidence! Enjoy.

Subtitle: 
SoapUI and Continuous Integration
Article Type: 
How-to
0
Average: 5 (1 vote)

(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)

Comments

David Sills replied on Mon, 2008/05/19 - 8:46am

What a terrific series, Meera! This is a great introduction to several tools more developers should be using!

SumaBS replied on Mon, 2008/05/19 - 1:34pm

Excellent Series Meera!

Sreekant replied on Thu, 2008/05/22 - 3:32pm

hi

I would like to know whether SOAPUI support complextype as input values.

2. whether it provides UI based support of testing Webservices

3. whether it generate test result  in the report fasion.

if you have any product which support all these let me know.

 

Sreek

Meera Subbarao replied on Thu, 2008/05/22 - 4:10pm

Hi Sreekant,

Everything you have asked above is what SoapUI is. Also, the AccountManagerBean code shown in this page has all the methods except remove method return a complex type, which in my case is the Account entity object. And the create method does take Account as its input as shown below.

     @WebMethod  
public Account create(Account info)
{
this.manager.persist(info);
return info;
}

 

srimaan replied on Sun, 2008/07/20 - 2:12pm

Excellent Material, Much helpful Thank you very much Meera

arazauci@gmail.com replied on Fri, 2008/08/01 - 8:49pm

hi,

I am trying to specify my Test Report XML from soapui

as

 

C:\Results\2008-08-01_17-32-28\28\report.xml

 

and I get teh following error in hudson.

 

'C:\Results\2008-08-01_17-32-28\28\report.xml' doesn't match anything: even 'C:' doesn't exist 

What am I doing wrong. why am I getting this error when the report.xml file exists.

tommy.van.mella... replied on Thu, 2008/09/04 - 6:37am in response to: arazauci@gmail.com

If it is the same cause as in the Test case setup script, then it is the slash.

You used a "backward" slash. It should be a "forward" slash "/" .

Tommy

arazauci@gmail.com replied on Thu, 2009/04/23 - 1:22pm

I notice that hudson does not correct display the XML of the soapui request/response. it seems to strip out the ' < ' and ' >' that enclose an element and replace by '& lt;' and '& gt;' respectively. Is there anyway i can property view the XML in hudson. Thanks Ali

samanthayan replied on Tue, 2009/06/16 - 9:23pm

hi,Meera I like this series very much. This is helpful for me. Recently I am doing load testing in soapUI, and I'm confused about it. Have you tried it? I wish you can write something on soapUI load test. Thank you very much. Samantha

sunrise1 replied on Fri, 2009/10/23 - 5:53am

hi,Meera I like this series very much. This is helpful for me. Recently I am doing load testing in soapUI, and I'm confused about it. Have you tried it? I wish you can write something on soapUI load test. Thank you very much. Samantha

sunrise1 replied on Fri, 2009/10/23 - 5:53am

I notice that hudson does not correct display the XML of the soapui request/response. it seems nike shoes discount to strip out the ' < ' and ' >' that enclose an element and replace by '& lt;' and '& gt;' respectively. Is there anyway i can property view the XML in hudson. Thanks Ali

sunrise1 replied on Sun, 2009/10/25 - 8:48am

Meera I like this series very much. This is helpful nike shoes chinafor me. Recently I am doing load testing in soapUI, and I'm confused about it. Have you tried it? I wish you can write something on soapUI load test. Thank you very much. Samantha

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.