db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbre...@brekke.org (Jeffrey D. Brekke)
Subject Re: unit testing code using torque
Date Fri, 15 Aug 2003 04:43:02 GMT

We've done that using inner classes to prevent save() from actually
doing something to the db.  Generally we don't *test* torque generated
classes straight out.  But we do write some tests that need the om
objects as fixtures or when we add behavior to them.

I haven't been tracking torque lately, but there was talk of
generating interfaces for all om objects, this way the underlying
implementation could be changed out since you would code to the
interface.  This would also allow you to mock ( via
mockobject,easymock,etc ) the generated om interfaces which would be
pretty nice for testing.  Not sure if that is possible yet with torque
though.

The other thing is to just blaze up Torque standalone and let it hit a
testing database server.  We do this also, but actually going through
the db for all tests will be slow.  I'm trying to only do that for a
*few* tests.

>>>>> On Thu, 14 Aug 2003 22:05:43 -0600 (MDT), Gary Shea <shea@gtsdesign.com>
said:

> I'm wondering what kind of solutions folks have come up with for
> unit testing code that uses Torque?  I'm just starting to think
> about it and have some vague notion of subclassing Torque objects to
> prevent real db stuff from happening...

>         Gary

> ---------------------------------------------------------------------
> To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org For
> additional commands, e-mail: torque-user-help@db.apache.org

-- 
=====================================================================
Jeffrey D. Brekke                                   jbrekke@wi.rr.com
Wisconsin,  USA                                     brekke@apache.org
                                                    ekkerbj@yahoo.com


---------------------------------------------------------------------
To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
For additional commands, e-mail: torque-user-help@db.apache.org


Mime
View raw message