I did a couple related blog posts a while ago at
http://blog.liquibase.org/2007/06/building-database-tests-that-dont-brea
k.html.

 

I have always used liquibase both liquibase and mysqldump for managing
my test datasets, and both work well.  Keeping it all in liquibase
changelogs makes it easy to create different "contexts" in which
different datasets are loaded.  As your database gets larger and more
complex, however, it becomes much easier to manage your database with
your application and make backups from time to time to use as your
testing dataset.  

 

The reason we use an XML format is primarily because you get
intellisense support in your IDE from the XML schema.  You do get
database independence, but you would get that with any sort of DSL
description of your changes.

 

Nathan

 

 

From: Sven Haiges [mailto:sven.hai...@googlemail.com] 
Sent: Thursday, May 28, 2009 1:02 PM
To: liquibase-user@lists.sourceforge.net
Subject: [Liquibase-user] Test Data using liquibase?

 

Hi all,

I am investigating which tool to use to create exact database snapshots
that are loaded into a database befpre some JUnit tests are run. The
goal is to have the exact same data present for each test run. 

So I read on the liquibase homepage that I can create test datasets. I
also know about DBUnit, which also exports a snapshot to a xml file.
Maybe someone can explain what he thinks is the best way of doing these
things. We have a MySQL database and the DB including data is not very
big. 

- Why not use mysqldump one the test data has been created and import
the db before each test run? Isn't that the easiest solution?
- Why does both DBUnit and Liquibse save the dataset as XML. It is meant
to be database-agnostic, but we won't change our DB (and I doubt hardly
one does) in the foreseeable future. Woudl it mean doing an dump is
really the best option or am I a forgetting an important point?

Cheers
Sven

-- 
Sven Haiges
sven.hai...@googlemail.com

Yahoo Messenger / Skype: hansamann
Personal Homepage, Wiki & Blog: http://www.svenhaiges.de

Subscribe to the Grails Podcast:
http://feeds.grailspodcast.com/grailspodcast
http://www.grailspodcast.com

------------------------------------------------------------------------------
Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT 
is a gathering of tech-side developers & brand creativity professionals. Meet
the minds behind Google Creative Lab, Visual Complexity, Processing, & 
iPhoneDevCamp as they present alongside digital heavyweights like Barbarian 
Group, R/GA, & Big Spaceship. http://p.sf.net/sfu/creativitycat-com 
_______________________________________________
Liquibase-user mailing list
Liquibase-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/liquibase-user

Reply via email to