HomeGuidesReferencesExamplesTry and Buy

Report Commands

Report Commands

The purpose of these commands is to explicitly write something to the report. Usually (with assertion commands) only a failed assertion is reported in the output document. The commands explained here are used to add more data and arbitrary text to the output.

ReportBlock

This command can be used everywhere in an instruction file. It can be indefinitly nested and can always contain all tags its parent tag would allow. The effect of ReportBlock is that in the output file a corresponding output tag <Block> is added. The tag contains a copy of all attributes from the ReportBlock command. So the ReportBlock can be used to add any arbitrary text to the ouput file. Apart from that the <Block> in the output will also contain all output tags corresponding to the inner tags of the ReportBlock instruction.

An additional feature is, that ReportBlock supports conditional execution of its inner tags. With the attributes if and ifNot it is possible to make the execution of the inner tags depending on the value of a variable or an even more complex expression.

Attribues

The following table lists all attributes that can be used with the ReportBlock command.

Attribute Name Description required/optional
if The inner tags of ReportBlock will only be executed if the condition in this attribute evaluates to true.
Here true actually means any of the following string values:
  • true
  • yes
  • on
  • 1
optional
ifNot The inner tags of ReportBlock will only be executed if the condition in this attribute is NOT true. For a description of the syntax of conditions see the if attribute. optional
beforeVersion The inner tags of ReportBlock will only be executed if the condition in this attribute is true.
The condition specifies the name of a variable and a version number. The value of the variable then will be compared against the version number. The condition evaluates to true if the version value of the variable is a lower version than the specified value.
The variable name and the version to compare with must be separated by a colon (':').
Example: beforeVersion="build.version:4.3.28"
The following values for variable build.version will evaluate the example to true:
  • 1.0.45
  • 4.3.27
  • 4.2
The following values for variable build.version will evaluate the example to false:
  • 5.1.3
  • 4.3.28
  • 4.10.2
  • 12.2.7
  • 4.3.102
optional
sinceVersion The inner tags of ReportBlock will only be executed if the condition in this attribute is true.
The condition specifies the name of a variable and a version number. The value of the variable then will be compared against the version number. The condition evaluates to true if the version value of the variable is a higher or equal version compared to the specified value.
The variable name and the version to compare with must be separated by a colon (':').
Example: sinceVersion="build.version:3.21.7"
The following values for variable build.version will evaluate the example to true:
  • 3.0
  • 3.21.7
  • 3.21.11
  • 11.0.1
  • 3.123.2
The following values for variable build.version will evaluate the example to false:
  • 2.4.5
  • 3.21.6
  • 3.20.46.5
optional
Examples
Example Description
<ReportBlock label="First test set">
  <AssertExistence element="....."/>
</ReportBlock>
                
Simply creates a <Block> element in the output around the report results of the included child elements.

ReportVariable

The purpose of this command is to write the current value of a variable to the output.

Attribues

The following table lists all attributes that can be used with this command.

Attribute Name Description required/optional
name Specifies the name of the variable to be reported.
The specified variable must exist. Otherwise an error msgid="SERR002" will reported.
required
Examples
<Set name="title" value="Example"/>
<SettingsFile type="properties" name="config.properties">
  <Set name="title" value="inside"/>
  <ReportVariable name="title"/>
</SettingsFile>
<ReportVariable name="title"/>
          

Description: The first <ReportVariable> command will add

<Variable name="title">inside</Variable>  
            
and the second <ReportVariable> command will add
<Variable name="title">Example</Variable>
            
to the output report file.

ReportValue

With this command it is possible to write the current value(s) of a configuration element to the report.

Note

This command must be used only inside a Data Source Adapter tag.

Attribues

The following table lists all attributes that can be used with this command.

Attribute Name Description required/optional
element Specifies the element to be reported.
Be aware that the syntax of this attribute depends on the Data Source Adapter this command is used with. Refer to the appropriate Data Source Adapter documentation for details.
required
Examples
<SettingsFile type="manifest" name="base.jar/META-INF/MANIFEST.MF">
  <ReportValue element="Specification-Title"/>
  <ReportValue element="Specification-Version"/>
  <ReportValue element="Specification-Vendor"/>
</SettingsFile>
          

Description: Writes the values of the "Specification" settings in the manifest file of base.jar to the report.