Previous page: Installing DbFit Next page: Managing Wiki content Parent page: Database unit tests

Hello World from the database

Let's run a quick test to make sure that you have everything set up correctly and that FitNesse can connect to your test database. In doing so, we'll also explain how to manage tests with FitNesse. FitNesse is a collaborative Wiki site for building and executing tests. Tests are described by tables that contain both input values and expected results. FitNesse runs tests by reading HTML files, looking for tables, and using data in the tables to execute tests and compare results to expectations. To keep things simple for now, we'll just run a query and verify the results.

Step 1: Creating a new test page

Step 2: Setting up the environment

Step 3: Connect to the database

Step 4: Testing a simple query

Step 5: Running the test

Traffic lights

A note on transaction management

To make tests automatically repeatable, DbFit executes each test in a separate transaction, and rolls back on the end of the test. You can commit or rollback manually as well if you want to persist the effects of a test (this will be explained in Command reference). Note, however, that it is a very good practice to make tests repeatable. If you intend to persist anything, make sure that unique constraints do not prevent the test from repeating.

Previous page: Installing DbFit Next page: Managing Wiki content Parent page: Database unit tests


Personal Tools