Is it possible to run test cases with mock response steps in parallel?

This is community board for the SoapUI Community. Here the members can exchange experiences and help each other improve their soapUI testing.

Is it possible to run test cases with mock response steps in parallel?

Postby dusura » 06 Apr 2010 08:28

Hi,

I am trying to test web services with asynchronous behaviour. Using test cases with mock responses seems like a neat way to achieve this.

So I have a several test cases, each with the following steps:
1) mock response (response is acknowledging receipt of request)
2) delay (simulate doing some work)
3) test request (asynchronous "reply" to the original request)

Each test case is for a separate operation of the same web service. I need to run them in parallel as I don't know which test case will occur first. But there seems to be no way to do this. Each mock response wants to listen on the same endpoint exclusively.

Any suggestions would be much appreciated.

Cheers,
David
dusura
User
 
Posts: 2
Joined: 06 Apr 2010 08:04

Re: Is it possible to run test cases with mock response steps in parallel?

Postby dusura » 08 Apr 2010 07:49

I thought I'd post my solution. I used one mock service instead of many separate tests. I used a groovy script for my mock response which starts a test case asynchronously. The test case has a built in delay to simulate "doing some work".

def groovyUtils = new com.eviware.soapui.support.GroovyUtils(context)
def holder = groovyUtils.getXmlHolder(mockRequest.requestContent)

holder.declareNamespace( 'ns', 'http://my.namespace.com/')
def contextId = holder.getNodeValue("//ns:ContextId")

context.mockService.project.getTestSuiteByName("Replies").getTestCaseByName("Asynch Reply").run(new com.eviware.soapui.support.types.StringToObjectMap( [ contextId : contextId ]), true)
dusura
User
 
Posts: 2
Joined: 06 Apr 2010 08:04


Return to SoapUI Community Board