This week's book giveaway is in the Design forum.
We're giving away four copies of Design for the Mind and have Victor S. Yocco on-line!
See this thread for details.
Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

TestNG tool support

 
Jan Goyvaerts
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 40
IntelliJ IDE Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Jan Goyvaerts
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What about Intellij (for development) and Jenkins & Maven (for CI) ?
 
Tomek Kaczanowski
author
Ranch Hand
Posts: 40
IntelliJ IDE Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 40
IntelliJ IDE Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1304
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
Tomek Kaczanowski
author
Ranch Hand
Posts: 40
IntelliJ IDE Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic