This week's book giveaway is in the Design forum.
We're giving away four copies of Design for the Mind and have Victor S. Yocco on-line!
See this thread for details.
Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Small SQL databases for JUNIT tests

 
Sajid Insaf
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have some JDBC code for SQL databases and have written JUNIT tests for it. The tests are run through ant.
The requirement is to have a small database that can form part of the test suite and be stored in the version control software's database so that when deployed the tests can be run automatically without having to access an external database.
I have explored the option of using mock objects and require a real database so that protocol/driver issues can be tested.
Does anyone know of a free database that can be used for this?
 
Tina Coleman
Ranch Hand
Posts: 150
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
To test your driver, wouldn't you need a database that uses the same driver as whatever it is you're using as your application's database? There are several free databases out there, but I think your driver concern would be the big factor in determining which to use. Go out to Sun's site and look up your JDBC driver to see what other databases it may support - then use one of those. JDBC Drivers
 
Sajid Insaf
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Tina,
Thanks for the reply and sorry about using confusing language while specfying my requirement. I have not developed a driver. I have just written some java code that uses standard SQL statements to query databases that support SQL. So I need to test this piece of code using such a database.
I have found the HSQL database from http://hsqldb.sourceforge.net which I think should serve the purpose.
Thanks again.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic