Title: RE: Using getPlugin() in cfcUnit creates error with coldbox controller (coldspring)
Thread: Using getPlugin() in cfcUnit creates error with coldbox controller (coldspring)
Forum: Need Help?
User: prentice Hi Luis,
I played around with it, but could not get it to work. So instead,
I've attached a sample app to show you what I mean.
For the sample app, I
generated a new app using the ant build in the coldbox dist called TestApp.
Then I added a TestModel.cfc in the /model/ directory as a test. I created a
method as a test, then a getter/setter for coldspring to pass in references to
the coldbox controller.
After this, I created the coldspring.xml.cfm to
have three declarations needed to pass in the coldbox controller to my
<ref bean="ColdBoxController" />
<!-- coldbox controller -->
<bean id="ColdBoxController" factory-bean="ColdBoxFactory"
I then modified the
general.dspHome event to get TestModel from the ioc plugin to make sure
everything's working properly:
access="public" returntype="void" output="false">
<!--- Do Your Logic Here to
prepare a view --->
<cfset Event.setValue("welcomeMessage","Welcome to
<!--- Set the View To Display,
after Logic --->
When all this is done, I ran the unit test in the unittests/ directory (which is
the same as what coldbox generates for me, except I moved it out of /handlers/),
and that's when I get the same error as before.
I am very confused as to what
causes this error. If I remove all references to the coldbox controller in the
coldspring config, or if I don't use it at all (as in no reference to it in the
coldspring config), I don't get any errors. The moment I do, the error popups
during the unit test.