Although I haven't got the DRK or seen the code for CFUnit, what I
gather from Christian's article is that the CFUnit "framework" is merely
just one single CFC!! i.e. it is vastly simplified compared with JUnit.

Again, this is mostly guess work but it probably goes something like
this:

A singe CFC called TestCase.cfc containing a method run(). 

This run method implements the Template Method design pattern i.e. it
calls some other private methods like setUp() and teardown() etc. 

At some point during the proceedings CFC metadata is used to introspect
the CFC for all methods beginning with "test". These test methods are
called one by one.

Inside of each of the test methods you invoke the CFC you are testing
and subsequently invoke some "assertion" methods (which are defined in
the base TestCase.cfc). These assertion methods are presumably fairly
trivial and comprise of things like assertEquals, assertTrue etc.
Obviously you can add your own assert methods to the base class as
needed.

Again, I'm guessing but I think all these assert methods do is output an
HTML table row with the results of the assertion.

I could be way off because as I said I haven't seen the implementation
of CFUnit but I think that's pretty much it i.e. ONE CFC! And no where
near as complex as JUnit.

On your point about having an "equals" method: This would be feasible if
the CFC you were testing implemented and "equals" method which was able
to tell whether it was equal to another CFC by way of comparing instance
variables/object state etc. i.e. it would require a custom
implementation of an equals() method for every CFC that you built - just
as you would have to do in Java (using the default implementation of
equals() defined in the Object base class that everything extends
USUALLY doesn't provide the results you are after)

André


-----Original Message-----
From: webguy [mailto:[EMAIL PROTECTED] 
Sent: 03 July 2003 18:06
To: CF-Talk
Subject: RE: CFUnit

> It can quite easily be transferred to CFC.

I started down this road but found several barriers to replicating junit
in
CFMX for testing cfcs. when is "object a" equal to "object b" for
example.
If anyone has replicated the example in the Junit example (called test
infected I think? ) in cf I'd love to see it.

testing custom tags, I guess would be easier as you can look for the
output
your are expecting.
What can you do/test with the DRK CFunit?

> Unfortunately, there are some of us that can't afford the DRKs!!

Well I'd prefer an ipod.

WG


-----Original Message-----
From: Andre Mohamed [mailto:[EMAIL PROTECTED]
Sent: 03 July 2003 17:48
To: CF-Talk
Subject: RE: CFUnit


I'm hoping it will be released separately....or continue writing my own
version. It's not hard to do and have already developed a version for
unit testing custom tags. See the links I just posted to see how you
could implement your own (even more comprehensive) version.

Unfortunately, there are some of us that can't afford the DRKs!!


André
-----Original Message-----
From: webguy [mailto:[EMAIL PROTECTED]
Sent: 03 July 2003 17:49
To: CF-Talk
Subject: RE: CFUnit

Anyway to get this without the drk ?

-----Original Message-----
From: Raymond Camden [mailto:[EMAIL PROTECTED]
Sent: 03 July 2003 17:33
To: CF-Talk
Subject: RE: CFUnit


Christian Cantrall. And it rocks. I _love_ the unit tester (and even
added some more stuff to it).

========================================================================
===
Raymond Camden, ColdFusion Jedi Master for Mindseye, Inc
(www.mindseye.com)
Member of Team Macromedia (http://www.macromedia.com/go/teammacromedia)

Email    : [EMAIL PROTECTED]
Blog     : www.camdenfamily.com/morpheus/blog
Yahoo IM : morpheus

"My ally is the Force, and a powerful ally it is." - Yoda

> -----Original Message-----
> From: Robertson-Ravo, Neil (RX)
> [mailto:[EMAIL PROTECTED]
> Sent: Thursday, July 03, 2003 10:30 AM
> To: CF-Talk
> Subject: CFUnit
>
>
> Anyone got any ideas who came up with the CFUnit stuff on the
> DRK3?





~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq

Get the mailserver that powers this list at 
http://www.coolfusion.com

                                Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
                                

Reply via email to