Hi all, I'm having a bit of trouble setting up MXUnit tests with
ColdSpring and Transfer. I've got a virtual host set up in Apache
pointing to "C:\htdocs\cb_test_app\trunk\wwwroot", but my MXUnit tests
in Eclipse run from "http://localhost/" ("C:\htdocs").
Here is what I've got so far:
<cfcomponent name="homeTest"
extends="coldbox.system.extras.testing.baseMXUnitTest" output="false">
<cfscript>
//Uncomment the following if you dont' need the controller in
application scope for testing.
//this.PERSIST_FRAMEWORK = false;
</cfscript>
<cffunction name="setup" returntype="void" access="public"
output="false">
<cfscript>
//path from http://localhost/
setAppMapping( "/cb_test_app/trunk/wwwroot" );
setConfigMapping( ExpandPath( instance.AppMapping & "/config/
coldbox.xml.cfm" ) );
super.setup();
</cfscript>
</cffunction>
</cfcomponent>
This works fine with all the ColdBox settings. I've also set up
different settings for Transfer in my environments.xml file:
<environment name="unittest" urls="localhost">
<!--ColdBoxSpecific Settings to override -->
<Setting name="HandlersIndexAutoReload" value="true" />
<Setting name="ConfigAutoReload" value="true" />
<Setting name="ModelsObjectCaching" value="false" />
<Setting name="HandlerCaching" value="false"/>
<Setting name="IOCObjectCaching" value="false" />
<Setting name="IOCFrameworkReload" value="true" />
<Setting name="EventCaching" value="false" />
<!-- Transfer Settings -->
<Setting name="transfer_datasourcePath" value="/cb_test_app/trunk/
wwwroot/config/datasource.xml.cfm" />
<Setting name="transfer_configPath" value="/cb_test_app/trunk/
wwwroot/config/transfer.xml.cfm" />
<Setting name="transfer_definitionPath" value="/cb_test_app/trunk/
wwwroot/config/definitions" />
</environment>
That works as well with the <value>${transfer_datasourcePath}</value>
custom settings. But I can't use custom settings on the bean class
path (as they don't substitute). I want to do something like this:
<bean id="ScopeFacade" class="{cfc_path}model.util.ScopeFacade">
So that my code will work from the virtual host and from the
localhost.
Any help appreciated or alternative suggestions appreciated.
Thanks,
- John