Yes, I've done unit testing on my model components and all came through
fine.  But I'm doing some things like instantiating instances of some
components in the constructors of other components and then 'local scoping'
them within functions.  For example:

<cfcomponent>

        <!--- include a copy of the common cfc functions here --->
        <cfset common = createobject("component","common")>
        <cfset error = createobject("component","error")>
        <cfset transferBean = createobject("component","transferBean")><!---
this is a cfc used for moving return values between cfc's --->
        
        <cffunction name="myFunction">
                
                <cfset var transfer = transferBean>

                Function stuff...

        </cffunction>

</cfcomponent>

So, I instantiate an instance of transferBean once in the constructor, then
I scope it locally within the function, saving subsequent instantiations of
it (so I think).  Conceptually, I'm going for the 'a generic instance is
there in the cfc, just rip off a copy within the functions and go'.  It has
worked awesome during my development, but it's a bit hard to see if its
meeting the requirements for thread safety.  This is the first time I've
tried this, so I have no real world experience with its performance.

Still looking for some sort of approach or methodology that I can use to
test the thread safety.

Thanks,
Kevin


> -----Original Message-----
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] On Behalf Of Brian Kotek
> Sent: Wednesday, September 22, 2004 3:09 PM
> To: [EMAIL PROTECTED]
> Subject: RE: [CFCDev] Testing Thread Safety
> 
> 
> Unit testing is always a great idea, but I don't see how that 
> can test thread safety.  For example, how would a unit test 
> flag down a situation where you missed var scoping a variable 
> since these problems really only come out under load?  Is 
> load testing really the only way to be sure?
> 
> Maybe Sean has some pointers?
> 
> > -----Original Message-----
> > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
> Behalf
> > Of Wayne Graham
> > Sent: Wednesday, September 22, 2004 10:10 AM
> > To: [EMAIL PROTECTED]
> > Subject: Re: [CFCDev] Testing Thread Safety
> > 
> > Try some unit testing...there are a couple of good ports of xUnit to
> > ColdFusion:
> > 
> > http://www.cfcunit.org/ 
> http://sourceforge.net/projects/cftestingkit/
> > 
> > I like to find bugs and use xUnit tests to make sure they don't
> resurface
> > later in the project.
> > 
> > ----- Original Message -----
> > From: "Kevin J. Miller" <[EMAIL PROTECTED]>
> > To: <[EMAIL PROTECTED]>
> > Sent: Wednesday, September 22, 2004 12:55 AM
> > Subject: [CFCDev] Testing Thread Safety
> > 
> > 
> > > Hello,
> > >
> > > Does anyone know of or have a way of testing thread safety in 
> > > cfcs/functions?  I am reworking an application and my cfc's are 
> > > architecturally very different from what I've done before 
> (existing
> > fully
> > > within the app scope, a different approach to passing data between
> > cfc's,
> > > and some other things that bring the thread safety issue to a
> critical
> > > importance).  Was wondering if there was some approach other than
> simply
> > > reviewing the code or waiting until errors arise that would help
> test
> > the
> > > thread safety of the various functions.
> > >
> > > TIA
> > > Kevin
> > >
> > >
> > > ----------------------------------------------------------
> > > You are subscribed to cfcdev. To unsubscribe, send an email to 
> > > [EMAIL PROTECTED] with the words 'unsubscribe cfcdev' in the 
> > > message of the email.
> > >
> > > CFCDev is run by CFCZone (www.cfczone.org) and supported
> > > by Mindtool, Corporation (www.mindtool.com).
> > >
> > > An archive of the CFCDev list is available at
> > www.mail-archive.com/[EMAIL PROTECTED]
> > >
> > 
> > ----------------------------------------------------------
> > You are subscribed to cfcdev. To unsubscribe, send an email to 
> > [EMAIL PROTECTED] with the words 'unsubscribe cfcdev' in the 
> > message of the email.
> > 
> > CFCDev is run by CFCZone (www.cfczone.org) and supported
> > by Mindtool, Corporation (www.mindtool.com).
> > 
> > An archive of the CFCDev list is available at www.mail- 
> > archive.com/[EMAIL PROTECTED]
> 
> ----------------------------------------------------------
> You are subscribed to cfcdev. To unsubscribe, send an email
> to [EMAIL PROTECTED] with the words 'unsubscribe cfcdev' 
> in the message of the email.
> 
> CFCDev is run by CFCZone (www.cfczone.org) and supported
> by Mindtool, Corporation (www.mindtool.com).
> 
> An archive of the CFCDev list is available at 
> www.mail-archive.com/[EMAIL PROTECTED]
> 


----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email
to [EMAIL PROTECTED] with the words 'unsubscribe cfcdev' 
in the message of the email.

CFCDev is run by CFCZone (www.cfczone.org) and supported
by Mindtool, Corporation (www.mindtool.com).

An archive of the CFCDev list is available at www.mail-archive.com/[EMAIL PROTECTED]

Reply via email to