This week's giveaway is in the Spring forum.
We're giving away four copies of REST with Spring (video course) and have Eugen Paraschiv on-line!
See this thread for details.
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

Win a copy of REST with Spring (video course) this week in the Spring forum!
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: 32818

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!