• 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

dbunit

 
Ranch Hand
Posts: 79
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Once I've managed to populate a database with data from an xml file using dbunit and run a test, how is it then possible to use dbunit to modify the data so that I can run another test? I don't want to use jdbc and it would be good if I could change the data without reading in another xml file.
Thanks.
 
author
Posts: 11962
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The whole idea of dbUnit is that before each test, dbUnit puts your database in the same, known state so that your tests stay independent. The data in your database is part of your test fixture. If you have two test cases that each require a different fixture, you should split those two tests into two separate test classes, and so forth.
 
Lasse Koskela
author
Posts: 11962
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Coming back to this... You might consider driving the database-connected tests from an Ant script and use the DbUnit Ant task to set up the database in a known state before/after certain sets of JUnit tests.
 
reply
    Bookmark Topic Watch Topic
  • New Topic