TestNG gets a full book chapter

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).

Advertisements

2 Comments

Filed under Uncategorized

2 responses to “TestNG gets a full book chapter

  1. Anonymous

    Hi,
    there will be a full Book about Testing with TestNG (in German)
    So have a Look at:
    Amazon.de TestNG

    Mark Rambow

  2. the_mindstorm

    Cool! I would really be happy to read it, but unfortunately my german is very basic.

    ./alex

    .o(the_mindstorm).p

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s