db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Knut Anders Hatlen <knut.hat...@oracle.com>
Subject Re: junit - is ther a way to skip teardown method when a test fixture fails?
Date Wed, 11 Sep 2013 21:04:57 GMT
Mamta Satoor <msatoor@gmail.com> writes:

> Hi,
> I am working on DERBY-5866 where triggers are intermittently not
> getting fired in the order they were created. I got hold of wombat db
> from such a failure but it is all clean with no tables left in the db.
> This is because of the tearDown() method in TriggerTest class which
> deletes all the meta data from the table in order to prepare the
> database for the next test fixture. I was wondering is there a way in
> junit where if a test fails, we can have it skip the tearDown method
> so we have a db available to do some debugging. Appreciate all the
> help.

I guess it's possible to add a boolean field that's initially false and
make the test method set it to true if it completes without failure.

Another way might be to move the cleanup code from tearDown() to
setUp(). Then each test case will still run in a clean environment, but
we won't have tearDown() remove data that's potentially valuable during

View raw message