aspose file tools*
The moose likes Testing and the fly likes TestNG tool support Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Engineering » Testing
Bookmark "TestNG tool support" Watch "TestNG tool support" New topic
Author

TestNG tool support

Jan Goyvaerts
Ranch Hand

Joined: Feb 08, 2011
Posts: 32
Is it as extensive as JUnit ?

I've heard people boasting about TestNG being so much better than JUnit. But is it as well supported ? Does it offer the same, if not more, possibilities ?
Tomek Kaczanowski
author
Ranch Hand

Joined: Oct 26, 2005
Posts: 40

Hi Jan,

right now the support from different tools for TestNG is almost as good as for JUnit. "Almost", because it still happens that some tools/frameworks first come with JUnit support and then with TestNG. However, the situation has improved much during few last years, and all big players (Eclipse, IntelliJ, Maven, Ant or Spring) and almost all new frameworks (e.g. Arquillan, Gradle) provide support for TestNG out-of-the-box.

Do you have any specific tools (IDEs, frameworks) on your mind?

As for the differences between JUnit and TestNG please see this forum thread.


Tomek Kaczanowski
Book author: Practical Unit Testing with TestNG and Mockito
http://practicalunittesting.com
Jan Goyvaerts
Ranch Hand

Joined: Feb 08, 2011
Posts: 32
What about Intellij (for development) and Jenkins & Maven (for CI) ?
Tomek Kaczanowski
author
Ranch Hand

Joined: Oct 26, 2005
Posts: 40

I use all of them on daily basis, so it works.

AFAIK Jenkins does not care (maybe some specific plugins do?), and as for Maven, its testing plugin - surefire - provides decent TestNG support.

IntelliJ supports TestNG out-of-the-box since ages, however I have to warn you that there is some issues with using the latest TestNG with Intellij. As far as I know:
* it can be fixed with some copying of JARs,
* no problems for versions <= 6.3.1
Jan Goyvaerts
Ranch Hand

Joined: Feb 08, 2011
Posts: 32
But in what aspects is TestNG better than for example JUnit 4.10 ?

Don't get me wrong, I'm no JUnit-addict. I'm just using the tool that looks the most adequate to me. If TestNG does better, then TestNG it is.
Tomek Kaczanowski
author
Ranch Hand

Joined: Oct 26, 2005
Posts: 40

Hi Jan,

regarding JUnit-TestNG differences, have you seen the other discussion I suggested? You will find some information there, please visit this forum thread. I think it would be good if we kept this thread for tooling support.
Billy Tsai
Ranch Hand

Joined: May 23, 2003
Posts: 1304
How easy is it to introduce either TestNG or Mockito into a very large legacy codebase?

are there examples in the book to mix TestNG, Mockito with other frameworks such as JDummy and JMock? how can we utilize TestNG and Mockito with old test frameworks?


BEA 8.1 Certified Administrator, IBM Certified Solution Developer For XML 1.1 and Related Technologies, SCJP, SCWCD, SCBCD, SCDJWS, SCJD, SCEA,
Oracle Certified Master Java EE 5 Enterprise Architect
Tomek Kaczanowski
author
Ranch Hand

Joined: Oct 26, 2005
Posts: 40

Hi Billy,

Billy Tsai wrote:How easy is it to introduce either TestNG or Mockito into a very large legacy codebase?

I really can't answer this question. First of all, I'm not sure what you mean by "introducing", second, adding new technology to your development environment depends very much on the quality of your code, software development process and devs skills!

Billy Tsai wrote:are there examples in the book to mix TestNG, Mockito with other frameworks such as JDummy and JMock? how can we utilize TestNG and Mockito with old test frameworks?

You can think of TestNG as a replacement for other testing frameworks (i.e. JUnit) and of Mockito as a replacement for other mocking frameworks (jMock, EasyMock). If you wish you could use TestNG with any other mocking framework, and you could use Mockito with any other testing framework. However, in the book I concentrate on working with TestNG and Mockito, because I believe that currently they are the most powerful and robust of all existing solutions.
Cedric Beust
author
Ranch Hand

Joined: Oct 12, 2004
Posts: 46
Tomek is too modest to say it, but he recently authored a book called "Practical unit testing with TestNG and Mockito" which I strongly recommend. See his signature for the details.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: TestNG tool support