I am new to TestNG and have been using JUnit for years now. Infact,
although i had heard about TestNG, i started looking at it seriously,
only this week. One of the reasons for looking at some other test
framework is the absence of lifecycle listeners within JUnit. The
details about what i am talking are explained in a forum post here
http://www.coderanch.com/t/472680/Testing/JUnit-lifecycle-listeners (i
would have re-written that entire discussion here, but i think it
makes sense to avoid duplicating it).
After reading some of the docs on TestNG, i did find a section where
it talks about being able to use listeners. Looking at the javadocs i
do see that there's a ISuiteListener which gets invoked at the start
and end of a test "suite". Assuming my 1 run of TestNG has 5 suites,
then i guess there will be 5 such start/stop notifications? Is that
correct?
Also, is there anything more related to this, which i should
be looking at?
I haven't yet figured out how to specify a listener
from within a test class - maybe through annotation? But i think i'll
have to read some more docs to understand that.
On a unrelated note, i find the "group" feature for tests a good one.
And i think i'll be switching to TestNG in one of my projects to give
it a try.