ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kris Jenkins <krisajenk...@yahoo.co.uk>
Subject Re: script runner with junit
Date Thu, 13 Jan 2005 16:21:12 GMT
Nathan Maves wrote:

> Team,
>
> Kind of an OT question but here goes.
>
> Consider the example of a student.  I have a Dao that handles the 
> select/insert/update/delete ( and many others) of a Student.  I my 
> junit test case I want to use the ibatis script runner to test these 
> methods.  At first thought I figured that I would put the 
> initialization code in the setup() method and the cleanup in the 
> tearDown().  Problem here it that these method get called for every 
> test.  So I end up setting up and cleaning the database for every test.
>
> Is there a better way to do this?  Any examples?
>
> Nathan

Have you considered dbunit?  I've found it pretty easy to work with 
(providing you've got a test database you can happily trash!)

Here are a couple of good links:

http://dbunit.sourceforge.net/
http://www.onjava.com/pub/a/onjava/2004/01/21/dbunit.html

Kris


-- 
Kris Jenkins
Email:  kris@jenkster.com
Blog:   http://cafe.jenkster.com/
Wiki:   http://wiki.jenkster.com/



-- 
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.300 / Virus Database: 265.6.11 - Release Date: 12/01/2005


Mime
View raw message