coldbox.system.testing

Class VirtualApp

lucee.Component
    extended by coldbox.system.testing.VirtualApp

Copyright Since 2005 ColdBox Framework by Luis Majano and Ortus Solutions, Corp www.ortussolutions.com --- This object is in charge of starting up virtual ColdBox applications used in integration testing. The Virtual applications follow the convention of loading into the application scope.

Class Attributes:
  • synchronized : false
  •  
  • accessors : true
  •  
  • persistent : false
  •  
    Constructor Summary
    init([string appMapping='/'], [string configPath=''], [string webMapping=''])
          Constructor.
    Method Summary
    any getController()
         Get the running application controller.
    boolean isRunning()
         Verifies if the ColdBox application is in application scope and running.
    any restart()
         Restart the virtual app.
    any shutdown([boolean force='true'])
         Shuts down a virtual ColdBox application.
    any startup([boolean force='false'])
         Startup a virtual ColdBox application for integration testing purposes.
     
    Methods inherited from class lucee.Component
    None

    Constructor Detail

    init

    public init([string appMapping='/'], [string configPath=''], [string webMapping=''])

    Constructor

    Parameters:
    appMapping - The mapping that points to the ColdBox's application root. This will be expanded via
    expandPath()
    configPath - The CFC path to the ColdBox configuration object to load. The default is
    config.Coldbox
    webMapping - The direct location of the application's web root in the server, only used if using a modern non-webroot template

    Method Detail

    getController

    public any getController()

    Get the running application controller. Null if not in scope!


    isRunning

    public boolean isRunning()

    Verifies if the ColdBox application is in application scope and running


    restart

    public any restart()

    Restart the virtual app


    shutdown

    public any shutdown([boolean force='true'])

    Shuts down a virtual ColdBox application. It expects the

    cbController
    to be the app by convention.

    Parameters:
    force - If true, it forces all shutdowns this is usually true when doing reinits. Defaults to true for testing.

    startup

    public any startup([boolean force='false'])

    Startup a virtual ColdBox application for integration testing purposes.

    Parameters:
    force - Force the startup of the application even if found. Default is false
    Returns:
    The loaded Application controller