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:
|
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 |
Examples
| Example | Description |
|---|---|
|
<ReportBlock label="First test set" > <AssertExistence element="....." /> </ReportBlock> |
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.
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.


