aspose file tools*
The moose likes Testing and the fly likes JUnit 3 problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Engineering » Testing
Bookmark "JUnit 3 problem" Watch "JUnit 3 problem" New topic
Author

JUnit 3 problem

Jerry Van
Greenhorn

Joined: May 03, 2008
Posts: 20
When I run this Junit 3 test class I get the failure "No tests found". However, mt method starts with the "test" word:




So, my question is, what might be causing this failure? Let me know if you need to see any other classes of my LifeGame project.

Thanks,
jv
Stevi Deter
Ranch Hand

Joined: Mar 22, 2008
Posts: 265

Jerry,

Junit 3 tests need to be in the format



Yours has boolean as the return. I suspect that's why Junit doesn't find any test cases.

You should use asserts within the test method to verify the code is working as expected.


There will always be people who are ahead of the curve, and people who are behind the curve. But knowledge moves the curve. --Bill James
bart zagers
Ranch Hand

Joined: Feb 05, 2003
Posts: 234
Yep, that is the problem.
The method should not have a return value (and no arguments).
Also as mentioned, you normally want to test something in your method and therefore use some assert method. In this case it looks like you want to do something like:


Did you read this article on the JUnit website?
Jeanne Boyarsky
author & internet detective
Marshal

Joined: May 26, 2003
Posts: 30764
    
156

Moving to our testing forum.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
Jerry Van
Greenhorn

Joined: May 03, 2008
Posts: 20
I apologize for starting this topic in the wrong forum. Thanks for the correction, and thanks to all who replied. By using your replies I got it to work.

Love that java!

Cheers,
Jerry
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JUnit 3 problem