Forum Discussion

MRtai2's avatar
MRtai2
Occasional Contributor
15 years ago

mockResult inconsistencies

Hi all, I am having an issue of mockResult inconsistencies when I am monitoring the number of mockResults a mockRunner has. In this instance I am sending 4 request via webservice and in return expect 4 responses again via webservice. The responses come in within milliseconds of each other so I am wondering if SoapUI is dropping messages because of this. For instance the two timestamps below are logs for messages being sent to me. It seems that a regular mockService (not in a TestSuite) will be able to pick up these messages however using a mockResponse step within a test case will not since I receive msg3 and never receive msg4.


msg3 - [3/29/11 8:46:10:021 CDT] 00000026 LoggingInInte I Outbound Message
msg4 - [3/29/11 8:46:10:079 CDT] 000000f9 LoggingInInte I Outbound Message

here I exit the loop when RESULTS = 4, again i receive msg3 but never receive a result for msg4 so I timeout.

while(mockRunner.isRunning()){
int rCount = mockRunner.getMockResultCount();
if(rCount > tempCount){
tempCount = rCount;
log.info("Result Received. Current results: " + rCount);
}
//log.info("rCount: " + rCount);
if (rCount == RESULTS){
log.info("All expected results receieved");
//After receiving all responses turn the mockservice off
mockRunner.stop();
} else {
if ( endtime < System.currentTimeMillis()){
log.info("Time Passed: " + (System.currentTimeMillis() - starttime));
testRunner.fail("Script timeout");
mockRunner.stop();
}
}
}



Thanks.

2 Replies

  • Hi,

    you are correct, the MockResponse TestStep has issues in situations like these.. can you share your project so we can try to reproduce and look into it?


    regards,

    /Ole
    eviware.com
  • MRtai2's avatar
    MRtai2
    Occasional Contributor
    Thanks Ole.

    Unfortunately in this particular case I am receiving messages from an external source so the project would not be much help. I did however create a project where the mockservice was sending messages to itself, fortunately the number of mockResults was what I expected (am looking in to the external sender). Is there a workaround for using the TestStep MockResponse issue aside from creating a mockService that is at the testSuite level? thanks again.