Check that two values are equal, generating an exception otherwise.
1 assert.equals
It is ideal for test units because it emulates JUnit.
Release 2017.2
Tag available since version 2017.2.
<assert.equals
value1='value'
value2='value'
/>
Attributes | |||||
---|---|---|---|---|---|
Name | Type | Required | Default | Description | |
Avalue1 | Object | First value to compare. | |||
Avalue2 | Object | Second value to compare. |
Returns | |
---|---|
Type | Description |
Exception | Generate an exception if two values are not equal. |
Object
Object can be a string, number, byte array, array, map, vtable, etc.
Example
Copy
<xsql-script> <body> <set name='m_a'>4</set> <set name='m_b'>5</set> <assert.equals><m_a /><m_b /></assert.equals> </body> </xsql-script>
Error: XSQLScriptException[Assert failed: expected [4] != received [5] (java.lang.Integer, java.lang.Integer)]