Brief introduction into DbUnit Express, Q3/2011


Published on

Introduction into DbUnit Express, a thin wrapper for DbUnit adding convention over configuration, easier configuration, better support for Spring JDBC, and couple of highly useful utilities such as RowComparator.


Published in: Spiritual, Technology
  • Be the first to comment

  • Be the first to like this

Brief introduction into DbUnit Express, Q3/2011

  1. 1. DbUnit Express
  2. 2. Unit test for DAO in 10 min Painless DB testing ©
  3. 3. Show time
  4. 4. Advantages over bare DbUnit <ul><li>Convention over configuration </li><ul><li>Pre-set for embedded Derby
  5. 5. location of .ddl & data .xml </li></ul><li>Battle-hardened configuration ( verbose xml, schema )
  6. 6. Better error reporting
  7. 7. Utilities </li><ul><li>Db.Creator, RowComparator, getDataSource, ... </li></ul></ul>
  8. 8. Questions answers
  9. 9. Advanced features <ul><li>Own dataset XML for each test
  10. 10. RowComparator
  11. 11. Access to the underlying DB </li><ul><li>in a test: DataSource, Connection, DbUnit Con.
  12. 12. after: review post-test state in Derby </li></ul><li>Database modification at runtime </li><ul><li>.replaceDatabase, .clearTable </li></ul><li> </li><ul><li>custom db (driver, url, user, psw) </li></ul></ul>
  13. 13. Thank you!