Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
The moose likes Testing and the fly likes junit examples Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Testing
Bookmark "junit examples" Watch "junit examples" New topic

junit examples

PrasannaKumar Sathiyanantham
Ranch Hand

Joined: Nov 12, 2009
Posts: 110
Hi guys can you provide me some junit examples link and a good junit book with the latest release of junit covered? please

To err is human,
To forgive is not company policy
Travis Hein
Ranch Hand

Joined: Jun 06, 2006
Posts: 161
The junit cookbook is pretty good.

Most of my use is to use the JUnit 1.4 annotations, which works on any method, such as maybe one in your class, instead of needing to create a separate class that extends their test case, for example.

Error: Keyboard not attached. Press F1 to continue.
Jeanne Boyarsky
author & internet detective

Joined: May 26, 2003
Posts: 33124

"Test Driven" uses JUnit 4. Not the very latest version of course, but that only matters for advanced features. The absolute latest hasn't been published yet. "JUnit in Action" second edition is likely more recent. It prints in April and is available for PDF purchase now. Of course, it won't be the latest once it prints.

[OCA 8 book] [Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
I agree. Here's the link:
subject: junit examples
jQuery in Action, 3rd edition