logo       

Re: addTestListener(), TestListener.startTest(): msg#00202

java.junit.user

Subject: Re: addTestListener(), TestListener.startTest()

> And that being done, what is a call cycle
> difference between TestListener.startTest() and
> Test.setUp()?

TestResult -> TestListener.startTest()
TestResult -> TestCase.runBare()
setUp() | These methods called in the runBare()
run() | method
tearDown() |
TestResult -> TestListener.endTest()

> To my understanding they are both event
> methods called before every test method in a TestCase.

setUp is not an "event method" since you don't have any kind of listener
involved.

When the TestResult "asks" the TestCase to run itself (by calling the
runBare() method), the TestCase executes its setUp, test code and
tearDown method. Before calling the runBare() method, the TestResult
tells the listeners that a test is about to start (startTest) and did
finish (endTest).

For more info, please refer to the TestCase.java and TestResult.java files.

-Vladimir

--
Vladimir Bossicard
www.bossicard.com





<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise