Java J2EE Portal
Enterprise Java Station
J2EE curve
Java News / Articles
Java News / Articles
Java Cryptography : A Bird's Eye View
The IndicThreads Software Technology & Emerging Trends Conversation 2008
Complementing Unit Test with Dependency Injection and Mock Objects
Processing...
Buy Java, Deals On Software Technology Store
Click here for great deals on computers, laptops, software and books
Why pick JTiger Java Unit Testing Framework over good old JUnit? PDF Print
Oct 05, 2005 at 05:37 AM

IndicThreads >> JUnit is currently the most widely used framework, so could you give us a comparison of JUnit and JTiger and how does one decide which unit testing framework to use?

Tony Morris >> The primary reason you would use JUnit over JTiger is when your test cases must execute under a Java Runtime Environment with a version less than 1.5 for some unforeseen reason. It is important to note that this does mean that the code under test must target a JRE version 1.5; it may target any runtime version 1.2 or higher. I cant think of any other legitimate reason.

"Only reason to use JUnit is if your code must run in a version prior to 1.5..."

JTiger expresses metadata as language annotations, which are new in version 1.5, where JUnit expresses metadata in some ad hoc fashion. For example, a JUnit test case is one that is prefixed with the name test. Using language annotations provides compile-time enforcement and runtime discovery of the metadata should the need arise, for example, in tools (hint: IDE plugins ?). I believe that annotations are one of the most useful features that were added to the Java Language Specification Third Edition. I have written a comparison between JUnit and JTiger at http://www.jtiger.org/articles/comparison-to-junit.html

"Using language annotations provides compile-time enforcement and runtime discovery of the metadata...."

JTiger is able to execute JUnit tests, which provides a progressive migration path from JUnit or simply an alternative unit test execution environment with additional features if that is preferred.

JTiger arose simply to suit my own needs, and given the encouragement of friends and colleagues, it was agreed that others may benefit from it too, so my employer permitted me to release it under an open source license (CPL v1.0) as my own work.

IndicThreads >> Can you give us a simple example of a test case using JUnit and one using JTiger?

Tony Morris >> Ill try to be unbias :)
Consider the following typical requirement A Person type that has a first and last name, is Serializable since we need to send instances over the wire, and adheres to the Object equals/hashCode method contracts.




Add This Feed Button

Enter your Email


Java Expert Interviews
ChristopherDuncan
Programmers lose because they are unwilling to learn any skill beyond the technical
TitusBrown
Test Driven Development doesn't fit my brain
Debu Panda - Oracle
Oracle Application Server is the fastest
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