Groovy Documentation

lsst.gruth.grutils
[Groovy] Class GroupSpec

java.lang.Object
  lsst.gruth.grutils.GroupSpec

class GroupSpec

Created initially by a call to _with**, it deals with a group of test specification. In the end will be expanded in a map of tests to execute and report.

Authors:
bamade


Nested Class Summary
static class GroupSpec.Combiner

A utility class tom help build combinations of tests.

 
Property Summary
static java.util.regex.Pattern NULL_PATTERN

groovy.lang.Binding _this

a copy of the _this global Binding

groovy.lang.Binding _thisG

A binding specific to this group.

java.lang.String className

name of Class: may be null if objects of different types are tested

java.lang.Class clazz

the Class: may be null if objects of different types are tested

java.lang.Object execCode

for constructors or static methods only (may differ if there are many objects).

java.lang.String groupName

Name for group (either explicit or generated)

java.util.List instances

specific to tests with instances.

java.lang.String methodName

name of method

java.util.List rawSpecs

the list of tests specification to be populated

TztReport reportTemplate

a template for the TztReport that will be generated.

groovy.lang.Closure setUpCode

code to be executed before running all tests in this group

SpecType specType

type of specification. see SpecType.

groovy.lang.Closure tearDownCode

code to be executed after the tests have been run

 
Constructor Summary
GroupSpec(SpecType type, groovy.lang.Binding bind, java.lang.String className, java.lang.String methodName)

GroupSpec(SpecType type, groovy.lang.Binding bind, java.lang.String className)

GroupSpec(SpecType type, groovy.lang.Binding bind)

 
Method Summary
GroupRun _group(groovy.lang.Closure clos)

This method should be abstract : seed docs in subclasses.

GroupRun _post(groovy.lang.Closure clos)

code to be run once the tests of a group have been run (kind of teartDown code)

GroupRun _prepare()

Once the _group information has been collected, each _group code should end by calling this method.

RawTestSpec _test(java.util.Map map)

Prepares a RawTestSpec structure.

RawTestSpec _test(java.util.Map map, groovy.lang.Closure clos)

Enables a simplified syntax instead of _test map _xpect { / expectations/ } one can write _test map { / expectations/ }

java.util.List fromRawArgsToRawRuns(java.util.Map map, TztReport template, groovy.lang.Binding groupBind)

each element of the Map looks like KEY: arg1,ar2, arg3 KEY2: argn, argm KEY will become the "rootName" of a test run then each arg will be exploded:

  • - arg can be a TaggedsMap
  • - NO: arg can be a Map -> NamedMap (NO won' tests other objects that are maps!)

 
Methods inherited from class java.lang.Object
java.lang.Object#wait(), java.lang.Object#wait(long), java.lang.Object#wait(long, int), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll()
 

Property Detail

NULL_PATTERN

static java.util.regex.Pattern NULL_PATTERN


_this

groovy.lang.Binding _this
a copy of the _this global Binding


_thisG

groovy.lang.Binding _thisG
A binding specific to this group.


className

java.lang.String className
name of Class: may be null if objects of different types are tested


clazz

java.lang.Class clazz
the Class: may be null if objects of different types are tested


execCode

java.lang.Object execCode
for constructors or static methods only (may differ if there are many objects).


groupName

java.lang.String groupName
Name for group (either explicit or generated)


instances

java.util.List instances
specific to tests with instances. (TODO: move to InvokeGrouSpecs if possible)


methodName

java.lang.String methodName
name of method


rawSpecs

java.util.List rawSpecs
the list of tests specification to be populated


reportTemplate

TztReport reportTemplate
a template for the TztReport that will be generated. this report can be modified by events during set up time (while building the specifications of tests) then will be cloned for every TztRun before it is run and then the report will be completed.


setUpCode

groovy.lang.Closure setUpCode
code to be executed before running all tests in this group


specType

SpecType specType
type of specification. see SpecType. not all combination are valid for subclasses (for instance InvokeGroupSpec cannot be CTOR)


tearDownCode

groovy.lang.Closure tearDownCode
code to be executed after the tests have been run


 
Constructor Detail

GroupSpec

GroupSpec(SpecType type, groovy.lang.Binding bind, java.lang.String className, java.lang.String methodName)


GroupSpec

GroupSpec(SpecType type, groovy.lang.Binding bind, java.lang.String className)


GroupSpec

GroupSpec(SpecType type, groovy.lang.Binding bind)


 
Method Detail

_group

GroupRun _group(groovy.lang.Closure clos)
This method should be abstract : seed docs in subclasses. It shoud gather : setUpCode, tearDownCode, and all the RawTestSpec
Parameters:
clos
Returns:


_post

GroupRun _post(groovy.lang.Closure clos)
code to be run once the tests of a group have been run (kind of teartDown code)
Parameters:
clos
Returns:


_prepare

GroupRun _prepare()
Once the _group information has been collected, each _group code should end by calling this method. A GroupRun structure will be built to prepare the execution of tests. Since the tests specification uses set of values the tests to be run should be generated by combining values.
This method is extremely complex and should be carefully maintened.
Returns:


_test

RawTestSpec _test(java.util.Map map)
Prepares a RawTestSpec structure.
Parameters:
map - : argument to be passed to the rawTestSpec structure.
Returns:


_test

RawTestSpec _test(java.util.Map map, groovy.lang.Closure clos)
Enables a simplified syntax instead of _test map _xpect { / expectations/ } one can write _test map { / expectations/ }
Parameters:
map
clos
Returns:


fromRawArgsToRawRuns

java.util.List fromRawArgsToRawRuns(java.util.Map map, TztReport template, groovy.lang.Binding groupBind)
each element of the Map looks like KEY: arg1,ar2, arg3 KEY2: argn, argm KEY will become the "rootName" of a test run then each arg will be exploded:


 

Groovy Documentation