Skip to content

Category Archives: Hsqldb

Automated Unit Testing with DBUnit, Hsqldb in Spring & Hibernate projects

If your project has a lot of unit testing in Java and you use continuous builds (CruiseControl) to automate, it is often difficult to automate tests which connect to Database (Dao and integration tests). For most companies, having a dedicated Oracle schema for testing is expensive. Also, sometimes, developers need their own instances of schemas [...]

HSQLDB Integration Into Spring Security

Adding a database back end to Spring Security seems deceptively simple. And to be fair, there are several ways to do it. The way I had in mind looked like a shortcut. In my application there is basically one table for all users. It contains the values I need for username, password, role, and the [...]

Hibernate HSQLDB Sequences for Unit Testing

Sequences in HSQLDB are a little odd. The syntax isn’t unusual: CREATE SEQUENCE <sequencename> [AS {INTEGER | BIGINT}] [START WITH <startvalue>] [INCREMENT BY <incrementvalue>]; But what happens is a little unexpected. HSQLDB generates a SQL select statement to retrieve the nextval for the sequence. For example, something like this: CREATE SEQUENCE MY_TABLE_SEQ AS INTEGER START [...]

Java Integration Testing with HSQLDB

I’m a fairly recent convert to unit testing, but still when I’m under pressure to get something finished, I skip right to integration tests. Despite the guilt I still use the junit framework for these integration tests… I know the unit testing purists will be rolling their eyes at this point, but this is something [...]

Testing JdbcTemplates with HSQLDB

I’m writing an application that’s going to perform some serious data munging with a database. The schema has been defined (mostly) but there’s no data I can use to test. For a short period of time I added my own data to the dev db server, but I found that it’s not reliable enough. It [...]