Groovy Documentation

lsst.gruth.grutils
[Groovy] Class TztRun

java.lang.Object
  lsst.gruth.grutils.TztRun
All Implemented Interfaces:
java.lang.Runnable, java.lang.Cloneable

class TztRun

The final structure describing a test and allowing to run a test.

Authors:
bamade


Property Summary
java.lang.Object _args

the arguments to the tests

java.lang.Object _argsNames

the names of the arguments passed to the test (remember those are tagged)

java.lang.String _className

Name of class (duplicated in _report)

java.lang.Object _it

the current object on which we operate (for methods only)

java.lang.String _methodName

name of method ( special name "<build>" for constructors

TztReport _report

java.lang.Object _result

data generated by the call to method or constructor (if any)

java.lang.String _rootName

This is the root String from which the name ot the test (and of the variable built by constructors and factories) will be tagged.

groovy.lang.Binding _this

groovy.lang.Binding _thisG

groovy.lang.Binding _thisL

local context shared by preCode, postCode and expectations

boolean exceptionFired

groovy.lang.Closure expectations

groovy.lang.Closure postCode

groovy.lang.Closure preCode

java.lang.Class thatClazz

the current class

java.lang.Object thatExecCode

Code to be executed (method, constructor) ( a methodClosure)

boolean useRootNameOnly

 
Constructor Summary
TztRun(TztReport template, groovy.lang.Binding bindScript, groovy.lang.Binding bindGroup)

 
Method Summary
java.lang.Object _doNotReport()

java.lang.Object _failIf(java.lang.String stringBooleanExpr)

Adds an AssertionReport to the current TztReport object: the result is FAILED if the evaluation of the string is true (the report also contains the evaluated string).

java.lang.Object _failIf(java.lang.String message, boolean booleanExpr)

Adds an AssertionReport to the current TztReport object: the result is FAILED if the evaluation of the expression is true (the report also contains the message)

java.lang.Object _failIfNot(java.lang.String stringBooleanExpr)

same specs as failIf but faisl if false

java.lang.Object _failIfNot(java.lang.String message, boolean booleanExpr)

same specs as failIf but fails if false

java.lang.Object _message(java.lang.String mess)

java.lang.Object _neutral(java.lang.String stringExpression)

java.lang.Object _neutral(java.lang.String message, groovy.lang.Closure closure)

java.lang.Object _okIfCaught(java.lang.Class throwClass)

java.io.Serializable _reportData(java.io.Serializable data)

used to add some data to the report (does not change the result of the test)

java.lang.Object _warnIf(java.lang.String stringBooleanExpr)

Adds an AssertionReport to the current TztReport object: the result is WARNINGS if the evaluation of the string is true (the report also contains the evaluated string).

java.lang.Object _warnIf(java.lang.String message, boolean booleanExpr)

Adds an AssertionReport to the current TztReport object: the result is WARNINGS if the evaluation of the expression is true (the report also contains the message)

java.lang.Object _warnIfNot(java.lang.String stringBooleanExpr)

same specs as warnIf but warns if false

java.lang.Object _warnIfNot(java.lang.String message, boolean booleanExpr)

same specs as warnIf but warns if false

TztRun clone()

private void normalizeName()

void reportException(java.lang.Throwable th, RawDiagnostic result)

void run()

runs the test

 
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

_args

java.lang.Object _args
the arguments to the tests


_argsNames

java.lang.Object _argsNames
the names of the arguments passed to the test (remember those are tagged)


_className

java.lang.String _className
Name of class (duplicated in _report)


_it

java.lang.Object _it
the current object on which we operate (for methods only)


_methodName

java.lang.String _methodName
name of method ( special name "<build>" for constructors


_report

TztReport _report


_result

java.lang.Object _result
data generated by the call to method or constructor (if any)


_rootName

java.lang.String _rootName
This is the root String from which the name ot the test (and of the variable built by constructors and factories) will be tagged. If there is only one test tagged with this name the test will retain this tag (see variable useRootNameOnly if there are many tests run built along the same _rootName the name of the test in the corresponding TztReport will be built by concatenating the rootName with tags from arguments (+ some shortening process)


_this

groovy.lang.Binding _this


_thisG

groovy.lang.Binding _thisG


_thisL

groovy.lang.Binding _thisL
local context shared by preCode, postCode and expectations


exceptionFired

boolean exceptionFired


expectations

groovy.lang.Closure expectations


postCode

groovy.lang.Closure postCode


preCode

groovy.lang.Closure preCode


thatClazz

java.lang.Class thatClazz
the current class


thatExecCode

java.lang.Object thatExecCode
Code to be executed (method, constructor) ( a methodClosure)


useRootNameOnly

boolean useRootNameOnly


 
Constructor Detail

TztRun

TztRun(TztReport template, groovy.lang.Binding bindScript, groovy.lang.Binding bindGroup)


 
Method Detail

_doNotReport

java.lang.Object _doNotReport()


_failIf

java.lang.Object _failIf(java.lang.String stringBooleanExpr)
Adds an AssertionReport to the current TztReport object: the result is FAILED if the evaluation of the string is true (the report also contains the evaluated string). [NOT WORKING PROPERLY -YET-]
Parameters:
stringBooleanExpr - a Gstring representing a valid Groovy expression
Returns:


_failIf

java.lang.Object _failIf(java.lang.String message, boolean booleanExpr)
Adds an AssertionReport to the current TztReport object: the result is FAILED if the evaluation of the expression is true (the report also contains the message)
Parameters:
message - to be displayed in the report
booleanExpr - before evaluating exceptionfired should be tested
Returns:


_failIfNot

java.lang.Object _failIfNot(java.lang.String stringBooleanExpr)
same specs as failIf but faisl if false
Parameters:
stringBooleanExpr
Returns:


_failIfNot

java.lang.Object _failIfNot(java.lang.String message, boolean booleanExpr)
same specs as failIf but fails if false


_message

java.lang.Object _message(java.lang.String mess)


_neutral

java.lang.Object _neutral(java.lang.String stringExpression)


_neutral

java.lang.Object _neutral(java.lang.String message, groovy.lang.Closure closure)


_okIfCaught

java.lang.Object _okIfCaught(java.lang.Class throwClass)


_reportData

java.io.Serializable _reportData(java.io.Serializable data)
used to add some data to the report (does not change the result of the test)
Parameters:
data - any serializable data
Returns:
the argument


_warnIf

java.lang.Object _warnIf(java.lang.String stringBooleanExpr)
Adds an AssertionReport to the current TztReport object: the result is WARNINGS if the evaluation of the string is true (the report also contains the evaluated string). [NOT WORKING PROPERLY -YET-]
Parameters:
stringBooleanExpr - a Gstring representing a valid Groovy expression
Returns:


_warnIf

java.lang.Object _warnIf(java.lang.String message, boolean booleanExpr)
Adds an AssertionReport to the current TztReport object: the result is WARNINGS if the evaluation of the expression is true (the report also contains the message)
Parameters:
message - to be displayed in the report
booleanExpr
Returns:


_warnIfNot

java.lang.Object _warnIfNot(java.lang.String stringBooleanExpr)
same specs as warnIf but warns if false


_warnIfNot

java.lang.Object _warnIfNot(java.lang.String message, boolean booleanExpr)
same specs as warnIf but warns if false


clone

TztRun clone()


normalizeName

private void normalizeName()


reportException

void reportException(java.lang.Throwable th, RawDiagnostic result)


run

void run()
runs the test


 

Groovy Documentation