Often, your build.xml file will use the default HttpAntRunner.cfc inside of the mxunit package:
However, it's possible that your tests need to be run under the context of your application. This is certainly true if you're using CF's built-in ORM functionality. It's also true if your tests or the code under test access application-scoped variables. Finally, this is probably true if you're testing controllers in a framework such as ColdBox.
Fortunately, you can solve this in two simple steps:
- Create a custom HttpAntRunner.cfc and put it in your application. Perhaps it's at c:/apps/MyBadassApp/tests/HttpAntRunner.cfc
- In your ANT file, point your mxunit defaultRunner to this new CFC
|I do this for every application I create|