aspose file tools*
The moose likes IDEs, Version Control and other tools and the fly likes How to test a Junit file in eclipse 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 » IDEs, Version Control and other tools
Bookmark "How to test a Junit file in eclipse" Watch "How to test a Junit file in eclipse" New topic
Author

How to test a Junit file in eclipse

Rajesh Khan
Ranch Hand

Joined: Oct 16, 2011
Posts: 230
Hi i created a junit test file of the class that i want to test. I wanted to know now how i can run that test ?? Example this was the class that was generated by eclipse

Rajesh Khan
Ranch Hand

Joined: Oct 16, 2011
Posts: 230
Junit Test
warning(org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestLoader$1)
Manoj Kumar Jain
Ranch Hand

Joined: Aug 22, 2008
Posts: 191

Junits classes extends TestCase class and you have to put the Junit jar in the library also.

You can just run the test cases by right click >Run As>Junit Test.

Do not wait to strike till the iron is hot; but make it hot by striking....
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5836
    
    7

Manoj Kumar Jain wrote:Junits classes extends TestCase class

That is only true before JUnit 4. In JUnit 4, you can use annotations to identify test classes and methods.

@Rajesh: as it stands, you have not written a unit test - none of the methods are annotated.

JBoss In Action
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to test a Junit file in eclipse