TestBox 2.4.0

testbox.system
Class TestResult

railo-context.Component
        extended by testbox.system.TestResult

public class TestResult
extends railo-context.Component

Copyright Since 2005 TestBox Framework by Luis Majano and Ortus Solutions, Corp www.ortussolutions.com --- This object manages the results of testing with TestBox


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
 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
 string getEndTime()
 string getLabels()
 struct getMemento()
          Get a flat representation of this result
 string getStartTime()
 any getSuiteStats(string id)
          Get a suite stats by id from the reverse lookup
 string getTestBundles()
 string getTestSpecs()
 string getTestSuites()
 string getTotalBundles()
 string getTotalDuration()
 string getTotalError()
 string getTotalFail()
 string getTotalPass()
 string getTotalSkipped()
 string getTotalSpecs()
 string getTotalSuites()
 TestResult incrementSpecs(any count='1')
          Increment the global specs found
 any incrementSpecStat(string type, struct stats)
          Record a spec stat with its recursive chain
 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
 any setBundleStats(struct bundleStats)
 any setEndTime(numeric endTime)
 any setLabels(array labels)
 any setStartTime(numeric startTime)
 any setTestBundles(array testBundles)
 any setTestSpecs(array testSpecs)
 any setTestSuites(array testSuites)
 any setTotalBundles(numeric totalBundles)
 any setTotalDuration(numeric totalDuration)
 any setTotalError(numeric totalError)
 any setTotalFail(numeric totalFail)
 any setTotalPass(numeric totalPass)
 any setTotalSkipped(numeric totalSkipped)
 any setTotalSpecs(numeric totalSpecs)
 any setTotalSuites(numeric totalSuites)
 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 railo-context.Component
 

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
Method Detail

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

getEndTime

public string getEndTime()


getLabels

public string getLabels()


getMemento

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


getStartTime

public string getStartTime()


getSuiteStats

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

Parameters:
id - Retrieve by id

getTestBundles

public string getTestBundles()


getTestSpecs

public string getTestSpecs()


getTestSuites

public string getTestSuites()


getTotalBundles

public string getTotalBundles()


getTotalDuration

public string getTotalDuration()


getTotalError

public string getTotalError()


getTotalFail

public string getTotalFail()


getTotalPass

public string getTotalPass()


getTotalSkipped

public string getTotalSkipped()


getTotalSpecs

public string getTotalSpecs()


getTotalSuites

public string getTotalSuites()


incrementSpecs

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

Parameters:
count

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

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


setBundleStats

public any setBundleStats(struct bundleStats)

Parameters:
bundleStats

setEndTime

public any setEndTime(numeric endTime)

Parameters:
endTime

setLabels

public any setLabels(array labels)

Parameters:
labels

setStartTime

public any setStartTime(numeric startTime)

Parameters:
startTime

setTestBundles

public any setTestBundles(array testBundles)

Parameters:
testBundles

setTestSpecs

public any setTestSpecs(array testSpecs)

Parameters:
testSpecs

setTestSuites

public any setTestSuites(array testSuites)

Parameters:
testSuites

setTotalBundles

public any setTotalBundles(numeric totalBundles)

Parameters:
totalBundles

setTotalDuration

public any setTotalDuration(numeric totalDuration)

Parameters:
totalDuration

setTotalError

public any setTotalError(numeric totalError)

Parameters:
totalError

setTotalFail

public any setTotalFail(numeric totalFail)

Parameters:
totalFail

setTotalPass

public any setTotalPass(numeric totalPass)

Parameters:
totalPass

setTotalSkipped

public any setTotalSkipped(numeric totalSkipped)

Parameters:
totalSkipped

setTotalSpecs

public any setTotalSpecs(numeric totalSpecs)

Parameters:
totalSpecs

setTotalSuites

public any setTotalSuites(numeric totalSuites)

Parameters:
totalSuites

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 2.4.0