DbFit 0.93: Storing and Comparing Queries

DbFit 0.93 has just been released. Pick it up from SourceForge.

New and noteworthy

  • Storing query results into fixture symbols
  • Comparing queries stored into symbols
  • SQL Server support for GUID and SQL_Variant types (variant is treated like a string)
  • .NET version updated to use FitNesse.Net 1.3
  • Loading connection settings from a text file on server

Storing and comparing queries

DbFit 0.93 allows you to store a query result for later and then compare it to another query result. All database integrations for both .NET and Java support storing queries directly into fixture symbols (global variables) with the following syntax:

|Store query|select ....|symbolname|

after this, the query results in detached form (DataTable class) are stored into the fixture symbol symbolname. You can use it later to compare against another dynamically loaded query:

|Compare stored queries|symbol1|symbol2|
|col1|col2|col3|

The query structure must be listed in the second row. Use InspectQuery to build it quickly if you do not want to type it. Column structure is specified so that some columns can be ignored during comparison (just don’t list them), and for the partial row-key mapping to work (put a question mark after the column names that do not belong to the primary key). The comparison will print out all matching rows in green, and list rows that are in just one query with red (and fail the test if such rows exist).

Loading connection properties from a file

Use Connect Using File instead of Connect if you want to keep connection properties stored in a file. Specify the file path, either absolute or relative to run.bat, as the argument. For connection file example, see TestDBConnection.properties. Here is an example how to use it:

!|dbfit.OracleTest|

|Connect using file|testdbconnection.properties|
Tags: