Eccles
|
Basic Tags |
These are the basic tags, almost like a language
| Tag Name | Description |
---|
_default | Definition of the set of properties that all tags expose | assert | Log an error or success report depending on a test | catch | Catch an exception | collate-results | Collate a subsection of results. | else | Run children if test is not true | for-each | Run children over all items of a collection | if | Run children if test is true | log | Write a message to the log | loop | Execute the child tags a number of times | property | Define or set a property | report | Report a message to the output file | run-test | Run a named set of tests | test | Define a test | throw | Throw an exception | try | A block of code that can have exceptions trapped |
|
_default -
Definition of the set of properties that all tags expose | Every tag in the system implements these properties, although they may not be used or indeed useful in every situation | Attribute Name | Description |
---|
id | An identifier used to find a tag, either for calling sub tags or breaking control back to a previous tag | name | A name object that is used simply for naming a section of tags. |
|
assert -
Log an error or success report depending on a test [no children] |
A simple error/success reporting tag.
test is evaluated to a boolean. If the value is false, a report is generated
with message and type . If the value is true, then a report is generated with
count type.
| Attribute Name | Description |
---|
continue | If set to true, execution of tags in the current context will continue even if the test==false.
Otherwise throw an AssertionException.
[default value: false ]
| count | Report type name that is incremented when test==true | message | Message that will be output when the test==false | test | Boolean test expression
[Required]
| type | Report type to be used for message if test==false.
[default value: error ]
|
|
catch -
Catch an exception |
See the try tag for usage information
| Attribute Name | Description |
---|
type | Type of the class to be caught
[Required]
|
|
collate-results -
Collate a subsection of results. |
Collate a subsection of results. At the tag end, will display the count of all results encountered in this subsection
| Attribute Name | Description |
---|
|
else -
Run children if test is not true |
See the if tag
| Attribute Name | Description |
---|
|
for-each -
Run children over all items of a collection |
Run the children x number of times where x is the number of items in the specified collection.
Place the item from the collection & the index of the item into properties
| Attribute Name | Description |
---|
collection | Expression which should evaluate to a Collection, Iterator or array.
[Required]
| index | Name of property to which the index of the item is written.
[default value: index ]
| property | Name of property to which the item from the collection is stored.
[default value: item ]
|
|
if -
Run children if test is true |
Example
<if test="${foo>1}">
<log message="the test was true"/>
....
</if><else>
<log message="the test was false"/>
....
</else>
| Attribute Name | Description |
---|
test | The boolean test value
[Required]
|
|
log -
Write a message to the log [no children] |
This is used to display debugging or progress messages, and is not output to the results
| Attribute Name | Description |
---|
level | The level of the message. Possible values: FATAL, ERROR, WARN, INFO, DEBUG.
[default value: INFO ]
| message | The message to be written out
[Required]
|
|
loop -
Execute the child tags a number of times |
Not a proper replacement for a java 'for' loop, the values in here are static and the loop will execute
at least one.
Example:
<loop property="i" begin="0" end="10">
<log message="Inside loop, i=${i}"/>
</loop>
| Attribute Name | Description |
---|
property | Name of the property created holding the index value
[Required]
| begin | First value in the rang
[Required]
| end | Last value in the range. The range is inclusive
[Required]
|
|
property -
Define or set a property [no children] |
This tag creates or reassigns properties. Properties are always created on the parent tag, thus being exposed for the rest of the siblings in this child list.
Note that either one of 'define' or 'set' must be used.
| Attribute Name | Description |
---|
booleanValue | The value to be set or defined, whose type will be Boolean. | define | The name of a new property to be created. | doubleValue | The value to be set or defined, whose type will be Double. | intValue | The value to be set or defined, whose type will be Integer. | longValue | The value to be set or defined, whose type will be Long. | set | The name of a pre-existing property to have it's value changed | value | The value to be set or defined, whose type will be of the type returned by the expression evaluator. |
|
report -
Report a message to the output file [no children] |
Report a message to the output file.
| Attribute Name | Description |
---|
message | The message | type | The type of the report.
[default value: info ]
|
|
run-test -
Run a named set of tests [no children] |
The test named in the property 'id' is looked up in the global scope of test id's and executed
| Attribute Name | Description |
---|
id | The id of the test to run
[Required]
|
|
test -
Define a test |
Doesn't actually do anything other than execute it's children, but a handy name to use when defining callable tests, by using
it's 'id' property.
| Attribute Name | Description |
---|
id | An identifier used to find a tag, either for calling sub tags or breaking control back to a previous tag |
|
throw -
Throw an exception [no children] |
Throw an exception, which can be caught by a try..catch block.
| Attribute Name | Description |
---|
message | Message to appear in the exception
[Required]
| type | Type of the exception. If the type name does not contain a '.', then "java.lang." is prepended to the string.
[Required]
|
|
try -
A block of code that can have exceptions trapped |
A try tag should be used in conjunction with one or more catch tags like this:
<try>
....
.... Some tags which might throw an exception
....
<catch type="NullPointerException">
<log message="caught a NPE. Exception details: ${exception}" />
<log message="Caught in NullPointerException block. it was ${exception}" />
<log message="Underlying exception was ${_exception}" />
<log message="Underlying exception class was ${_exception.class}" />
</catch>
<catch type="Exception">
<log message="caught another exception"/>
</catch>
</try>
The exception type specified in the catch exception is a Java Exception type name. If not '.'s are found in that
name then "java.lang." is automatically attached to the start of the string
The order of the catch statements is important, as in Java code. The first catch tag that matches the
exception type is executed only, so place catches for your most derived types first.
In the scope of a catch block, two properties are defined, exception and
_exception . These both refer to the caught exception. The exception
property refers to the exception wrapper which contains the tag call stack (not the Java call stack).
The _exception property refers to the underlying Java exception.
See also the throw tag.
| Attribute Name | Description |
---|
|
|