Issue testing asynchronous web-service
I'm running a multi-threaded load test using SoapUI open source edition. I'm testing an asynchronous web-service. I send requests to the service via SoapUI, these requests are queued for later execution, and the web service sends notification responses later.
I'm using a MockService to capture these notification responses. I now need a way of mapping each response back to the request that SoapUI originally sent out so that the latency from request to response can be tracked. To do this, I was going to define a ConcurrentHashMap. The test step that sends a request would update the hashmap with the request id and current time. When my MockService receives a notification response it would access the hashmap to get the start time of that request id.
The problem I'm facing is that I would need to declare the hashmap in a scope where all the threads access the same hashmap and the MockService also has access to it.
If I declare my hashmap in a groovy test step, then each thread when executing the test step would create its own copy of it, which is not what I want.
My question is whether there is a way in SoapUI to declare my hashmap at a "global" scope so that all the test threads (and my MockService) can access the same hashmap instance?
I tried declaring it in the setup script of the TestSuite and adding it to the TestSuite context but that doesn't seem to be working.
Can someone help with this?