I've struggled with this too, while (I think) tests that I hit the db aren't
technically unit test, they still need to be done.

I've never used dbUnit but it looks like the best option.

Another option that I've heard being used is to have a test database with
scripts to put it into a known state (like manual dbUnit I guess).

I've also heard of using cftransaction with a rollback, which seems like the
easiest of these options, but I'm not 100% sure how you'd verify results and
then do the rollback.

I'd be interested it what anyone else does as well...

On Jan 17, 2008 11:46 AM, Dan Skaggs < [EMAIL PROTECTED]> wrote:

> I have a question for those of you out there using cfcUnit. Do you
> normally write tests for all your CRUD and gateway methods (especially those
> you might have generated from the ColdFusion Wizards in Eclipse)?  I'm torn
> on whether to or not for a couple of reasons:
>
> 1. I think I should because it makes your test suites that much more
> complete
> 2. I think maybe I could get by without it because the code was generated
> from the database via the CF Wizard
> 3. I think having those tests might be a good way to quickly identify
> problems with my code if someone changes the database schema
> 4. I'm not exactly sure how to realiably run the tests against dynamic
> data. I was thinking the only way to do this part would be to use dbUnit or
> something similar to set the database back to a known backup point before
> running the tests.
>
> Any thoughts from you cfcUnit gurus out there.
>
> Thanks
> Dan
>
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;160198600;22374440;w

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:296816
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4

Reply via email to