Hey all,
I am about to give up on unit testing within coldbox, it just seems
impossible to set up. first, have another post that states I can't get
the mxunit plugin for builder or eclipse to work. So, running tests in
browser.
we are using coldbox 2.6.3...
my test folder is this:
test
--integration
--mocks
--resources
--remotefacade.cfc
--unit
application.cfc
i put my mxunit folder inside my webroot folder which has all my
coldbox code. I have my site setup in builder to reference the
remotefacade inside the resources folder, and the main preferences for
mxunit i have referencing the mxunit/framework/remotefacade.cfc file.
in the system folder i have either under the extras folder the testing
stuff, or I added a testing folder under system with
baseHandlerTest.cfc and other .cfc files in it.
No matter what I try with my tests, they do not run...no matter which
extends I use, i am always getting some error, weather it is some
application variable error, or getSetting error. None of these errors
are part of my test, they are on one of the baseTest files or
somethings.
test url for firefox: http://localhost/test/integration/MainTest.cfc?method=testonAppInit
<!---<cfcomponent extends="coldbox.system.testing.BaseTestCase">
<cfcomponent extends="coldbox.system.extras.testing.BaseMXUnitTest">---
<cfcomponent extends="coldbox.system.testing.BaseHandlerTest">
<cffunction name="setUp" returntype="void" output="false">
<cfscript>
// Call the super setup method to setup the app.
super.setup();
// Any preparation work will go here for this test.
</cfscript>
</cffunction>
<cffunction name="testonAppInit" returntype="void" output="false"
access="remote">
<cfscript>
var event = "";
//Place any variables on the form or URL scope to test the handler.
//URL.name = "luis"
event = execute("main.onAppInit");
//Do your asserts below
</cfscript>
</cffunction>
I know mxUnit is pretty simple when it is run on just components, but
it seems crazy hard within coldbox...can anyone give me good
directions for setting up my tests in coldbox 2.6.3, they help docs
just don't seem to be helping me enough...plus i can't seem to
understand how my test folder will run headlessly and how to use the
application.cfc in the test folder to maybe set application level
variables if I can....
thanks
Dan