TestBox v1.0.0

testbox.system.testing
Class TestResult

WEB-INF.cftags.component
        extended by testbox.system.testing.TestResult

public class TestResult
extends WEB-INF.cftags.component

******************************************************************************* Copyright 2005-2009 ColdBox Framework by Luis Majano and Ortus Solutions, Corp www.coldbox.org | www.luismajano.com | www.ortussolutions.com ******************************************************************************* This object manages the results of testing with TestBox

Property Summary
Type Property & Description Default Serializable Required
 struct bundleStats


Attributes:
true false
 numeric endTime


Attributes:
true false
 array labels


Attributes:
true false
 numeric startTime


Attributes:
true false
 array testBundles


Attributes:
true false
 array testSpecs


Attributes:
true false
 array testSuites


Attributes:
true false
 numeric totalBundles


Attributes:
true false
 numeric totalDuration


Attributes:
true false
 numeric totalError


Attributes:
true false
 numeric totalFail


Attributes:
true false
 numeric totalPass


Attributes:
true false
 numeric totalSkipped


Attributes:
true false
 numeric totalSpecs


Attributes:
true false
 numeric totalSuites


Attributes:
true false
 
Constructor Summary
init([numeric bundleCount='0'], [array labels='[runtime expression]'], [array testBundles='[runtime expression]'], [array testSuites='[runtime expression]'], [array testSpecs='[runtime expression]'])
          Constructor
 
Method Summary
 numeric GETENDTIME()
 array GETLABELS()
 numeric GETSTARTTIME()
 array GETTESTBUNDLES()
 array GETTESTSPECS()
 array GETTESTSUITES()
 numeric GETTOTALBUNDLES()
 numeric GETTOTALDURATION()
 numeric GETTOTALERROR()
 numeric GETTOTALFAIL()
 numeric GETTOTALPASS()
 numeric GETTOTALSKIPPED()
 numeric GETTOTALSPECS()
 numeric GETTOTALSUITES()
 TestResult SETBUNDLESTATS(struct bundleStats)
 TestResult SETENDTIME(numeric endTime)
 TestResult SETLABELS(array labels)
 TestResult SETSTARTTIME(numeric startTime)
 TestResult SETTESTBUNDLES(array testBundles)
 TestResult SETTESTSPECS(array testSpecs)
 TestResult SETTESTSUITES(array testSuites)
 TestResult SETTOTALBUNDLES(numeric totalBundles)
 TestResult SETTOTALDURATION(numeric totalDuration)
 TestResult SETTOTALERROR(numeric totalError)
 TestResult SETTOTALFAIL(numeric totalFail)
 TestResult SETTOTALPASS(numeric totalPass)
 TestResult SETTOTALSKIPPED(numeric totalSkipped)
 TestResult SETTOTALSPECS(numeric totalSpecs)
 TestResult SETTOTALSUITES(numeric totalSuites)
 TestResult end()
          Finish recording stats
 TestResult endStats(struct stats)
          End processing of a bundle stats reference
 any getBundleStats([string id])
          Get a bundle stats by path as a struct or the entire stats array if no path passed
 struct getMemento()
          Get a flat representation of this result
 any getSuiteStats(string id)
          Get a suite stats by id from the reverse lookup
 any incrementSpecStat(string type, struct stats)
          Record a spec stat with its recursive chain
 TestResult incrementSpecs(any count='1')
          Increment the global specs found
 TestResult incrementStat(any type='pass', [numeric count='1'])
          Increment a global stat
 TestResult incrementSuites(any count='1')
          Increment the global suites found
 boolean isComplete()
          Verify testing is complete in results
 struct startBundleStats(string bundlePath, string name)
          Start a new bundle stats and return its reference
 struct startSpecStats(string name, struct suiteStats)
          Start a new spec stats and return its reference
 struct startSuiteStats(string name, struct bundleStats, [struct parentStats='[runtime expression]'])
          Start a new suite stats and return its reference
 any storeDebugBuffer([array buffer])
          Store latest bundle debug output buffer by adding it to the top bundle
 
Methods inherited from class WEB-INF.cftags.component
None
 

Constructor Detail

init

public init([numeric bundleCount='0'], [array labels='[runtime expression]'], [array testBundles='[runtime expression]'], [array testSuites='[runtime expression]'], [array testSpecs='[runtime expression]'])
Constructor

Parameters:
bundleCount - the count to init the results for
labels - The lables to use
testBundles - The test bundles that should execute ONLY
testSuites - The test suites that should execute ONLY
testSpecs - The test specs that should execut ONLY
Property Detail

bundleStats

struct bundleStats

Attributes:
default -
serializable - true
required - false

endTime

numeric endTime

Attributes:
default -
serializable - true
required - false

labels

array labels

Attributes:
default -
serializable - true
required - false

startTime

numeric startTime

Attributes:
default -
serializable - true
required - false

testBundles

array testBundles

Attributes:
default -
serializable - true
required - false

testSpecs

array testSpecs

Attributes:
default -
serializable - true
required - false

testSuites

array testSuites

Attributes:
default -
serializable - true
required - false

totalBundles

numeric totalBundles

Attributes:
default -
serializable - true
required - false

totalDuration

numeric totalDuration

Attributes:
default -
serializable - true
required - false

totalError

numeric totalError

Attributes:
default -
serializable - true
required - false

totalFail

numeric totalFail

Attributes:
default -
serializable - true
required - false

totalPass

numeric totalPass

Attributes:
default -
serializable - true
required - false

totalSkipped

numeric totalSkipped

Attributes:
default -
serializable - true
required - false

totalSpecs

numeric totalSpecs

Attributes:
default -
serializable - true
required - false

totalSuites

numeric totalSuites

Attributes:
default -
serializable - true
required - false

Method Detail

GETENDTIME

public numeric GETENDTIME()


GETLABELS

public array GETLABELS()


GETSTARTTIME

public numeric GETSTARTTIME()


GETTESTBUNDLES

public array GETTESTBUNDLES()


GETTESTSPECS

public array GETTESTSPECS()


GETTESTSUITES

public array GETTESTSUITES()


GETTOTALBUNDLES

public numeric GETTOTALBUNDLES()


GETTOTALDURATION

public numeric GETTOTALDURATION()


GETTOTALERROR

public numeric GETTOTALERROR()


GETTOTALFAIL

public numeric GETTOTALFAIL()


GETTOTALPASS

public numeric GETTOTALPASS()


GETTOTALSKIPPED

public numeric GETTOTALSKIPPED()


GETTOTALSPECS

public numeric GETTOTALSPECS()


GETTOTALSUITES

public numeric GETTOTALSUITES()


SETBUNDLESTATS

public TestResult SETBUNDLESTATS(struct bundleStats)

Parameters:
bundleStats

SETENDTIME

public TestResult SETENDTIME(numeric endTime)

Parameters:
endTime

SETLABELS

public TestResult SETLABELS(array labels)

Parameters:
labels

SETSTARTTIME

public TestResult SETSTARTTIME(numeric startTime)

Parameters:
startTime

SETTESTBUNDLES

public TestResult SETTESTBUNDLES(array testBundles)

Parameters:
testBundles

SETTESTSPECS

public TestResult SETTESTSPECS(array testSpecs)

Parameters:
testSpecs

SETTESTSUITES

public TestResult SETTESTSUITES(array testSuites)

Parameters:
testSuites

SETTOTALBUNDLES

public TestResult SETTOTALBUNDLES(numeric totalBundles)

Parameters:
totalBundles

SETTOTALDURATION

public TestResult SETTOTALDURATION(numeric totalDuration)

Parameters:
totalDuration

SETTOTALERROR

public TestResult SETTOTALERROR(numeric totalError)

Parameters:
totalError

SETTOTALFAIL

public TestResult SETTOTALFAIL(numeric totalFail)

Parameters:
totalFail

SETTOTALPASS

public TestResult SETTOTALPASS(numeric totalPass)

Parameters:
totalPass

SETTOTALSKIPPED

public TestResult SETTOTALSKIPPED(numeric totalSkipped)

Parameters:
totalSkipped

SETTOTALSPECS

public TestResult SETTOTALSPECS(numeric totalSpecs)

Parameters:
totalSpecs

SETTOTALSUITES

public TestResult SETTOTALSUITES(numeric totalSuites)

Parameters:
totalSuites

end

public TestResult end()
Finish recording stats


endStats

public TestResult endStats(struct stats)
End processing of a bundle stats reference

Parameters:
stats - The bundle stats structure reference to complete

getBundleStats

public any getBundleStats([string id])
Get a bundle stats by path as a struct or the entire stats array if no path passed.

Parameters:
id - If passed, then retrieve by id

getMemento

public struct getMemento()
Get a flat representation of this result


getSuiteStats

public any getSuiteStats(string id)
Get a suite stats by id from the reverse lookup

Parameters:
id - Retrieve by id

incrementSpecStat

public any incrementSpecStat(string type, struct stats)
Record a spec stat with its recursive chain

Parameters:
type - The type of stat to store: skipped,fail,error,pass
stats

incrementSpecs

public TestResult incrementSpecs(any count='1')
Increment the global specs found

Parameters:
count

incrementStat

public TestResult incrementStat(any type='pass', [numeric count='1'])
Increment a global stat

Parameters:
type - The type of stat to increment: fail,pass,error or skipped
count

incrementSuites

public TestResult incrementSuites(any count='1')
Increment the global suites found

Parameters:
count

isComplete

public boolean isComplete()
Verify testing is complete in results


startBundleStats

public struct startBundleStats(string bundlePath, string name)
Start a new bundle stats and return its reference

Parameters:
bundlePath
name

startSpecStats

public struct startSpecStats(string name, struct suiteStats)
Start a new spec stats and return its reference

Parameters:
name - The name of the suite
suiteStats - The suite stats reference this belongs to.

startSuiteStats

public struct startSuiteStats(string name, struct bundleStats, [struct parentStats='[runtime expression]'])
Start a new suite stats and return its reference

Parameters:
name - The name of the suite
bundleStats - The bundle stats reference this belongs to.
parentStats - If passed, the parent stats this suite belongs to

storeDebugBuffer

public any storeDebugBuffer([array buffer])
Store latest bundle debug output buffer by adding it to the top bundle

Parameters:
buffer

TestBox v1.0.0