I was happy to discover that
TestNG is now covered in a full chapter of the book
Beginning POJOs by Brian Sam-Bodden.
The author puts aside JUnit, and introduces the reader to
TestNG concepts. After a concise intro, the author builds more complex tests integrating
DbUnit and
EasyMock (as you may already know
EasyMock 2 is already JUnit-free; in previous posts I have started posting ideas about a
JUnit-free JMock).
Regarding the examples provided in the book, I have a single remark: having in mind that building a Hibernate
SessionFactory
is considered an expensive operation, I would use other mechanisms from
TestNG that may help running the tests more quickly (by guaranteeing that the
SessionFactory
is created/initialized only once):
@BeforeGroup
(guaranteed to run once before a named group of tests),
@BeforeTest
(which is guaranteed to run once before the tests) or
@BeforeSuite
(running once before the whole suite).
2 comments:
Hi,
there will be a full Book about Testing with TestNG (in German)
So have a Look at:
Amazon.de TestNG
Mark Rambow
Cool! I would really be happy to read it, but unfortunately my german is very basic.
./alex
---
.o(the_mindstorm).p
Post a Comment