• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

to use junit

 
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
author
Posts: 11962
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic