Test decorator that cleans a database on setUp and
tearDown to provide a test with a consistent empty
database as a starting point.
Tests can extend to provide a decorator that defines
some schema items and then have CleanDatabaseTestSetup
automatically clean them up by implementing the decorateSQL method..
As an example:
return new CleanDatabaseTestSetup(suite) {
protected void decorateSQL(Statement s) throws SQLException {
s.execute("CREATE TABLE T (I INT)");
s.execute("CREATE INDEX TI ON T(I)")
}
};
|