Skip navigation

DbAssert goes open-source

Some time ago I was working (in my spare time) on database testing tools. You could see posts about asserting data, putting the datastore to a known state and about mocking it up. I started working on it because I didn’t really like what dbUnit offered at that moment. I wanted my tests to be [...]

Database testing – putting everything together

Create – database instance is not necessary
Prepare – clean tables, load data to datasource
Assert – verify your datasource contains expected data

@Test
public void testGetCustomerFromDao()
{
//business dao object
final CustomerDao customerDao = new CustomerDao();

// initialize DbAssert
final DbAssert dbAssert = DbAssert.init(“org/testfw/TestSource.xml”);

// create a “fake” datasource. Stanalone instance of HSQLDB will be created (no database required).
final DbSource myTestSource = dbAssert.fake_source(“testSrc”,”org/testfw/testSourceSchema.sql”, getClass());

// [...]

Making assertions against database data

I want to share what I’ve done working on my current project to verify data in a database. The application we’re developing relying on SOAP messages exchange where the messages contain information to be written in datasource (DB2, MSSQL, Postgres, AS/400 etc.) Yeah we’re using them all.
You can consider this as a mappping SOAP(Business document) [...]