Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

to use junit

 
venkataramana raju
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hello
i am new for this forum as well as for junit

can anybody tell me how to write junit test cases(i mean
i have some java files , and i want to write junit tests with in
separate package, now when ever i run my java files automaticly those
tests should run)
to do this what code i have to place in my java files???

thanks
raju
 
Lasse Koskela
author
Sheriff
Posts: 11962
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by venkataramana raju:
can anybody tell me how to write junit test cases(i mean i have some java files , and i want to write junit tests with in separate package, now when ever i run my java files automaticly those tests should run) to do this what code i have to place in my java files???

Sorry, JUnit doesn't work that way. You'll have to run your JUnit tests, not the production code.

It might help in getting started if you read the couple of short articles at
junit.sourceforge.net. Also, if you're using the Eclipse IDE, there's a couple of tutorials on the topic here and here.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic