db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel John Debrunner <...@apache.org>
Subject Re: [junit] <testname>_app.properties replacement mechanism for JUnit tests
Date Wed, 16 Aug 2006 13:04:05 GMT
Andreas Korneliussen wrote:

> I am about to enable more testcases in ConcurrencyTest, which relies on
> getting a lock timeout to verify a lock conflict. The problem is that
> default setting for lock timeout is 60 seconds, and the test uses a lot
> of time waiting for the timeout. I can make the test go 10 times faster
> by reducing derby.locks.waitTimeout (and with all testcases enabled it
> used 350 secs in embedded framework).
> 
> With the current harness, I could add a ConcurrencyTest_app.properties
> file and set it there. However this test is now part of _Suite (a pure
> junit Suite).
> 
> One quick-fix for me would be to create a _Suite_app.properties. This
> would cause all junit tests in the suite to run with the same
> properties. Another quick-fix would be to remove it from the _Suite, and
> put it into the "old-harness" suites.
> 
> - However, if the Derby community is interested at completely replacing
> the old test harness in the future, it would be good to have a pure
> junit solution to this.
> 
> One solution could be to create a TestSetup, which can configure the
> database for a junit Test, and delete the database once the test is
> complete - i.e
> 
> public class DBSetup extends BaseJDBCTestSetup
> {
>   public void setUp() { create and configure db }
>   public void tearDown() { delete db }
> }
> 
> 
> Other thoughts ?

Take a look at:

http://wiki.apache.org/db-derby/KillDerbyTestHarness

A test setup exists to set system properties, a test setup exists to
clean a database.

Dan.


Mime
View raw message