File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Testing and the fly likes junit program Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Testing
Bookmark "junit program" Watch "junit program" New topic

junit program

vijay shanker
Ranch Hand

Joined: Oct 26, 2007
Posts: 88
Hi all,
given below is my program for a simple test case

instead of desired behaviour it is only printing test why? i dont know what to think about this test.

PS;- this is my first program with junit.
Jeanne Boyarsky
author & internet detective

Joined: May 26, 2003
Posts: 33130

Try removing the " extends TestCase" part. JUnit 3.8 tests extended this. JUnit 4 use annotations. If you use both, JUnit assumes it is a 3.8 test. And in 3.8 tests had to be of the form "public void testXXX".

[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
vijay shanker
Ranch Hand

Joined: Oct 26, 2007
Posts: 88
That is cool i have got the result.
I agree. Here's the link:
subject: junit program
It's not a secret anymore!