From: Forsberg, M. <mik...@am...> - 2008-02-22 19:56:08
|
You may want to reference this list of DatabaseOperations... just remember for the DELETE_ALL you really only need the table names. http://www.dbunit.org/components.html#databaseoperation For a CLEAN_INSERT, the database tables are cleaned then your data is inserted. Since there is no data, then the insert is a no-op (MAYBE). If you want to delete all the data, then DELETE_ALL is the DatabaseOperation for you. -----Original Message----- From: dbu...@li... [mailto:dbu...@li...] On Behalf Of Davis Ford Sent: Friday, February 22, 2008 12:50 PM To: dbu...@li... Subject: Re: [dbunit-user] How to clear the db completely with dbunit Mike, good point, so if I have a table named SOME_TABLE, and I add an element, like this in the FlatXmlDataSet file: <SOME_TABLE/> DbUnit interprets that so on a CLEAN_INSERT, that table gets wiped out? Regards, Davis On Fri, Feb 22, 2008 at 1:30 PM, Forsberg, Mike <mik...@am...> wrote: > I ask you how would DBUnit know which tables to drop? If they are not > listed in the DataSet, then they are avoided. I think this is a great > security blanket. I don't want to delete tables other then the ones on > which I'm testing. > > You are aware that the DataSet does not need to have data in it. You > just have to specify the table names, maybe the table columns. If this > is provided then the DatabaseOperation will drop all rows of the listed > dataset. > > > > -----Original Message----- > From: dbu...@li... > [mailto:dbu...@li...] On Behalf Of Davis > Ford > Sent: Friday, February 22, 2008 11:34 AM > To: dbunit-user > Subject: [dbunit-user] How to clear the db completely with dbunit > > Hi, there does not seem to be a CLEAN or DELETE_ALL DatabaseOperation > that can just drop all rows. execute expects a DataSet. > > My problem is that in my test cases, I also insert rows, and at the > end of the test, I want the database cleaned out to avoid constraint > violations across different unit test cases. > > Is there a way to clean out the database w/o specifying a DataSet? > > Thanks in advance, > Davis > > ------------------------------------------------------------------------ > - > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2008. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > _______________________________________________ > dbunit-user mailing list > dbu...@li... > https://lists.sourceforge.net/lists/listinfo/dbunit-user > > > > > ------------------------------------------------------------------------ - > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2008. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > _______________________________________________ > dbunit-user mailing list > dbu...@li... > https://lists.sourceforge.net/lists/listinfo/dbunit-user > ------------------------------------------------------------------------ - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ dbunit-user mailing list dbu...@li... https://lists.sourceforge.net/lists/listinfo/dbunit-user |