ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From John Volkar <>
Subject RE: Task design question
Date Wed, 09 Jan 2002 16:37:49 GMT
You know, this is actually a tricky situation.  In my experience it's not
possible to get enought tests written (enough code coverage) just with mock
objects, you really need a significant set of finely crafted sample data
that has many variations.

Also, having developers share a database has never seemed to work for us
either. Each developer needs his own database.  Or else we fight!

The pattern we use is for each developer to be given a database userid, and
each of those id's is given thier own set of (empty) tables.  We then setup
another id and set of tables to hold the test data.  Finally we have a set
of scripts that drop the constriants from a developers table set, delete all
records, then blindly load all records from the test data tables in a one to
one fashion, then reestablish the constraints.  This works and is ugly as
hell, but its relaible.  We have issues with certain database vendors
command line utilities for doing this sort of thing when BLOB and CLOB
fields are in the tables, (Informix & Oracle) seem to have less than
spectacular command line tools for this sort of thing.

We've actually considered doing all the above work thru a java JDBC based
program, but were afraid it would be slow.  In answer to one of your
original points, it would be the most portable though.  

Write it!  I'll use it.

JOhn Volkar

-----Original Message-----
From: Jim Cheesman []
Sent: Wednesday, January 09, 2002 11:36 AM
To: Ant Users List
Subject: Re: Task design question

At 04:57 PM 09/01/02, you wrote:
>I'm thinking of writing a new task, and would like some input on the 
>design.  The task would wrap Sybase BCP in order to copy controlled test 
>data into a database table, while preserving the data that was in the 
>table to be restored later.  This way, multiple developers can share a 
>single development database without so much headache during testing.
>Does anyone else have a use for something like this?  I'm basically 
>planning to use it as an adjunct to Junit tests.  BCP is a Sybase utility, 
>and i don't know what equivalents there are for Oracle and what not - if 
>it can be done in a cross-platform manner, i should be thinking of that, 
>and not getting too proprietary.

Can't you use mock objects to simulate the database for testing? While it's 
not exactly the same, I'm not sure how reliable this writing to and sharing 
of a database would be.

That said, I don't think it would be too difficult to do.


                           *   Jim Cheesman   *
             Trabajo: - (34)(91) 724 9200 x 2360
               If a pig loses its 
voice is it disgruntled?

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message