I do not know with certainty that the below still works. No guarantees the code fragment is accurate -- untested.
You might try the following in a Scripted Assertion or JSR step after the VSI Selection Step:
String str = lisa_vse_response.get(0).getBodyAsString();
if ( str.contains( "<head><title>404 Not Found</title></head") )
{ // the standard Service Image response as seen in the VSI contains HTML
_logger.info( "The VSI selected a Service Image Not Found response" )
match = "SI NOT Found";
}
else if ( testExec.getStateObject("lisa.vse.matched.transaction") instanceof com.itko.lisa.vse.stateful.model.TransactionNode)
{ // the VSI selected a META response
_logger.info( "The VSI selected a META txn response" );
match = "META";
}
else
{ // The VSI selected a specific transaction
_logger.info( "The VSI selected a specific txn response" );
match = "Specific";
}
// if Scripted Assertion, return true and set the IF False, Fail the Test setting
// this way if the script has an error it will fail, only success returns true
return true;
// if JSR step, you could return a value for example 'match'
return "The VSI selection was: " + match;
- Start the service in ITR mode.
- Send a request to the service.
- Step through the service and let the SI Selection Step execute
- After this step executes, look at the ITR Events for the logger displays
- Verify the response against the Events
- If you deploy this code fragment without removing _logger.info(... the output will be dumped into the vse.log everytime this service is executed so take care if you take this approach as you could fill up your logs.