Skip to main content


developerWorks  >  Open source | Information Management  >

Isolated unit testing of persistence with Derby

developerWorks

Level: Intermediate

Guy Davis (davis@guydavis.ca), Development Team Lead, Intervera Data Solutions

11 Oct 2005

Register now or sign in using your IBM ID and password.

Get help developing your database-driven unit-testing skills. Without isolation and automation, database-driven unit tests can become a maintenance nightmare of sporadic failures and bad test data. The open source Apache Derby database is ideal for completely automating and isolating unit tests, because it offers fast, in-process performance and zero administration. This tutorial gives you step-by-step examples on using Derby to write effective and maintainable unit tests that improve the quality of your application.

In this tutorial

  • Example project overview

  • Painless unit tests

  • Working with Derby

  • Overview of Java unit testing

  • Improvements and refactorings

Prerequisites

You need previous experience with the Java™ Database Connectivity (JDBC) API and the Eclipse IDE to complete this tutorial. Exposure to the JUnit and DbUnit test frameworks is helpful but not required -- the tutorial provides a brief overview of both before diving into test writing.


System requirements

This tutorial requires:

  • The Eclipse IDE (Version 3.0 or higher) to work with the sample project.
  • Apache Derby from the Apache Software Foundation.
  • The Sun Microsystems Java Development Kit (JDK) (Version 1.4.2 or higher) to run both Eclipse and the project unit tests.


Duration

Under two hours


Formats

html, pdf


Share this....

digg Digg this story del.icio.us del.icio.us Slashdot Slashdot it!


Back to top


Document options

Document options requiring JavaScript are not displayed


New site feature

Check out our new article design and features. Tell us what you think.