|
ColdBox Platform Version 3.7.0 | ||||
FRAMES |
WEB-INF.cftags.componentmxunit.framework.Assert
mxunit.framework.TestCase
coldbox.system.testing.BaseTestCase
public class BaseTestCase
A base test case for doing ColdBox Testing based on the MXUnit Framework
Method Summary | |
---|---|
private void |
$abort()
Facade for cfabort |
private void |
$dump(any var, [boolean isAbort='false'])
Facade for cfmx dump |
private void |
$include([string template])
Facade for cfinclude |
private void |
$rethrow(any throwObject)
Rethrow facade |
private any |
$throw(string message, [string detail=''], [string type='Framework'])
Facade for cfthrow |
any |
afterTests()
The main teardown for ColdBox enabled applications after all tests execute |
private any |
announceInterception(any state, [any interceptData='[runtime expression]'], [boolean async='false'], [boolean asyncAll='false'], [boolean asyncAllNoJoin='false'], [string asyncPriority='NORMAL'], [numeric asyncJoinTimeout='0'])
Announce an interception to the system |
any |
beforeTests()
The main setup method for running ColdBox Integration enabled tests |
private any |
execute(string event, [boolean private='false'], [boolean prepostExempt='false'], [struct eventArguments='[runtime expression]'], [boolean renderResults='false'])
Executes a framework lifecycle by executing an event |
private string |
getAppMapping()
Get the AppMapping used for this test case |
private any |
getCacheBox()
Get a reference to cachebox |
private string |
getColdboxAppKey()
Get the coldboxAppKey used to store the coldbox controller in application scope |
private any<IColdboxApplicationCache> |
getColdboxOCM([string cacheName='default'])
Get ColdboxOCM: coldbox |
private string |
getConfigMapping()
Get the ConfigMapping for this test case |
private any |
getController()
Get a reference to the ColdBox mock controller |
private AbstractFlashScope |
getFlashScope()
Returns to you the currently used flash ram object |
private any |
getInterceptor([string interceptorName], [boolean deepSearch='false'])
Get an interceptor |
private any |
getLogBox()
Get a logbox reference |
private MockBox |
getMockBox()
Get a reference to the MockBox framework |
private ConfigBean |
getMockConfigBean([struct configStruct='[runtime expression]'])
I will return to you a configBean according to the mocking configuration structure you send in |
private MockController |
getMockController()
I will return a mock controller object |
private DatasourceBean |
getMockDatasource(string name, [string alias=''], [string dbtype=''], [string username=''], [string password=''])
I will return to you a datasourceBean according to the mocking parameters sent |
private any |
getMockModel(string name, [boolean clearMethods='false'])
*ColdBox must be loaded for this to work |
private any |
getMockPlugin(string path)
Get a plugin mocked with capabilities |
private RequestBuffer |
getMockRequestBuffer()
I will return to you a mock request buffer object used mostly in interceptor calls |
private RequestContext |
getMockRequestContext([boolean clearMethods='false'], [any decorator])
Builds an empty functioning request context mocked with methods via MockBox |
private any |
getModel([any name], [any dsl], [any<struct> initArguments='[runtime expression]'])
Create or retrieve model objects by convention |
private any |
getRequestContext()
Get a reference to the current mock request context |
private Util |
getUtil()
Create and return a util object |
private any |
getWireBox()
Get the wirebox instance |
private void |
metadataInspection()
Inspect test case for annotations |
private query |
querySim(string queryData)
Query Simulator |
private void |
reset()
Reset the persistence of the unit test coldbox app, basically removes the controller from application scope |
private void |
setAppMapping(string AppMapping)
Set the AppMapping for this test case |
private void |
setColdboxAppKey(string coldboxAppKey)
Override the coldboxAppKey, used to store the coldbox controller in application scope |
private void |
setConfigMapping(string ConfigMapping)
Set the ConfigMapping for this test case |
any |
setup()
This executes before any test method for integration tests |
private void |
setupRequest(string event)
Setup an initial request capture |
Methods inherited from class mxunit.framework.Assert |
---|
addAssertDecorator, addAssertDecorators, assert, assertArrayEquals, assertEquals, assertEqualsCase, assertFalse, assertNotEquals, assertNotSame, assertQueryEquals, assertSame, assertStructEquals, assertTrue, clearClassVariables, fail, failEquals, failNotEquals, getActual, getExpected, getHashCode, getStringValue, getTestStyle, init, isPassByValueArray, normalizeArguments, setTestStyle, throwWrapper
|
Methods inherited from class WEB-INF.cftags.component |
---|
|
Method Detail |
---|
private void $abort()
private void $dump(any var, [boolean isAbort='false'])
var
isAbort
- Abort alsoprivate void $include([string template])
template
private void $rethrow(any throwObject)
throwObject
- The cfcatch objectprivate any $throw(string message, [string detail=''], [string type='Framework'])
message
detail
type
public any afterTests()
afterTests
in class
mxunit.framework.TestCase
private any announceInterception(any state, [any interceptData='[runtime expression]'], [boolean async='false'], [boolean asyncAll='false'], [boolean asyncAllNoJoin='false'], [string asyncPriority='NORMAL'], [numeric asyncJoinTimeout='0'])
state
- The interception state to executeinterceptData
- 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.asyncAllNoJoin
- If true, each interceptor in the interception chain will be ran in a separate thread but NOT joined together at the end.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.public any beforeTests()
beforeTests
in class
mxunit.framework.TestCase
private any execute(string event, [boolean private='false'], [boolean prepostExempt='false'], [struct eventArguments='[runtime expression]'], [boolean renderResults='false'])
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_contentprivate string getAppMapping()
private any getCacheBox()
private string getColdboxAppKey()
private any<IColdboxApplicationCache> getColdboxOCM([string cacheName='default'])
cacheName
- The cache name to retrieveprivate string getConfigMapping()
private any getController()
private AbstractFlashScope getFlashScope()
private any getInterceptor([string interceptorName], [boolean deepSearch='false'])
interceptorName
- The name of the interceptor to search fordeepSearch
- By default we search the cache for the interceptor reference. If true, we search all the registered interceptor states for a match.private any getLogBox()
private MockBox getMockBox()
private ConfigBean getMockConfigBean([struct configStruct='[runtime expression]'])
configStruct
- A memento of name-value pairs to initprivate MockController getMockController()
private DatasourceBean getMockDatasource(string name, [string alias=''], [string dbtype=''], [string username=''], [string password=''])
name
- The name of the DSN on the ColdFusion administratoralias
- The alias to use, if not passed the name will be used also as the aliasdbtype
- The db type metadatausername
- The dsn username metadatapassword
- The password metadataprivate any getMockModel(string name, [boolean clearMethods='false'])
name
- The name of the model to mockclearMethods
- If true, all methods in the target mock object will be removed. You can then mock only the methods that you want to mockprivate any getMockPlugin(string path)
path
- The path of the plugin to mockprivate RequestBuffer getMockRequestBuffer()
private RequestContext getMockRequestContext([boolean clearMethods='false'], [any decorator])
clearMethods
- Clear Methods on it?decorator
- The class path to the decorator to build into the mock request contextprivate any getModel([any name], [any dsl], [any<struct> initArguments='[runtime expression]'])
name
- The mapping name or CFC instance path to try to build updsl
- The dsl string to use to retrieve the instance model object, mutually exclusive with 'name'initArguments
- The constructor structure of arguments to passthrough when initializing the instanceprivate any getRequestContext()
private Util getUtil()
private any getWireBox()
private void metadataInspection()
private query querySim(string queryData)
queryData
- The data to create queriesprivate void reset()
private void setAppMapping(string AppMapping)
AppMapping
private void setColdboxAppKey(string coldboxAppKey)
coldboxAppKey
private void setConfigMapping(string ConfigMapping)
ConfigMapping
public any setup()
private void setupRequest(string event)
event
- The event to setup the request context with
|
ColdBox Platform Version 3.7.0 | ||||
FRAMES |