delete a single table

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

delete a single table

Piotr Jagielski-3
Hello,

Is there a way to delete a contents of single table in DBUnit? I've
noticed that the DELETE_ALL part of CLEAN_INSERT DatabaseOperation works
only for the tables that have at least one row specified in my
FlatXmlDataSet. I'm trying to write a functional test for user
registration and I'd like to ensure I have no users in the database
before this test. What would be a simplest way to accomplish this in DBUnit?

Thanks,
Piotr

------------------------------------------------------------------------------
vRanger cuts backup time in half-while increasing security.
With the market-leading solution for virtual backup and recovery,
you get blazing-fast, flexible, and affordable data protection.
Download your free trial now.
http://p.sf.net/sfu/quest-d2dcopy1
_______________________________________________
dbunit-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/dbunit-user
Reply | Threaded
Open this post in threaded view
|

Re: delete a single table

Dominique Jean-Prost
Hello Piotr,

You can use the TRUNCATE operation that will fully empty your table, existing data or not.
Dom

-----Message d'origine-----
De : Piotr Jagielski [mailto:[hidden email]]
Envoyé : samedi 28 mai 2011 11:07
À : [hidden email]
Objet : [dbunit-user] delete a single table

Hello,

Is there a way to delete a contents of single table in DBUnit? I've
noticed that the DELETE_ALL part of CLEAN_INSERT DatabaseOperation works
only for the tables that have at least one row specified in my
FlatXmlDataSet. I'm trying to write a functional test for user
registration and I'd like to ensure I have no users in the database
before this test. What would be a simplest way to accomplish this in DBUnit?

Thanks,
Piotr

------------------------------------------------------------------------------
vRanger cuts backup time in half-while increasing security.
With the market-leading solution for virtual backup and recovery,
you get blazing-fast, flexible, and affordable data protection.
Download your free trial now.
http://p.sf.net/sfu/quest-d2dcopy1
_______________________________________________
dbunit-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/dbunit-user
Consultez nos nouveaux sites internet :
http://www.dexia-sofaxis.com 
http://www.dexia-sofcap-sofcah.com

Tous ensemble pour l’environnement : n’imprimer ce courriel que si nécessaire.

Dexia Sofaxis disclaimer : http://www.dexia-sofaxis.com/disclaimer.html
------------------------------------------------------------------------------
Simplify data backup and recovery for your virtual environment with vRanger.
Installation's a snap, and flexible recovery options mean your data is safe,
secure and there when you need it. Data protection magic?
Nope - It's vRanger. Get your free trial download today.
http://p.sf.net/sfu/quest-sfdev2dev
_______________________________________________
dbunit-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/dbunit-user