On Sep 12, 3:53 am, Scott Brady <[email protected]> wrote:
> This is what's in my onApplicationStart:
> <!--- Transfer initialization --->
> <cfset application.myTransferFactory =
> createObject("component","transfer.TransferFactory").init("/config/datasour
> ces/deployment.xml.cfm","/config/transfer/deployment.xml.cfm","/config/defi
> nitions")
> />
> <cfset application.myTransfer = application.myTransferFactory.getTransfer() />
>
> That could be part of the problem, but the unit tests all have their
> own Application.cfc (which does nothing, since unit tests shouldn't be
> relying on "application" code, right?)
Scott,
You're right in that you shouldn't be relying on the Application
scope. Try using MXUnit's setup() and teardown() methods so you have
a consistent environment for every test. Here's one from my unit
tests:
<cffunction name="setUp" returntype="void" access="public">
<cfscript>
variables.transferFactory = createObject("component",
"transfer.TransferFactory").init("/PUKKA_CORE_MAP/config/transfer/
datasource.xml",
"/PUKKA_CORE_MAP/config/transfer/
Transfer.xml",
"/PUKKA_API_MAP/model/data/transfer");
variables.transfer =
variables.transferFactory.getTransfer();
variables.testTime = now();
</cfscript>
</cffunction>
Then in your test* methods, you can use transfer.new(), transfer.get
(), etc.
Brian
--~--~---------~--~----~------------~-------~--~----~
Before posting questions to the group please read:
http://groups.google.com/group/transfer-dev/web/how-to-ask-support-questions-on-transfer
You received this message because you are subscribed to the Google Groups
"transfer-dev" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/transfer-dev?hl=en
-~----------~----~----~----~------~----~------~--~---