coldbox.system.testing

Class TestBox

WEB-INF.cftags.component
        extended by coldbox.system.testing.TestBox
Class Attributes:
  • accessors : true
  •  

    ******************************************************************************* Copyright 2005-2009 ColdBox Framework by Luis Majano and Ortus Solutions, Corp www.coldbox.org | www.luismajano.com | 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 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 reporter='simple'], [any labels='[runtime expression]'], [struct options='[runtime expression]'])
          Constructor.
    Method Summary
    any GETBUNDLES()
    any GETCODENAME()
    any GETLABELS()
    any GETOPTIONS()
    any GETREPORTER()
    any GETRESULT()
    any GETUTILITY()
    any GETVERSION()
    TestBox SETBUNDLES(any bundles)
    TestBox SETCODENAME(any codename)
    TestBox SETLABELS(any labels)
    TestBox SETOPTIONS(any options)
    TestBox SETREPORTER(any reporter)
    TestBox SETRESULT(any result)
    TestBox SETUTILITY(any utility)
    TestBox SETVERSION(any version)
    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.
    private any getSpecPaths(any directory)
         Get an array of spec paths from a directory.
    private any inflateBundles(any bundles)
         Inflate incoming bundles 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], [struct options], [any testBundles='[runtime expression]'], [any testSuites='[runtime expression]'], [any testSpecs='[runtime expression]'])
         Run me some testing goodness, this can use the constructed object variables or the ones you can send right here.
    TestResult runRaw([any bundles], [any directory], [any labels], [struct options], [any testBundles='[runtime expression]'], [any testSuites='[runtime expression]'], [any testSpecs='[runtime expression]'])
         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 options], [string testBundles=''], [string testSuites=''], [string testSpecs=''])
         Run me some testing goodness, remotely via SOAP, Flex, REST, URL.
    private any testBundle(any bundlePath, any testResults)
         ************************************** PRIVATE ************************************************************ // /** This method executes the tests in a bundle CFC according to type.
     
    Methods inherited from class WEB-INF.cftags.component
    None

    Constructor Detail

    init

    public init([any bundles='[runtime expression]'], [any directory='[runtime expression]'], [any reporter='simple'], [any labels='[runtime expression]'], [struct options='[runtime expression]'])

    Constructor

    Parameters:
    bundles - The path, list of paths or array of paths of the spec bundle CFCs to run and test
    directory - 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 coldbox.system.testing.reports.IReporter
    labels - The list or array of labels that a suite or spec must have in order to execute.
    options - A structure of configuration options that are optionally used to configure a runner.

    Property Detail

    bundles

    property any bundles

    Attributes:
    serializable - true
    required - false

    codename

    property any codename

    Attributes:
    serializable - true
    required - false

    labels

    property any labels

    Attributes:
    serializable - true
    required - false

    options

    property any options

    Attributes:
    serializable - true
    required - false

    reporter

    property any reporter

    Attributes:
    serializable - true
    required - false

    result

    property any result

    Attributes:
    serializable - true
    required - false

    utility

    property any utility

    Attributes:
    serializable - true
    required - false

    version

    property any version

    Attributes:
    serializable - true
    required - false

    Method Detail

    GETBUNDLES

    public any GETBUNDLES()


    GETCODENAME

    public any GETCODENAME()


    GETLABELS

    public any GETLABELS()


    GETOPTIONS

    public any GETOPTIONS()


    GETREPORTER

    public any GETREPORTER()


    GETRESULT

    public any GETRESULT()


    GETUTILITY

    public any GETUTILITY()


    GETVERSION

    public any GETVERSION()


    SETBUNDLES

    public TestBox SETBUNDLES(any bundles)

    Parameters:
    bundles

    SETCODENAME

    public TestBox SETCODENAME(any codename)

    Parameters:
    codename

    SETLABELS

    public TestBox SETLABELS(any labels)

    Parameters:
    labels

    SETOPTIONS

    public TestBox SETOPTIONS(any options)

    Parameters:
    options

    SETREPORTER

    public TestBox SETREPORTER(any reporter)

    Parameters:
    reporter

    SETRESULT

    public TestBox SETRESULT(any result)

    Parameters:
    result

    SETUTILITY

    public TestBox SETUTILITY(any utility)

    Parameters:
    utility

    SETVERSION

    public TestBox SETVERSION(any version)

    Parameters:
    version

    buildReporter

    private any buildReporter(any reporter)

    Build a reporter according to passed in reporter type or class path

    Parameters:
    reporter - The reporter type to build.

    getBundle

    private any getBundle(any bundlePath)

    Creates and returns a bundle CFC with spec capabilities if not inherited.

    Parameters:
    bundlePath - The path to the Bundle CFC

    getSpecPaths

    private any getSpecPaths(any directory)

    Get an array of spec paths from a directory

    Parameters:
    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 ]

    inflateBundles

    private any inflateBundles(any bundles)

    Inflate incoming bundles from a simple string as a standard array

    Parameters:
    bundles

    inflateLabels

    private any inflateLabels(any labels)

    Inflate incoming labels from a simple string as a standard array

    Parameters:
    labels

    produceReport

    private any produceReport(any results)

    Build a report according to this runner's setup reporter, which can be anything.

    Parameters:
    results - The results object to use to produce a report

    run

    public any run([any bundles], [any directory], [any reporter], [any labels], [struct options], [any testBundles='[runtime expression]'], [any testSuites='[runtime expression]'], [any testSpecs='[runtime expression]'])

    Run me some testing goodness, this can use the constructed object variables or the ones you can send right here.

    Parameters:
    bundles - The path, list of paths or array of paths of the spec bundle CFCs to run and test
    directory - 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 coldbox.system.testing.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.
    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!

    runRaw

    public TestResult runRaw([any bundles], [any directory], [any labels], [struct options], [any testBundles='[runtime expression]'], [any testSuites='[runtime expression]'], [any testSpecs='[runtime expression]'])

    Run me some testing goodness but give you back the raw TestResults object instead of a report

    Parameters:
    bundles - The path, list of paths or array of paths of the spec bundle CFCs to run and test
    directory - 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.
    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!

    runRemote

    remote any runRemote([string bundles], [string directory], [boolean recurse='true'], [string reporter='simple'], [string reporterOptions='{}'], [string labels=''], [string options], [string testBundles=''], [string testSuites=''], [string testSpecs=''])

    Run me some testing goodness, remotely via SOAP, Flex, REST, URL

    Parameters:
    bundles - The path or list of paths of the spec bundle CFCs to run and test
    directory - 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 does
    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 a class path to the reporter to use.
    reporterOptions - A JSON struct literal of options to pass into the reporter
    labels - The list of labels that a suite or spec must have in order to execute.
    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!

    testBundle

    private any testBundle(any bundlePath, any testResults)

    ************************************** PRIVATE ************************************************************ // /** This method executes the tests in a bundle CFC according to type

    Parameters:
    bundlePath - The path of the Bundle CFC to test.
    testResults - The testing results object to keep track of results