JUnit 4.0 released – Annotations based TestCase definitions

Lucas Jellema
0 0
Read Time:1 Minute, 5 Second

Last week, release 4.0 of JUnit was published. You may have seen some of the announcements. The JUnit homepage (http://www.junit.org/index.htm)does not reflect this fact at the time of writing, but the 4.0 Jar is available for download at SourceForge (http://sourceforge.net/project/showfiles.php?group_id=15278). I found a very good article for getting started with this JUnit release: JUnit 4.0 in 10 minutes by Gunjan Doshi (Instrumental Services Inc. ). It very conscisely explains what is new about this release and how it will influence the way we use JUnit.

Some important conclusions:

  • JUnit 4.0 requires JDK 5.0 as it uses annotations to specify which classes are TestCases (no extension of TestCase is required) and which methods are in fact UnitTests (the method name does not need to begin with test)
  • This release makes writing tests a little easier and little more flexible (no more mandatory TestCase superclass for example)
  • Old (pre 4.0) JUnit Tests can still be run with the 4.0 Runner
  • The current generation of IDEs does not know about the JUnit 4.0 style of annotating classes, hence we will need an Adapter until they are up to speed (the adapter is part of the JUnit 4.0 release)

About Post Author

Lucas Jellema

Lucas Jellema, active in IT (and with Oracle) since 1994. Oracle ACE Director and Oracle Developer Champion. Solution architect and developer on diverse areas including SQL, JavaScript, Kubernetes & Docker, Machine Learning, Java, SOA and microservices, events in various shapes and forms and many other things. Author of the Oracle Press book Oracle SOA Suite 12c Handbook. Frequent presenter on user groups and community events and conferences such as JavaOne, Oracle Code, CodeOne, NLJUG JFall and Oracle OpenWorld.
Happy
Happy
0 %
Sad
Sad
0 %
Excited
Excited
0 %
Sleepy
Sleepy
0 %
Angry
Angry
0 %
Surprise
Surprise
0 %
Next Post

Getting started with the EJB 3.0 Query Language (EJBQL 3.0) using GlassFish reference implementation

This article is the sequel to EJB 3.0 Persistence – Introducing EJBQL 3.0, an introduction to EJB QL from an historical, strategic and functional perspective. In this post I want to show you the goods: what does the EJB QL code look like with EJB 3.0 Persistence for doing Native […]
%d bloggers like this: