File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Testing and the fly likes to use junit Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Engineering » Testing
Bookmark "to use junit" Watch "to use junit" New topic
Author

to use junit

venkataramana raju
Greenhorn

Joined: Sep 11, 2005
Posts: 28
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

Joined: Jan 23, 2002
Posts: 11962
    
    5
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.


Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: to use junit