Check that the string begins with the text generating an exception otherwise.
 

1 assert.startsWith

It is ideal for test unites because it emulates JUnit.

Release 2017.2

Tag available since version 2017.2.

<assert.startsWith
    text='text'
    string='string'
/>
Example
Copy
<xsql-script>
    <body>
      <set name='m_text'>Hallo</set>
      <set name='m_b'>Hello world!</set>
      <assert.startsWith><m_text /><m_b /></assert.startsWith>
    </body>
</xsql-script>
Error:  XSQLScriptException[Assert failed: expected [Hallo] != received [Hello world!] (java.lang.String, java.lang.String)]