Hello guys,
I had been searching for a code snippet on how to do this in JUnit framework.
In a normal testcase, the test is run in the following manner.
setUp -> testMethod1 -> tearDown
setUp -> testMethod2 -> tearDown
Now, I need to startup a fixture once for all the testmethods
and I had overriden the setUp/tearDown method in the TestSetup.
Now my testcase is ran as
setUp -> testMethod1 -> testMethod2 -> tearDown
However, I want to have this kind of behavior in my code.
startFixture (executed only once)
setUp -> testMethod1 -> tearDown
setUp -> testMethod2 -> tearDown
stopFixture
Having a flag in the setup will be an easy one but I want know a kinda "official" way on how JUnit framework could be used. Or do I have to implement my TestListener for this?
There might have been the same question as this in the forum; if there is, could you please give me the link to it...
Thanks,
mavedrive;