Test Specification Reference
The test specification grammar provides a very flexible way to call out which tests to run. Â The basic structure is this:
specification ::= unary | binary | compound
unary ::= tags | suite | classMethods | properties
binary ::= (unary | compound) ( and | or | not | eor) (unary | compound)
compound ::= '(' binary ')'
tags ::= '<' tagName (',' (all | success | fail | error | failError)? '>'
suite ::= '[' suiteName (',' suiteName)* ']'
properties ::= '{' propertyName ':' singleQuotedValue (','Â propertyName ':' singleQuotedValue)* '}'
classMethods ::= (('%' packageName)? ('@' className) | qualifiedName) ('#' methodName)? ('$' operationName)?
Â
Probably the best way to explain this is with some examples:
Specification | Result |
---|---|
@classname | Run every method in every class with 'classname' in the name. |
%pack | Run every method in every class with 'pack' in the package name |
@classname and %pack | Run every method which matches both of the previous conditions. This is a compound statement. |
$operation | Run every class and method, but only execute operations named 'operation' |
#method | Matches just the method name |
%pack1@class1#method1$operation1 | Selects packages containing 'pack1', classes named 'class1', methods named 'method1', and only executes operations named 'operation1' |
<tag> | Run the tag named 'tag' using the 'all' set. |
<tag, fail> | Run the tag named 'tag' using the 'fail' set. |
[ aud ] | Run every method in every class with the @JoinSuite tag with the name aud. |
{ property: 'value' } Â | Run every method in all classes which contain an operation with a parameter named 'property' and the value 'value' |
Â
All of the selectors have the effect of choosing any test to run that they match. Â If an operation is specified (using $), only those operations are executed. Â The properties selector will select the entire method if a single operation matches.