> can you explain how you make sure that each test starts from a clean DB ?
The system exits on tearDown() when there are records left in the DB. A test that does this is invalid and not allowed to enter the test suite.
> turned out to be very impractical and tedious
indeed
> those are typically very hard to find
not if the invalid test is immediately rejected
> so far, clearing the whole db has proven to work well
If so, there should be successful hudson runs that show that. Rather the opposite is true.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4176571#4176571
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4176571
can you explain how you make sure that each test starts from a clean DB ?
i also played with the idea that each test should delete its own generated data explicitely. but that turned out to be very impractical and tedious. usually when you forget to delete a record (and this can be very unexpected) it is not a problem so you won't know at that time. then when after a while a test might be created or changed and that might lead to a clash. those are typically very hard to find.
so far, clearing the whole db has proven to work well. but i'm open to hearing alternatives if you think they are better.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4176548#4176548
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4176548