|
|
Assert tag is a command tag. It asserts that the condition defined in the attributes is true or throw exception otherwise.
The syntax is:
<assert value1="expression1" op="comparator" value2="expression2" else="L1: exception message" passed="message or expression"/>
where "expression1" and "expression2" can be a static string or mScript method or the combination of both.
The "comparator" can be one of the following:
You may also add prefix "NOT." to the comparators above to negate the condition.
Use "true" to compare to a boolean data value.
The exception level in the "else" attribute can be L1, L2, ... L5.
You may signal to have execution aborted when the assert is failed by specifying "abort" as the exception level. For example:
<assert .... else = "abort: fatal error, can not continue."/>
The expression message can be a static message or an expression containing mScript method.
You may also use VALUE1 and VALUE2 in the "else" and "passed" expression for the result values from the "value1" and "value2" expressions.
"passed" attribute is optional. When the assert evaluates to true, this expression is executed and the results are written to mScript log. (rel 3.0.10)