• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Wanted: Working Example of org.dbunit.operation.DatabaseOperation..CLEAN_INSERT.execute()

 
Ranch Hand
Posts: 428
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm cross posting this because I have not received a response from my 10 day old solicitation for help with dbunit at stackoverflow.

Can someone point me to a working example of org.dbunit.operation.DatabaseOperation..CLEAN_INSERT.execute()? I cannot get it work and I want to use this feature of DBUnit that clears an existing database and populates it from an XML file prior to running a junit-style test.

I'd love to see it work with mysql, or postgresql, or oracle 11 or mssql.

Thanks
Siegfried


 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
https://community.oracle.com/thread/1324895?start=0
 
Marshal
Posts: 79151
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You did appear to receive responses there. Please tell them that you have cross-posted here too. Please explain why their responses were not satisfactory; also what is 6RES? Do you have to write databaseName.tableName? Is that all the problem was?
 
Siegfried Heintze
Ranch Hand
Posts: 428
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks!
No I did not receive any other responses from cross posting.
Yes I am still interested in help.

The problem I am having is that I cannot make any examples of DBUnit (that demonstrate the CLEAN_INSERT feature) that I have found thru google searching work with SQL Server or Oracle or MySQL or PostgresSQL.
I suspect they only work with databases like H2 and HSQL which is kinda silly because you can start with a "clean slate" with those databases and there is no need to delete the old database tables.

The link posted above is a problem about a missing table using an ORM.

ORMs are good. However I need to test complex SQL queries without an ORM on multiple databases including MS SQL Server, Oracle, MySQL and PostgresSQL.

Since I could not make any of the examples implement the CLEAN_INSERT feature (to delete old tables), I began to wonder how it works. After digging into source code for several hours, I gave up. But it begs the question:

How would the author of DBUnit write database neutral code to enumerate all the non-system tables in a database and delete them without using database specific JPA providers? Can it be done?
Maybe not.
Maybe that is why it does not work.

Can you find an example of CLEAN_INSERT that works with MS SQL Server, Oracle, MySQL and PostgresSQL?

There are of course, examples of DBUnit that work (that I have found) but they don't use CLEAN_INSERT (which I thought was one of the great features of DBUnit! Why not just use JUnit instead if you are not going to clean up the tables?).
Can you find any that work with CLEAN_INSERT? On Oracle, MS SQL Server, MySQL and PostgresSQL?

Thanks
Siegfried
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic