Java J2EE Portal
Enterprise Java Station
J2EE curve
Java News / Articles
spring Tutorial
Building Web Applications Using The Spring Framework
Creating a new Google Web Toolkit (GWT) application
Integrating and Interoperating between J2EE and .NET Solutions
Processing...
Buy Java, Deals On Software Technology Store
Click here for great deals on computers, laptops, software and books
Which Java unit testing framework suits you best? JUnit, TestNG, JTiger...? PDF Print
Written by Content Team   
Mar 20, 2006 at 01:15 AM

JUnit 4.0 was released recently with hardly any fanfare. It appeared for download on SourceForge well before the official site junit.org reported its release. While JUnit was the parent framework that started the whole test driven development wave, the response to JUnit 4 has been mixed.

The highlights of JUnit 4 are:

* Test classes do not have to extend from junit.framework.TestCase.
* Test methods do not have to be prefixed with ‘test’.
* Assert methods stay the same.
* Support for annotations

However JUnit was frozen for quite a while and during this time many other frameworks moved and offered superior features. Annotations support for example has been present in frameworks like JTiger and TestNG for some time.

JTiger creator Tony Morris in a recent interview said that "JUnit is not much more than a glorified if/else construct." and the only reason to use JUnit is if your code must run in a version prior to J2SE 5.0. However these comments were made prior to JUnit 4.0

So where do things stand today? Is JUnit the best choice because of its wide spread use, the wide IDE support and the easy availability of JUnit aware developers? Or should you adopt a framework like JTiger or TestNG?

Related:
>> Let's Use JUnit
>> Why pick JTiger Java Unit Testing Framework over good old JUnit?
>> JUnit Books
>> Software Testing Books


User Comments

Comment by 'Guest' on 2006-03-20 04:22:51
TestNG Eclipse  
[URL=http://testng.org/doc/eclipse.html]http://testng.org/doc/eclipse.html[/URL] 
 
TestNG IDEA  
[URL=http://testng.org/doc/idea.html]http://testng.org/doc/idea.html[/URL] 
 
For basic testing both frameworks (JUnit and TestNG) are good enough. 
 
but if you want customized testing for web based applications you need to consider things like [URL=http://jakarta.apache.org/cactus/]Cactus[/URL] [URL=http://httpunit.sourceforge.net/]httpunit[/URL] [URL=http://sourceforge.net/projects/strutstestcase/]Struts Test Case[/URL] 
 
[URL=http://opensourcetesting.org/unit_java.php]http://opensourcetesting.org/unit_java.php[/URL] has a list of various Java testing tools

Comment by Not test-driven on 2006-03-20 09:27:15
Despite trying to use these unit test frameworks many times, I never managed to get them useful quickly on J2EE applications and then just dropped the thing and went back to manual testing and using main methods. 
 
These frameworks are fine for stand alone java applications but do they really work for major J2EE applications with app servers / DB and what not already making things chaotic enough?

Comment by 'Guest' on 2006-04-18 10:25:59
I've wrote this one with j2ee in mind, hope it helps :-) 
 
http://www.thekirschners.com/software/testare/testare.html 
 
regards, 
Emil.

Security Check. Please enter this code Listen to code


Add This Feed Button

Enter your Email
Java News / Articles
Java Expert Interviews
Anil Saldhana JBoss
JBoss is light years ahead of other open source application servers
Satish Talim
Java and J2EE Today: An interview with Satish Talim
Sameer Tyagi Sun
Understanding Web Services and SOA
Processing...
Go to top of page  Home |
SiteMap

Copyright 2004 to 2008 Rightrix Solutions. All rights reserved. All product names are trademarks of their respective companies. Java and all Java-based marks are trademarks or registered trademarks of Sun Microsystems, Inc. in the United States and other countries. Rightrix Solutions and IndicThreads.com are independent of Sun Microsystems, Inc.

Views expressed at IndicThreads.com reflect the views of the authors alone, and do not necessarily reflect those of IndicThreads.com. IndicThreads.com and it's authors are not responsible for reader comments and opinions.

Enterprise Java J2EE JEE Portal >> IndicThreads.com