|
MXUnit 2.1.3 (Generated: 09/27/2012) | ||||
FRAMES |
WEB-INF.cftags.componentmxunit.framework.Assert
mxunit.framework.TestCase
public class TestCase
Composite parent of all TestCases. Extend this class to build and run tests within the MXUnit framework.
Method Summary | |
---|---|
remote any |
TestCase([TestCase aTestCase='[runtime expression]'])
|
any |
_getMockFactory()
Returns the current MockFactory object |
any |
_setMockFactory(any mf)
Dependency injection window |
package boolean |
accept(struct testStruct)
contains the logic for whether a test is a valid runnable method |
void |
addTrace([string message=''])
Deprecated |
void |
afterTests()
|
any |
applyDecorators(any object)
applies the chain of decorators, if it exists |
void |
beforeTests()
|
void |
clearDebug()
Clears the debug array |
any |
createRequestScopeDebug()
|
private TestResult |
createResult()
|
void |
debug(any var)
Use in your tests to add simple or complex debug data to test results |
any |
disableAfterTests()
|
any |
disableBeforeTests()
|
any |
dump(any obj, [any label='MXUNIT Dump'])
|
any |
enableAfterTests()
|
any |
enableBeforeTests()
|
any |
expectException([any expectedExceptionType], [any expectedExceptionMessage=''])
|
Any |
getAnnotation([Any methodName=''], Any annotationName, [Any defaultValue=''])
Returns the value for an annotation, allowing for an mxunit namespace or not |
any |
getBaseTarget()
In case of decorators - return myself |
array |
getDebug()
Returns the debug array |
struct |
getDebugWrapper()
Returns the debug array |
any |
getExpectedExceptionMessage()
|
any |
getExpectedExceptionType()
|
any |
getMockFactory([Any fw=''])
Returns the actual Mock factory of the framework |
any |
getRequiredDecoratorPaths()
Returns a list of fully-qualified paths to framework-required decorators |
array |
getRunnableMethods()
Gets an array of all runnable test methods for this test case |
any |
getVariablesScope()
Front door into the Test's variables scope |
any |
initDebug()
|
private any |
initProperties()
|
void |
injectMethod(any receiver, any giver, string functionName, [string functionNameInReceiver='[runtime expression]'])
injects the method from giver into receiver |
void |
injectProperty(any receiver, string propertyName, any propertyValue, [string scope=''])
injects properties into the receiving object |
string |
invokeTestMethod(string methodName, [struct args='[runtime expression]'])
invoke the test method on this case, returns any output |
package any |
makePublic(any ObjectUnderTest, string privateMethodName, [string proxyMethodName=''])
makes a testable version of a private method for a given object |
any |
mock([any mocked=''], [string mockType], [string fw='MightyMock'])
Returns a mock object via the configured Mock Factory |
boolean |
okToRunAfterTests()
|
boolean |
okToRunBeforeTests()
|
any |
orderedExpectation(any mocks)
Method for mocking |
any |
print([any message])
Wrapper for writeoutout() |
any |
println([any message])
Wrapper for writeoutout() |
void |
restoreMethod(any receiver, string functionName)
restores a previously overwritten method (via injectMethod) to its original state |
remote any |
run([any testResult='[runtime expression]'])
Main run method used by the Eclipse Plugin |
void |
runBare()
Not really used |
remote TestResult |
runTest([any suite='[runtime expression]'])
|
remote void |
runTestRemote([string testMethod=''], [boolean debug='false'], [string output='jqGrid'])
Remote method for running tests quickly via Http |
void |
setDebugWrapper(struct debugArrayWrapper)
|
any |
setExpectedExceptionMessage(string expectedExceptionMessage)
|
any |
setExpectedExceptionType(string expectedExceptionType)
|
any |
setMockingFramework(Any name)
Allows a developer to set the default Mocking Framework for this test case |
void |
setUp()
|
any |
stopRequestScopeDebug()
|
void |
tearDown()
|
string |
toStringValue()
Returns the name of this TestCase |
Methods inherited from class mxunit.framework.Assert |
---|
mxunit.framework.TestCase
|
Methods inherited from class WEB-INF.cftags.component |
---|
|
Method Detail |
---|
remote any TestCase([TestCase aTestCase='[runtime expression]'])
aTestCase
public any _getMockFactory()
public any _setMockFactory(any mf)
mf
package boolean accept(struct testStruct)
testStruct
- Structure for a function coming from getmetadatapublic void addTrace([string message=''])
message
public void afterTests()
public any applyDecorators(any object)
object
- the object to check to see if it needs some decorators appliedpublic void beforeTests()
public void clearDebug()
public any createRequestScopeDebug()
private TestResult createResult()
public void debug(any var)
var
public any disableAfterTests()
public any disableBeforeTests()
public any dump(any obj, [any label='MXUNIT Dump'])
obj
label
public any enableAfterTests()
public any enableBeforeTests()
public any expectException([any expectedExceptionType], [any expectedExceptionMessage=''])
expectedExceptionType
expectedExceptionMessage
public Any getAnnotation([Any methodName=''], Any annotationName, [Any defaultValue=''])
methodName
- The name of the test method. An empty string means a testCase annotationannotationName
- The name of the annotationdefaultValue
- The value to return if no annotation is foundpublic any getBaseTarget()
public array getDebug()
public struct getDebugWrapper()
public any getExpectedExceptionMessage()
public any getExpectedExceptionType()
public any getMockFactory([Any fw=''])
fw
- The name of the mocking framework to usepublic any getRequiredDecoratorPaths()
public array getRunnableMethods()
public any getVariablesScope()
public any initDebug()
private any initProperties()
public void injectMethod(any receiver, any giver, string functionName, [string functionNameInReceiver='[runtime expression]'])
receiver
- the object receiving the methodgiver
- the object giving the methodfunctionName
- the function to be injected from the giver into the receiverfunctionNameInReceiver
- the function name that you will call. this is useful when you want to inject giver.someFunctionXXX but have it be called as someFunction in your receiver objectpublic void injectProperty(any receiver, string propertyName, any propertyValue, [string scope=''])
receiver
- the object receiving the methodpropertyName
- the property to be overwrittenpropertyValue
- the property value to be usedscope
- the scope in which to set the property. Defaults to variables and this.public string invokeTestMethod(string methodName, [struct args='[runtime expression]'])
methodName
- the name of the method to invokeargs
- Optional set of argumentspackage any makePublic(any ObjectUnderTest, string privateMethodName, [string proxyMethodName=''])
ObjectUnderTest
- an instance of the object with a private method to be proxiedprivateMethodName
- name of the private method to be proxiedproxyMethodName
- name of the proxy method name to be used; if not passed, defaults to the name of the private method prefixed with an underscorepublic any mock([any mocked=''], [string mockType], [string fw='MightyMock'])
mocked
- Component name or an actual componentmockType
- Type of mock to create (fast,typeSafe,...)fw
- The name of the mocking framework to usepublic boolean okToRunAfterTests()
public boolean okToRunBeforeTests()
public any orderedExpectation(any mocks)
mocks
- One or more mocks in which to verify orderpublic any print([any message])
message
public any println([any message])
message
public void restoreMethod(any receiver, string functionName)
receiver
functionName
remote any run([any testResult='[runtime expression]'])
testResult
public void runBare()
remote TestResult runTest([any suite='[runtime expression]'])
suite
remote void runTestRemote([string testMethod=''], [boolean debug='false'], [string output='jqGrid'])
testMethod
- A single test to run. If not specified, all tests are run.debug
- Flag to indicate whether or not to dump the test results to the screen.output
- Output format: html,xml,junitxml,jqGrid public void setDebugWrapper(struct debugArrayWrapper)
debugArrayWrapper
public any setExpectedExceptionMessage(string expectedExceptionMessage)
expectedExceptionMessage
public any setExpectedExceptionType(string expectedExceptionType)
expectedExceptionType
public any setMockingFramework(Any name)
name
- The name of the mocking framework to usepublic void setUp()
public any stopRequestScopeDebug()
public void tearDown()
public string toStringValue()
|
MXUnit 2.1.3 (Generated: 09/27/2012) | ||||
FRAMES |