Pawan
Pawan

Reputation: 179

how to prevent dbunit from generating database.script file when executing unit tests

I am writing unit tests using DBUnit to test DAO layer of my project. It usesJDBC to connect to the database.

I am using in memory database HQLDB with DBUnit.

Every time I execute my tests, I notice database.log, datbase.properties and database.script being generated.

How can I prevent DBUnit from generating these files?

Upvotes: 0

Views: 33

Answers (1)

Jeff
Jeff

Reputation: 953

dbUnit does not generate those files.

Databases such as HSQLDB, H2, and Derby create them for persisting the data changes.

Usually there is a switch to start them in "in-memory" mode only so they don't create those files, usually in the database connection URL. Here is the info for doing so with HSQLDB: http://hsqldb.org/doc/guide/ch01.html#N101CA

(It's the "Memory-Only Databases" section on the http://hsqldb.org/doc/guide/ch01.html page)

Upvotes: 1

Related Questions