railo-context.Component testbox.system.BaseSpec testbox.system.compat.framework.TestCase coldbox.system.testing.BaseTestCase
Copyright Since 2005 ColdBox Framework by Luis Majano and Ortus Solutions, Corp www.coldbox.org | www.luismajano.com | www.ortussolutions.com Base testing component to intergrate TestBox with ColdBox
Property Summary | ||||
---|---|---|---|---|
type | property | default | serializable | required |
any
|
appMapping
The application mapping this test links to. |
true
|
false
|
|
any
|
coldboxAppKey
The application key for the ColdBox applicatin this test links to. |
true
|
false
|
|
any
|
configMapping
The configuration location this test links to. |
true
|
false
|
|
any
|
controller
The ColdBox controller this test links to. |
true
|
false
|
Method Summary | |
---|---|
any
|
afterAll()
BDD: The main teardown for ColdBox enabled applications after all tests execute. |
any
|
afterTests()
xUnit: The main teardown for ColdBox enabled applications after all tests execute. |
any
|
announceInterception(any state, [struct interceptData='[runtime expression]'], [boolean async='false'], [boolean asyncAll='false'], [boolean asyncAllJoin='true'], [any asyncPriority='NORMAL'], [numeric asyncJoinTimeout='0'])
Announce an interception to the system. |
any
|
beforeAll()
BDD: The main setup method for running ColdBox Integration enabled tests. |
any
|
beforeTests()
The main setup method for running ColdBox Integration enabled tests. |
any
|
execute(any event, [boolean private='false'], [boolean prePostExempt='false'], [struct eventArguments='[runtime expression]'], [boolean renderResults='false'])
Executes a framework lifecycle by executing an event. |
string
|
getAppMapping()
get: The application mapping this test links to. |
any
|
getCache(any cacheName='default')
Get the CacheBox reference from the running application. |
any
|
getCacheBox()
Get the CacheBox reference from the running application. |
string
|
getColdboxAppKey()
get: The application key for the ColdBox applicatin this test links to. |
string
|
getConfigMapping()
get: The configuration location this test links to. |
string
|
getController()
get: The ColdBox controller this test links to. |
any
|
getFlashScope()
Get the RequestContext reference from the running application. |
any
|
getInstance([any name], [any dsl], [any initArguments='[runtime expression]'])
Get a instance object from WireBox. |
any
|
getInterceptor(any interceptorName)
Get an interceptor reference. |
any
|
getLogBox()
Get the LogBox reference from the running application. |
any
|
getMockController()
I will return a mock controller object. |
any
|
getMockModel(any name, [boolean clearMethods='false'])
ColdBox must be loaded for this to work. |
any
|
getMockRequestBuffer()
I will return to you a mock request buffer object used mostly in interceptor calls. |
any
|
getMockRequestContext([boolean clearMethods='false'], [any decorator])
Builds an empty functioning request context mocked with methods via MockBox. |
any
|
getModel([any name], [any dsl], [any initArguments='[runtime expression]'])
Get a model object. |
any
|
getRequestContext()
Get the RequestContext reference from the running application. |
any
|
getUtil()
Get the ColdBox global utility class. |
any
|
getWireBox()
Get the WireBox reference from the running application. |
any
|
metadataInspection()
Inspect test case for annotations. |
any
|
reset([boolean clearMethods='false'], [any decorator])
Reset the persistence of the unit test coldbox app, basically removes the controller from application scope. |
any
|
setAppMapping(any appMapping)
set: The application mapping this test links to. |
any
|
setColdboxAppKey(any coldboxAppKey)
set: The application key for the ColdBox applicatin this test links to. |
any
|
setConfigMapping(any configMapping)
set: The configuration location this test links to. |
any
|
setController(any controller)
set: The ColdBox controller this test links to. |
any
|
setup()
This executes before any test method for integration tests. |
any
|
setupRequest(any event)
Setup an initial request capture. |
Methods inherited from class testbox.system.compat.framework.TestCase |
---|
addAssertDecorator, assert, assertArrayEquals, assertEquals, assertEqualsCase, assertEqualsWithTolerance, assertFalse, assertIsArray, assertIsDefined, assertIsEmpty, assertIsEmptyArray, assertIsEmptyQuery, assertIsEmptyStruct, assertIsExactTypeOf, assertIsQuery, assertIsStruct, assertIsTypeOf, assertIsXMLDoc, assertNotEquals, assertNotSame, assertQueryEquals, assertSame, assertStructEquals, assertTrue, debug, expectException, fail, getMockFactory, init, injectMethod, injectProperty, mock, runTestRemote, setMockingFramework, teardown |
Methods inherited from class testbox.system.BaseSpec |
---|
addAssertions, addMatchers, afterEach, aroundEach, beforeEach, clearDebugBuffer, closureStub, console, createEmptyMock, createMock, createStub, describe, expect, expectedException, getDebugBuffer, getMockBox, getProperty, hasExpectedException, isExpectedException, it, makePublic, prepareMock, print, println, querySim, runAfterEachClosures, runAroundEachClosures, runBeforeEachClosures, runRemote, runSpec, runTestMethod, xdescribe, xit |
Methods inherited from class railo-context.Component |
---|
None |
Property Detail |
---|
The application mapping this test links to
required
- falseserializable
- trueThe application key for the ColdBox applicatin this test links to
required
- falseserializable
- trueThe configuration location this test links to
required
- falseserializable
- trueThe ColdBox controller this test links to
required
- falseserializable
- trueMethod Detail |
---|
BDD: The main teardown for ColdBox enabled applications after all tests execute
xUnit: The main teardown for ColdBox enabled applications after all tests execute
afterTests
in class
testbox.system.compat.framework.TestCase
Announce an interception to the system. If you use the asynchronous facilities, you will get a thread structure report as a result.
state
- The event to announceinterceptData
- A data structure used to pass intercepted information.async
- If true, the entire interception chain will be ran in a separate thread.asyncAll
- If true, each interceptor in the interception chain will be ran in a separate thread and then joined together at the end.asyncAllJoin
- If true, each interceptor in the interception chain will be ran in a separate thread and joined together at the end by default. If you set this flag to false then there will be no joining and waiting for the threads to finalize.asyncPriority
- The thread priority to be used. Either LOW, NORMAL or HIGH. The default value is NORMALasyncJoinTimeout
- The timeout in milliseconds for the join thread to wait for interceptor threads to finish. By default there is no timeout.BDD: The main setup method for running ColdBox Integration enabled tests
The main setup method for running ColdBox Integration enabled tests
beforeTests
in class
testbox.system.compat.framework.TestCase
Executes a framework lifecycle by executing an event. This method returns a request context object that can be used for assertions
event
- The event to executeprivate
- Call a private event or notprePostExempt
- If true, pre/post handlers will not be fired.eventArguments
- A collection of arguments to passthrough to the calling event handler methodrenderResults
- If true, then it will try to do the normal rendering procedures and store the rendered content in the RC as cbox_rendered_contentget: The application mapping this test links to
Get the CacheBox reference from the running application
cacheName
- The cache name to retrieve or returns the 'default' cache by default.Get the CacheBox reference from the running application
get: The application key for the ColdBox applicatin this test links to
get: The configuration location this test links to
get: The ColdBox controller this test links to
Get the RequestContext reference from the running application
Get a instance object from WireBox
name
- The mapping name or CFC path to retrievedsl
- The DSL string to use to retrieve an instanceinitArguments
- The constructor structure of arguments to passthrough when initializing the instanceGet an interceptor reference
interceptorName
- The name of the interceptor to retrieveGet the LogBox reference from the running application
I will return a mock controller object
ColdBox must be loaded for this to work. Get a mock model object by convention. You can optional clear all the methods on the model object if you wanted to. The object is created but not initiated, that would be your job.
name
- The name of the model to mock and return backclearMethods
- Clear methods on the objectI will return to you a mock request buffer object used mostly in interceptor calls
Builds an empty functioning request context mocked with methods via MockBox. You can also optionally wipe all methods on it
clearMethods
- Clear methods on the objectdecorator
- The class path to the decorator to build into the mock request contextGet a model object
name
- The mapping name or CFC path to retrievedsl
- The DSL string to use to retrieve an instanceinitArguments
- The constructor structure of arguments to passthrough when initializing the instanceGet the RequestContext reference from the running application
Get the ColdBox global utility class
Get the WireBox reference from the running application
Inspect test case for annotations
Reset the persistence of the unit test coldbox app, basically removes the controller from application scope
clearMethods
decorator
set: The application mapping this test links to
appMapping
set: The application key for the ColdBox applicatin this test links to
coldboxAppKey
set: The configuration location this test links to
configMapping
set: The ColdBox controller this test links to
controller
This executes before any test method for integration tests
setup
in class
testbox.system.compat.framework.TestCase
Setup an initial request capture. I basically look at the FORM/URL scopes and create the request collection out of them.
event
- The event to setup the request context with, simulates the URL/FORM.event