Exam >
On this page

Core verifying commands

Handlebars and content type aware verifying commands.

Overview

Commands may be used as drop-in replacements for their concordion counterpart when handlebars-template support or content type awareness is needed.

Examples

Basic usage

Let's test the lowercase function, which converts a given parameter to lower case and returns result in 3 formats (text/json/xml).

basic

Given


Variable someVar = 123

Then


The following markup:
<table cc:execute="#result = lowercase(#param)">
  <tr>
    <th e:set="#param">Param</th>
    <th e:equals="#result.text">Text</th>
    <th e:equalsFile="#result.text">Text from file</th>
    <th e:jsonEquals="#result.json">JSON</th>
    <th e:jsonEqualsFile="#result.json">JSON from file</th>
    <th e:xmlEquals="#result.xml">XML</th>
    <th e:xmlEqualsFile="#result.xml">XML from file</th>
    <th cc:echo="#result.json">Echo JSON</th>
    <th cc:echo="#result.xml">Echo XML</th>
  </tr>
  <tr>
    <td>
      <pre class="code language-json">ABC {{someVar}}</pre>
    </td>
    <td>abc {{someVar}}</td>
    <td>/data/core/expected.txt</td>
    <td>{"result": "abc {{someVar}}"}</td>
    <td>/data/core/expected.json</td>
    <td><![CDATA[ <result>abc {{someVar}}</result>]]></td>
    <td>/data/core/expected.xml</td>
    <td>
      <pre class="code language-json"/>
    </td>
    <td>
      <pre class="code"/>
    </td>
  </tr>
</table>
will be rendered as:
Param Text Text from file JSON JSON from file XML XML from file Echo JSON Echo XML
ABC 123
abc 123
abc 123
{"result": "abc 123"}
{
  "result": "abc 123"
}
<result>abc 123</result>
<result>abc 123</result>
 { "result": "abc 123" }
 <result>abc 123</result>