During the setup for the test, actually I do this in the @BeforeClass
because its expensive, we make some calls into legacy code that creates db
connections.  I need to delete the access db after the test but can't
because the db connections still exist.

So ideally I need some (tearDown) process to come along after each test and
do a cleanup.  Doing this in the AfterClass would be fine but I can't get it
to work...it seems to be the same process as the tests.

-Dave

On Thu, Sep 3, 2009 at 11:22 PM, Brett Porter <[email protected]> wrote:

> If the forkMode is always, the @before/@after should be run for each test
> and JVM, but is still before the JVM shuts down.
>
> What type of cleanup do you need to do after the JVM is shutdown?
>
> - Brett
>
>
> On 04/09/2009, at 6:15 AM, David Hoffer wrote:
>
>  How does forking work with respect to the @BeforeClass/@AfterClass
>> methods?
>> My use case is that I have some setup code that creates file/db
>> connections
>> that are not destroyed until the jvm is shutdown, therefore I can't
>> cleanup
>> in the @After method.  However it doesn't work using
>> @BeforeClass/@AfterClass either and I'm clear why.
>>
>> I tried using all the fork modes with no success.  What's the way to run
>> tests in one process and then cleanup in another?
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>

Reply via email to