This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to test a Junit file in eclipse

 
Rajesh Khan
Ranch Hand
Posts: 230
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 230
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Junit Test
warning(org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestLoader$1)
 
Manoj Kumar Jain
Ranch Hand
Posts: 195
Java Linux Oracle
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Peter Johnson
author
Bartender
Posts: 5852
7
Android Eclipse IDE Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic