#chr(60)#cfcomponent name="#arguments.cfcData.cfcName#" hint=""#chr(62)# #chr(60)#cffunction name="init" access="public" output="false" hint="Constructor"#chr(62)# #chr(60)#cfreturn this /#chr(62)# #chr(60)#/cffunction#chr(62)# #chr(60)#cffunction name="#arguments.cfcData.methods[local.thisMethod]#" access="public" output="false" hint=""#chr(62)# #chr(60)#cfthrow type="#arguments.cfcData.cfcName#.unimplementedMethod" message="Method #arguments.cfcData.methods[local.thisMethod]#() in component #arguments.cfcData.cfcName# not implemented yet." /#chr(62)# #chr(60)#/cffunction#chr(62)# #chr(60)#/cfcomponent#chr(62)# #chr(60)#cfcomponent name="Test#arguments.cfcData.cfcName#" extends="#getFrameworkTestCasePath()#"#chr(62)# #chr(60)#cffunction name="setUp" access="public" output="false" hint=""#chr(62)# #chr(60)#cfset var local = StructNew() /#chr(62)# #chr(60)#cfset local.serviceDefinitionLocation = ExpandPath( '#getRelativePath()#/coldspring.xml' ) /#chr(62)# #chr(60)#cfset local.beanFactory = CreateObject('component', 'coldspring.beans.DefaultXmlBeanFactory').init() /#chr(62)# #chr(60)#cfset local.beanFactory.loadBeansFromXmlFile(local.serviceDefinitionLocation) /#chr(62)# #chr(60)#cfset set#arguments.cfcData.cfcName#(local.beanFactory.getBean('#arguments.cfcData.cfcName#')) /#chr(62)##chr(60)#cfset set#arguments.cfcData.cfcName#(CreateObject('component','#arguments.cfcData.cfcPath##arguments.cfcData.cfcName#').init()) /#chr(62)# #chr(60)#/cffunction#chr(62)# #chr(60)#cffunction name="test_#arguments.cfcData.methods[local.thisMethod]#" returntype="void" access="public" output="false" hint=""#chr(62)# #chr(60)#cfset var local = StructNew() /#chr(62)# #chr(60)#cfset fail('Test not yet implemented for method #arguments.cfcData.methods[local.thisMethod]#().') /#chr(62)# #chr(60)#/cffunction#chr(62)# #chr(60)#cffunction name="get#arguments.cfcData.cfcName#" access="private" output="false" hint="I return the #arguments.cfcData.cfcName#."#chr(62)# #chr(60)#cfreturn variables.instance.#arguments.cfcData.cfcName# /#chr(62)# #chr(60)#/cffunction#chr(62)# #chr(60)#cffunction name="set#arguments.cfcData.cfcName#" access="private" output="false" hint="I set the #arguments.cfcData.cfcName#."#chr(62)# #chr(60)#cfargument name="#arguments.cfcData.cfcName#" required="true" hint="#arguments.cfcData.cfcName#" /#chr(62)# #chr(60)#cfset variables.instance.#arguments.cfcData.cfcName# = arguments.#arguments.cfcData.cfcName# /#chr(62)# #chr(60)#/cffunction> #chr(60)#/cfcomponent#chr(62)# #chr(60)#cfcomponent name="Mock#arguments.cfcData.cfcName#" extends="#getCFCPath()#.#arguments.cfcData.cfcName#" hint="I am a Mock object that can be used to replace the #arguments.cfcData.cfcName# CFC when testing other components."#chr(62)# #chr(60)#cffunction name="init" access="public" output="false" hint="Constructor"#chr(62)# #chr(60)#cfreturn this /#chr(62)# #chr(60)#/cffunction#chr(62)# #chr(60)#cffunction name="#arguments.cfcData.methods[local.thisMethod]#" access="public" output="false" hint=""#chr(62)# #chr(60)#cfthrow type="Mock#arguments.cfcData.cfcName#.unimplementedMethod" message="Method #arguments.cfcData.methods[local.thisMethod]#() in component Mock#arguments.cfcData.cfcName# not implemented yet." /#chr(62)# #chr(60)#/cffunction#chr(62)# #chr(60)#/cfcomponent#chr(62)# #chr(60)#!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd"#chr(62)# #chr(60)#beans#chr(62)# #chr(60)#bean id="#variables.instance.cfcData[local.thisCFC].cfcName#" class="#local.cfcPath#.#variables.instance.cfcData[local.thisCFC].cfcName#" /#chr(62)# #chr(60)#bean id="Mock#variables.instance.cfcData[local.thisCFC].cfcName#" class="#local.cfcPath#.Mock#variables.instance.cfcData[local.thisCFC].cfcName#" /#chr(62)# #chr(60)#/beans#chr(62)# #chr(60)#cfset cfUnitRoot = "net.sourceforge.cfunit" /#chr(62)# #chr(60)#cfset tests = ArrayNew(1) /#chr(62)# #chr(60)#cfset ArrayAppend(tests, "#local.cfcPath#.Test#variables.instance.cfcData[local.thisCFC].cfcName#") /#chr(62)# #chr(60)#cfset testSuite = CreateObject("component", "#chr(35)#CFUnitRoot#chr(35)#.framework.TestSuite").init(tests) /#chr(62)# #chr(60)#h1#chr(62)#Test Results#chr(60)#/h1#chr(62)# #chr(60)#cfset testSuite = CreateObject("component", "#chr(35)#CFUnitRoot#chr(35)#.framework.TestRunner").run(testSuite, 'Test Suite') /#chr(62)# #chr(60)#cfcomponent displayname="AllTests" output="false"#chr(62)# #chr(60)#cffunction name="suite" returntype="org.cfcunit.framework.TestSuite" access="public" output="false"#chr(62)# #chr(60)#cfset var testSuite = CreateObject("component", "org.cfcunit.framework.TestSuite").init("Test Suite") /#chr(62)# #chr(60)#cfset testSuite.addTestSuite(CreateObject("component", "#local.cfcPath#.Test#variables.instance.cfcData[local.thisCFC].cfcName#")) /#chr(62)# #chr(60)#cfreturn testSuite/#chr(62)# #chr(60)#/cffunction#chr(62)# #chr(60)#/cfcomponent#chr(62)# #chr(60)#?xml version="1.0"?#chr(62)# #chr(60)#project name="CFUnit" default="allTests" basedir="."#chr(62)# #chr(60)#taskdef name="CFUnit" classname="net.sourceforge.cfunit.ant.CFUnit"/#chr(62)# #chr(60)#property name="domain" value="http://#getHostName()#/" /#chr(62)# #chr(60)#property name="path" value="#getRelativePath()#/" /#chr(62)# #chr(60)#target name="testgroup1"#chr(62)# #chr(60)#CFUnit testcase="${domain}${path}Test#variables.instance.cfcData[local.thisCFC].cfcName#.cfc" verbose="true" /#chr(62)# #chr(60)#/target#chr(62)# #chr(60)#!-- Use a comma-delimited list of target names to run multiple targets. --#chr(62)# #chr(60)#target name="allTests" depends="testgroup1" /#chr(62)# #chr(60)#/project#chr(62)# #chr(60)#?xml version="1.0"?#chr(62)# #chr(60)#project default="allTests" name="MyTest"#chr(62)# #chr(60)#property name="cfcUnitLib" value="C:\Inetpub\wwwroot\org\cfcunit\lib" /#chr(62)# #chr(60)#property name="hostname" value="#getHostName()#" /#chr(62)# #chr(60)#property name="path" value="#local.cfcpath#." /#chr(62)# #chr(60)#taskdef resource="org/cfcunit/ant/antlib.xml"#chr(62)# #chr(60)#classpath#chr(62)# #chr(60)#pathelement location="lib/ant-cfcunit.jar"/#chr(62)# #chr(60)#/classpath#chr(62)# #chr(60)#/taskdef#chr(62)# #chr(60)#target name="testgroup1"#chr(62)# #chr(60)#cfcunit verbose="true"#chr(62)# #chr(60)#service hostname="${hostname}"/#chr(62)# #chr(60)#testclass name="${path}AllTests" /#chr(62)# #chr(60)#/cfcunit#chr(62)# #chr(60)#/target> #chr(60)#!-- Use a comma-delimited list of target names to run multiple targets. --#chr(62)# #chr(60)#target name="allTests" depends="testgroup1" /#chr(62)# #chr(60)#/project#chr(62)#