Dashboard > DbFixture > Home
Home Log In View a printable version of the current page.

Added by Barrow Kwan , last edited by Michael on Sep 06, 2007  (view change)
Labels: 
(None)

DbFixture Project Information

The idea of DbFixture came out of two projects that we have worked on, both of which involve building our own data access layer for special reason. After the end of the second project, we put together the requirement and wrote this library.

Goal

The goal of DbFixture is to make databane testing easy. Ideally you would want to have a O/R mapping framework doing all the database access for you. However this is not a perfect world, for various reasons from non-standard legacy database to verifying a potential defect in the framework, it is desirable to be able to test it in an easy way. DbFixture achieve that in the following aspect:

  • Proxy SQL driver that will set up the database automatically upon the first connection, based on the registered schema. In this way, your production code will not be changed as long as the jdbc connection properties (JDBC URL, user name, password) are not hard-coded (which is a good design anyway).
  • Helper classes to assist retrieving row from the table. This is done in a generic way so that the test can be done against any database connection. All SQLException 's are being wrapped in SqlRuntimeException so that your test code doesn't have to deal with them.
  • Helper classes to assis setting up database by generate insert SQL statement based on the object instance argement using reflection.
  • For project that uses database specific SQL (not that we recommend it), a pluggable sql converter to convert them into something that HSQL understands so that you don't have to change your code.
  • Resource Monitoring: Through the SQL proxy driver, it can monitor all the resourcs (Statement and ResoultSet) so that it can verify that they are all closed.
  • Resource Managing: All resources that was allocated in  for assertions can be closed automatically.

GForge Project Page

GForge opensource server is one of the ThoughtWorks' Public Services

http://gforge.public.thoughtworks.org/projects/dbfixture/

Download

This project is still in development and has not made any release. You can post in the resume writing services forum to request one, or build it yourself using Maven2.

Alpha release for preview: dbfixture-alpha.zip

Tutorial

  1. One Minute Tutorial
  2. Test-Driven Development Using Hibernate
  3. Test-Driven Development Using iBatis

Document translation

  • Design: A Overall Design review is still under construction.
  • [Schema Setup]
  • [Data Assertions]

Repository

Type of Access Information
Anonymous Access svn://scm.public.thoughtworks.org/dbfixture
Developer Access svn+ssh://scm.public.thoughtworks.org/export/groups/svn/repos/dbfixture
Web Access http://scm.public.thoughtworks.org/svn/?root=dbfixture

Help and Feeback

Please use custom term paper, or post in the project forum.

Powered by a free Atlassian Confluence Open Source Project / Non-profit License granted to ThoughtWorks, Inc.. Evaluate Confluence today.
Powered by Atlassian Confluence 2.7.1, the Enterprise Wiki. Bug/feature request - Atlassian news - Contact administrators