Two Laptop Bag*
The moose likes Testing and the fly likes TestNG Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Engineering » Testing
Bookmark "TestNG" Watch "TestNG" New topic
Author

TestNG

Paul Croarkin
Ranch Hand

Joined: Sep 30, 2004
Posts: 106
Lasse,

Any thoughts on Cedric Beust's TestNG? I've been a JUnit guy for so long that I've never bothered switching to TestNG, but would be willing to if I could see substantial benefits in doing so.
[ September 28, 2007: Message edited by: Paul Croarkin ]

Thanks,<br /> <br />Paul Croarkin<br />SCEA 5, SCWCD, SCJP
Eric Nielsen
Ranch Hand

Joined: Dec 14, 2004
Posts: 194
Well I find it very similar to JUnit4. TestNG's test group notion is nice. Or put another way its ability to tag/group "bootstrap" tests that can terminate/ignore the rest of the run if needed. (For instance I've at times had to have somewhat complex custom assertions, which were test driven, within the same project. If any of these tests fail the rest of the run should be aborted since to results would be trustable.)

However I'm happier with JUnit since I really think that the "Test instance per method" approach JUnit takes, while possibly unintuitive, is just about required for really enforcing test isolation.
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
My perspective is similar to Eric's. I see some nice features in TestNG but prefer JUnit because of its opinionated nature of enforcing certain good practices.


Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: TestNG
 
Similar Threads
Getting Method Names in TestNG
Testng And Maven Error Log. Can not understand
Scripting language for TestNG tests
TestNg or Junit
JUnit vs TestNG