| 1 | <!----------------------------------------------------------------------- |
|---|
| 2 | Template : baseTest.cfc |
|---|
| 3 | Author : luis5198 |
|---|
| 4 | Date : 5/25/2007 5:59:04 PM |
|---|
| 5 | Description : |
|---|
| 6 | Base Unit Test Component based on CFCUnit. |
|---|
| 7 | |
|---|
| 8 | If you would like to change this to CFUnit, then change the extends |
|---|
| 9 | portion to net.sourceforge.cfunit.framework.TestCase |
|---|
| 10 | |
|---|
| 11 | Modification History: |
|---|
| 12 | 5/25/2007 - Created Template |
|---|
| 13 | ----------------------------------------------------------------------> |
|---|
| 14 | <cfcomponent name="baseTest" extends="org.cfcunit.framework.TestCase" output="false"> |
|---|
| 15 | |
|---|
| 16 | <cfscript> |
|---|
| 17 | variables.instance = structnew(); |
|---|
| 18 | </cfscript> |
|---|
| 19 | |
|---|
| 20 | <cffunction name="setUp" returntype="void" access="private"> |
|---|
| 21 | <cfscript> |
|---|
| 22 | //Setup ColdBox Mappings For Testing |
|---|
| 23 | instance.AppMapping = "/applications/coldbox/ApplicationTemplate"; |
|---|
| 24 | instance.ConfigMapping = ExpandPath(instance.AppMapping & "/config/config.xml.cfm"); |
|---|
| 25 | //Initialize ColdBox Controller |
|---|
| 26 | instance.controller = CreateObject("component", "coldbox.system.controller").init(); |
|---|
| 27 | //Load Configurations |
|---|
| 28 | instance.controller.getService("loader").configLoader(instance.ConfigMapping,instance.AppMapping); |
|---|
| 29 | //Finish Registration |
|---|
| 30 | instance.controller.getService("loader").registerHandlers(); |
|---|
| 31 | </cfscript> |
|---|
| 32 | </cffunction> |
|---|
| 33 | |
|---|
| 34 | <!--- getter for AppMapping ---> |
|---|
| 35 | <cffunction name="getAppMapping" access="public" returntype="string" output="false"> |
|---|
| 36 | <cfreturn instance.AppMapping> |
|---|
| 37 | </cffunction> |
|---|
| 38 | |
|---|
| 39 | <!--- getter for ConfigMapping ---> |
|---|
| 40 | <cffunction name="getConfigMapping" access="public" returntype="string" output="false"> |
|---|
| 41 | <cfreturn instance.ConfigMapping> |
|---|
| 42 | </cffunction> |
|---|
| 43 | |
|---|
| 44 | <!--- getter for controller ---> |
|---|
| 45 | <cffunction name="getcontroller" access="public" returntype="any" output="false"> |
|---|
| 46 | <cfreturn instance.controller> |
|---|
| 47 | </cffunction> |
|---|
| 48 | |
|---|
| 49 | </cfcomponent> |
|---|