On Nov 23, 2:38 pm, Mark Mandel <[email protected]> wrote: > > How would you suggest handling this? Some kind of generic teardown? > > Sounds good to me :D
Working like this (based on http://www.mail-archive.com/[email protected]/msg00730.html): <cffunction name="setUp" returntype="void" access="public"> <cfscript> variables.beanFactory = createObject("component", "coldspring.beans.DefaultXmlBeanFactory").init(); variables.beanFactory.loadBeansFromXmlFile("/setup/coldspring.xml", true); variables.transferFactory = variables.beanFactory.getBean ("ormService"); variables.transferFactory.getTransaction().advise(this, "^test"); </cfscript> </cffunction> <cffunction name="tearDown" output="false" access="public" returntype="any" hint=""> <!--- shutdown transfer cache ---> <cfset variables.transferFactory.getTransfer().discardAll() /> <cfset variables.transferFactory.shutdown() /> </cffunction> <cffunction name="testPrepareEventThingy" output="false" access="public" returntype="void"> ... ... ... <cftransaction action="rollback" /> </cffunction> The only bummer to this approach is putting the rollback at the bottom of every single test function. Is there a way to make the advice run a function with the rollback automatically when it completes? Thanks! 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
