c0nnexx10n : C0nnect1ng L1fe w1th Techn010gy

Byte by Byte Impressions on Technology, People and Process !

Archive for the ‘dbunit’ Category

DBUNIT : Extracting Test Data into XML file

Posted by Vikas Hazrati on Monday, July 30, 2007

Many times you need sample data to be used as the set up data for your test cases. An easy way to extract data from a database into an XML file is as follows
The code sample below is mentioned for Postgres database however can be used for any database.

Read the rest of this entry »

Posted in dbunit, testing | 4 Comments »

DBUNIT, HSQLDB, data type (16, ‘BOOLEAN’) not recognized and will be ignored. See FAQ for more information.

Posted by Vikas Hazrati on Sunday, July 29, 2007

We are using HSQLDB (1.8.0.1) as the in memory database for our DBUNIT (2.1) test cases. Suddenly when trying to insert from our XML datafile to a boolean field we started getting an error which said

WARNING – APP_USER.ACCOUNT_EXPIRED data type (16, ‘BOOLEAN’) not recognized and will be ignored. See FAQ for more information.

It looks like the SQL type Types.BOOLEAN is not handled correctly. The way around is that

  • Create a new data type factory that extends the DBUnit class DefaultDataTypeFactory like this

Read the rest of this entry »

Posted in dbunit, hsqldb, testing | 3 Comments »