db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Adam Hardy <adam....@cyberspaceroad.org>
Subject dropping a schema, shutting down and restarting in unit test run
Date Sat, 05 Apr 2008 16:04:20 GMT
I have a simple requirement in my unit test run to run integration tests on my 
java application's persistence layer.

Each test must (1) create the schema, (2) insert the fresh test data, (3) run 
the test and (4) clean up and remove the database.

The tests are also run as a batch against Hypersonic, MySQL, Oracle and 
PostgreSQL, so to keep it simple and cross-DB compatible, I am trying to keep 
non-standard stuff ring-fenced on the JDBC URL and in the SQL script file - 
there is one script for Derby, one for MySQL etc.

I wrote a setup routine for all tests which would drop all tables from the given 
schema and then drop the schema (unless default). Derby did not like this! After 
dropping all the tables in the schema, Derby always complains that the schema 
cannot be dropped because it isn't empty. Searching the mailing list archive, I 
found no mention of this behaviour so I assume I have done something wrong or 
hit a bug (v 10.3.2.1). Does anybody recognise the problem?

thanks in advance
Adam

Mime
View raw message