| Issue 107: | Call to <cfthread> inside a unit test causes an extra unit test for the code inside the thread | |
| Back to list |
Run this code as a unit test: <cfcomponent output="false" extends="mxunit.framework.TestCase"> <cffunction name="thread_10Factorial"> <cfset var i = ""> <cfset results = structnew()> <cfset assertTrue(true,"sanity check failed")> <cfloop from="1" to="10" index="i"> <cfthread action="run" name="#i#" threadID="#i#"> <cfset thread.result = 1> <cfloop from="1" to="10" index="thread.j"> <cfset thread.result = thread.result * thread.j> </cfloop> <cfset results[attributes.threadID] = thread.result> </cfthread> </cfloop> <cfloop from="1" to="10" index="i"> <cfthread action="join" name="#i#"/> <cfset assertEquals(results[i],3628800,"Did not compute 10!")> </cfloop> </cffunction> </cfcomponent> Notice how in the test runner it shows up with the functions thread_10Factorial (correct) but also an extra unit test (_cffunccfthread_cftest_cftest2ecfc15831184081) for the thread. Not sure what version I'm using, I downloaded this last week. Eclipse plugin org.mxunit.eclipseplugin.feature_0.0.9.200803211142
Apr 24, 2008
Project Member
#1
marc.es...@gmail.com
Status:
Duplicate
|