Issue 107: Call to <cfthread> inside a unit test causes an extra unit test for the code inside the thread
Status:  Duplicate
Owner: ----
Closed:  Apr 2008
Reported by ken.syk...@gmail.com, Apr 23, 2008
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
 
screenshot.jpg
37.8 KB   View   Download
Apr 24, 2008
Project Member #1 marc.es...@gmail.com
whooops. didn't see this before i added the same bug.

regardless, it's now fixed in SVN!

Great bug, ken. Thanks!
Status: Duplicate