Previous Topic: Logical TransactionsNext Topic: Track Transactions


Match Tolerance

Match tolerance defines how VSE decides whether a specific transaction matches the incoming transaction.

The levels of match tolerance are:

Operation

The loosest match tolerance. The operation name of the incoming transaction must match the name of the recorded transaction.

Signature

The operation name must match and the names of the arguments must match exactly, with no additions or deletions. The order of arguments does not have to be the same.

Exact

In addition to the signature match, the values for each argument must match the values that were recorded, as defined by the argument match operators.

Argument Match Operators

Every argument in a request has a match operator. For an Exact match operation, the operator controls how the value of the argument in the incoming request is matched against the value of the corresponding argument in the service image.

The available match operators are:

Anything

Always returns true. The virtual service recorder defaults the comparison to Anything when it determines that an argument is a date. The incoming value for this argument can be anything. The argument must be present for the signature/META match to work, but the value is ignored and can be blank or null.

= Equal

Returns true if the values are the same.

!= Not equal

Returns true if the values are different.

< Less than

Returns true if the inbound value is less, before, or earlier than the value from the service image.

<= Less than or equal

Returns true if the inbound value is less, before, earlier than or equal to the value from the service image.

> Greater than

Returns true if the inbound value is greater, after, or later than the value from the service image.

>= Greater than or equal

Returns true if the inbound value is greater, after, later than or equal to the value from the service image.

Regular Expression

Returns true if the inbound value (as a string) matches the value, as a regular expression, from the service image.

Property Expression

The value must be in the form of a double-braced script expression, {{ }}. This property or expression is evaluated. If the result starts with Y, y, T, t, or ON, then the argument is deemed to have matched. The argument value in the inbound request is ignored unless referenced in the script.

Note: If an argument is marked as a date, the values from the requests being compared are converted to a date before the comparison is done.

Meta Transactions and Specific Responses

When VSE searches for a conversational match, it only searches Meta transactions. A Meta transaction cannot have a match tolerance of Exact (the default is Signature). Each Meta transaction has one or more specific responses, which could have any match tolerance (Exact is the default).

If none of the specific responses for a Meta transaction match, then the response that is specified for the Meta transaction is used.

How VSE Selects the Next Response

  1. If the incoming request is in a conversation, search for a match that is based on the navigation tolerance and other rules explained previously.
  2. If nothing is found in the current conversation, look for another conversation (unless navigation tolerance is CLOSE).
  3. If there is a conversational match, with a specific response (instead of a Meta match), use the specific response.
  4. Otherwise, look for a specific match in the stateless transactions, and if found, use that one.
  5. If there was no specific match in the stateless list, but there is a Meta match in the conversational list, use that Meta match.
  6. If there was no conversational match at all, but there is a Meta match in the stateless list, use the Meta match.
  7. Fail with "no match found," and send back either the "unknown conversational response" or the "unknown stateless response" specified in the service image. The response could be overridden based on the protocol and handlers used.

How to Debug Match Failures

If you get failures to match, open the LISA_HOME\logging.properties file and set log4j.logger.VSE to DEBUG or TRACE. This setting causes VSE to be verbose to the vse_xxx.log file, where xxx is the service image name. The log4j.logger.VSE property also tells you exactly what matched and what did not match.

Set the log4j.logger.VSE property to INFO or WARN for production use. Do not leave it set to DEBUG or TRACE longer than necessary.