What Bryan says. One useful tip is to bounce your schemas rather than the whole database in between test cases. That is, instead of recreating the database for each test case, just drop all of the tables, views, routines, and permissions. JUnit's setup()/tearDown() idiom makes it easy to implement this technique. Try cloning the Derby test decorator called CleanDatabaseTestSetup.

Hope this helps,
-Rick

Bryan Pendleton wrote:
Just to chime in here. We also use Derby for deployment, and are having the same grief with setup time for unit tests

For what it's worth, Derby itself uses Derby in its own unit tests (of
course), and overall we have quite good performance, I believe, in the
Derby unit tests themselves.

The Derby source tree contains extensive tests and test utilities, and
is a great source of ideas about how to set up unit tests to work with
a database efficiently.

You might try exploring that body of testing code, and you might try
contacting the folks on the derby-dev list to discuss the particular
issues you're seeing.

There's also an extensive section in the Derby wiki which discusses
the technique behind the Derby unit testing harness.

I believe that, with a certain amount of care, you should be able to
achieve quite good performance for your unit testing using Derby.

thanks,

bryan

Reply via email to