lucee.Component testbox.system.TestBox
Copyright Since 2005 TestBox Framework by Luis Majano and Ortus Solutions, Corp www.ortussolutions.com --- Welcome to the next generation of BDD and xUnit testing for CFML applications The TestBox core class allows you to execute all kinds of test bundles, directories and more.
Property Summary | ||||
---|---|---|---|---|
type | property | default | serializable | required |
any
|
bundles
|
true
|
false
|
|
any
|
codename
|
true
|
false
|
|
any
|
coverageService
|
true
|
false
|
|
any
|
excludes
|
true
|
false
|
|
any
|
labels
|
true
|
false
|
|
any
|
options
|
true
|
false
|
|
any
|
reporter
|
true
|
false
|
|
any
|
result
|
true
|
false
|
|
any
|
utility
|
true
|
false
|
|
any
|
version
|
true
|
false
|
Constructor Summary | |
---|---|
init([any bundles='[runtime expression]'], [any directory='[runtime expression]'], [any directories='[runtime expression]'], [any reporter='simple'], [any labels='[runtime expression]'], [any excludes='[runtime expression]'], [struct options='[runtime expression]'])
Constructor. |
Method Summary | |
---|---|
any
|
addBundles(any bundles)
Constructor. |
any
|
addDirectories(any directories, [boolean recurse='true'])
Constructor. |
any
|
addDirectory(any directory, [boolean recurse='true'])
Constructor. |
private any
|
buildReporter(any reporter)
Build a reporter according to passed in reporter type or class path. |
private any
|
getBundle(any bundlePath)
Creates and returns a bundle CFC with spec capabilities if not inherited. |
string
|
getBundles()
|
string
|
getCodename()
|
string
|
getCoverageService()
|
string
|
getExcludes()
|
string
|
getLabels()
|
string
|
getOptions()
|
string
|
getReporter()
|
string
|
getResult()
|
private any
|
getSpecPaths(any directory)
Get an array of spec paths from a directory. |
string
|
getUtility()
|
string
|
getVersion()
|
private any
|
inflateBundles(any bundles)
Inflate incoming bundles from a simple string as a standard array. |
private any
|
inflateExcludes(any excludes)
Inflate incoming excludes from a simple string as a standard array. |
private any
|
inflateLabels(any labels)
Inflate incoming labels from a simple string as a standard array. |
private any
|
produceReport(any results)
Build a report according to this runner's setup reporter, which can be anything. |
any
|
run([any bundles], [any directory], [any reporter], [any labels], [any excludes], [struct options], [any testBundles='[runtime expression]'], [any testSuites='[runtime expression]'], [any testSpecs='[runtime expression]'], [any callbacks='[runtime expression]'], [boolean eagerFailure='false'])
Run me some testing goodness, this can use the constructed object variables or the ones. |
TestResult
|
runRaw([any bundles], [any directory], [any labels], [any excludes], [struct options], [any testBundles='[runtime expression]'], [any testSuites='[runtime expression]'], [any testSpecs='[runtime expression]'], [any callbacks='[runtime expression]'], [boolean eagerFailure='false'])
Run me some testing goodness but give you back the raw TestResults object instead of a report. |
remote any
|
runRemote([string bundles], [string directory], [boolean recurse='true'], [string reporter='simple'], [string reporterOptions='{}'], [string labels=''], [string excludes=''], [string options], [string testBundles=''], [string testSuites=''], [string testSpecs=''], [boolean eagerFailure='false'])
Run me some testing goodness, remotely via SOAP, Flex, REST, URL. |
private any
|
sendStatusHeaders(any results)
Send some status headers. |
any
|
setBundles(any bundles)
|
any
|
setCodename(any codename)
|
any
|
setCoverageService(any coverageService)
|
any
|
setExcludes(any excludes)
|
any
|
setLabels(any labels)
|
any
|
setOptions(any options)
|
any
|
setReporter(any reporter)
|
any
|
setResult(any result)
|
any
|
setUtility(any utility)
|
any
|
setVersion(any version)
|
private any
|
testBundle(any bundlePath, any testResults, any callbacks)
This method executes the tests in a bundle CFC according to type. |
Methods inherited from class lucee.Component |
---|
None |
Constructor Detail |
---|
Constructor
bundles
- The path, list of paths or array of paths of the spec bundle CFCs to run and testdirectory
- The directory to test which can be a simple mapping path or a struct with the following options: [ mapping = the path to the directory using dot notation (myapp.testing.specs), recurse = boolean, filter = closure that receives the path of the CFC found, it must return true to process or false to continue process ]directories
- Same as @directory, but accepts an array or listreporter
- The type of reporter to use for the results, by default is uses our 'simple' report. You can pass in a core reporter string type or an instance of a testbox.system.reports.IReporterlabels
- The list or array of labels that a suite or spec must have in order to execute.excludes
options
- A structure of configuration options that are optionally used to configure a runner.Property Detail |
---|
access
- publicrequired
- falsereturntype
- anyserializable
- trueaccess
- publicrequired
- falsereturntype
- anyserializable
- trueaccess
- publicrequired
- falsereturntype
- anyserializable
- trueaccess
- publicrequired
- falsereturntype
- anyserializable
- trueaccess
- publicrequired
- falsereturntype
- anyserializable
- trueaccess
- publicrequired
- falsereturntype
- anyserializable
- trueaccess
- publicrequired
- falsereturntype
- anyserializable
- trueaccess
- publicrequired
- falsereturntype
- anyserializable
- trueaccess
- publicrequired
- falsereturntype
- anyserializable
- trueaccess
- publicrequired
- falsereturntype
- anyserializable
- trueMethod Detail |
---|
Constructor
bundles
Constructor
directories
- A set of directories to test which can be a list of simple mapping paths or an array of structs with the following options: [ mapping = the path to the directory using dot notation (myapp.testing.specs), recurse = boolean, filter = closure that receives the path of the CFC found, it must return true to process or false to continue process ]recurse
Constructor
directory
- A directory to test which can be a simple mapping path or a struct with the following options: [ mapping = the path to the directory using dot notation (myapp.testing.specs), recurse = boolean, filter = closure that receives the path of the CFC found, it must return true to process or false to continue process ]recurse
Build a reporter according to passed in reporter type or class path
reporter
- The reporter type to build.Creates and returns a bundle CFC with spec capabilities if not inherited.
bundlePath
- The path to the Bundle CFCGet an array of spec paths from a directory
directory
- The directory information struct to test: [ mapping = the path to the directory using dot notation (myapp.testing.specs), recurse = boolean, filter = closure that receives the path of the CFC found, it must return true to process or false to continue process ]Inflate incoming bundles from a simple string as a standard array
bundles
Inflate incoming excludes from a simple string as a standard array
excludes
Inflate incoming labels from a simple string as a standard array
labels
Build a report according to this runner's setup reporter, which can be anything.
results
- The results object to use to produce a reportRun me some testing goodness, this can use the constructed object variables or the ones you can send right here.
bundles
- The path, list of paths or array of paths of the spec bundle CFCs to run and testdirectory
- The directory to test which can be a simple mapping path or a struct with the following options: [ mapping = the path to the directory using dot notation (myapp.testing.specs), recurse = boolean, filter = closure that receives the path of the CFC found, it must return true to process or false to continue process ]reporter
- The type of reporter to use for the results, by default is uses our 'simple' report. You can pass in a core reporter string type or an instance of a testbox.system.reports.IReporter. You can also pass a struct if the reporter requires options: {type="", options={}}labels
- The list or array of labels that a suite or spec must have in order to execute.excludes
- The list or array of labels that a suite or spec must not have in order to execute.options
- A structure of configuration options that are optionally used to configure a runner.testBundles
- A list or array of bundle names that are the ones that will be executed ONLY!testSuites
- A list or array of suite names that are the ones that will be executed ONLY!testSpecs
- A list or array of test names that are the ones that will be executed ONLY!callbacks
- A struct of listener callbacks or a CFC with callbacks for listening to progress of the testing: onBundleStart,onBundleEnd,onSuiteStart,onSuiteEnd,onSpecStart,onSpecEndeagerFailure
- If this boolean is set to true, then execution of more bundle tests will stop once the first failure/error is detected. By default this is false.Run me some testing goodness but give you back the raw TestResults object instead of a report
bundles
- The path, list of paths or array of paths of the spec bundle CFCs to run and testdirectory
- The directory to test which can be a simple mapping path or a struct with the following options: [ mapping = the path to the directory using dot notation (myapp.testing.specs), recurse = boolean, filter = closure that receives the path of the CFC found, it must return true to process or false to continue process ]labels
- The list or array of labels that a suite or spec must have in order to execute.excludes
- The list or array of labels that a suite or spec must not have in order to execute.options
- A structure of configuration options that are optionally used to configure a runner.testBundles
- A list or array of bundle names that are the ones that will be executed ONLY!testSuites
- A list or array of suite names that are the ones that will be executed ONLY!testSpecs
- A list or array of test names that are the ones that will be executed ONLY!callbacks
- A struct of listener callbacks or a CFC with callbacks for listening to progress of the testing: onBundleStart,onBundleEnd,onSuiteStart,onSuiteEnd,onSpecStart,onSpecEndeagerFailure
- If this boolean is set to true, then execution of more bundle tests will stop once the first failure/error is detected. By default this is false.Run me some testing goodness, remotely via SOAP, Flex, REST, URL
bundles
- The path or list of paths of the spec bundle CFCs to run and testdirectory
- The directory mapping to test: directory = the path to the directory using dot notation (myapp.testing.specs)recurse
- Recurse the directory mapping or not, by default it doesreporter
- The type of reporter to use for the results, by default is uses our 'simple' report. You can pass in a core reporter string type or a class path to the reporter to use.reporterOptions
- A JSON struct literal of options to pass into the reporterlabels
- The list of labels that a suite or spec must have in order to execute.excludes
options
- A JSON struct literal of configuration options that are optionally used to configure a runner.testBundles
- A list or array of bundle names that are the ones that will be executed ONLY!testSuites
- A list of suite names that are the ones that will be executed ONLY!testSpecs
- A list of test names that are the ones that will be executed ONLY!eagerFailure
- If this boolean is set to true, then execution of more bundle tests will stop once the first failure/error is detected. By default this is false.Send some status headers
results
bundles
codename
coverageService
excludes
labels
options
reporter
result
utility
version
This method executes the tests in a bundle CFC according to type. If the testing was ok a true is returned.
bundlePath
- The path of the Bundle CFC to test.testResults
- The testing results object to keep track of resultscallbacks
- The callbacks struct or CFC