The Artima Developer Community
Sponsored Link

Java Community News
JUnit 4.3 Released

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Frank Sommers

Posts: 2642
Nickname: fsommers
Registered: Jan, 2002

JUnit 4.3 Released Posted: Mar 22, 2007 3:38 PM
Reply to this message Reply
Kent Beck released a new version of his Java testing framework. JUnit 4.3 includes a new method of verifying array equality and additional annotations that facilitate the backward compatibility of tests.

JUnit is Kent Beck's ubiquitous Java testing framework. The latest version introduces a few convenience methods, changes how array length is compared, and provides annotations that make the framework more backward compatible.

Significant new features include:

  • The use assertEquals() to compare array contents is now deprecated. In the future, assertEquals() will revert to its pre-4.0 meaning of comparing objects based on Java's Object.equals() semantics. To compare array contents, use the new, more reliable Assert.assertArrayEquals() methods.
  • The @Ignore annotation can now be applied to classes, to ignore the entire class, instead of individual methods.
  • Originally, developers who wanted to use a static suite() method from JUnit 3.x with a JUnit 4.x runner had to annotate the class with @RunWith(AllTests.class). In the common case, this requirement has been removed. However, when such a class is wrapped with a JUnit4TestAdapter ... the results may not be as expected.
  • Improved error messages for array comparison ("arrays first differed at element [1][0]")

We have covered here on Artima another annotation-based Java testing framework, TestNG. Now that JUnit includes annotations, too, how do you think TestNG and JUnit 4 compare? Which one would you recommend to developers just now starting out with unit testing?

Topic: Sharding Hibernate Previous Topic   Next Topic Topic: Adobe's Apollo Promises to Bridge Online and Desktop Experience

Sponsored Links


Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use