File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JDBC and the fly likes Small SQL databases for JUNIT tests Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Small SQL databases for JUNIT tests" Watch "Small SQL databases for JUNIT tests" New topic
Author

Small SQL databases for JUNIT tests

Sajid Insaf
Greenhorn

Joined: Nov 26, 2002
Posts: 5
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

Joined: Dec 12, 2001
Posts: 150
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

Joined: Nov 26, 2002
Posts: 5
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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Small SQL databases for JUNIT tests
 
Similar Threads
JUnit; is there a way to order tests?
cancelling junit tests?
What kind of methods and classes can i test with JUnit
System Tests
what I can do with junit ??