This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Testing and the fly likes Writing Test Case Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Engineering » Testing
Bookmark "Writing Test Case" Watch "Writing Test Case" New topic
Author

Writing Test Case

Chinni Bujji
Ranch Hand

Joined: Jan 31, 2007
Posts: 60
Can any one tell me how to write a java test case with sample
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 30356
    
150

Chinni,
Are you looking to write JUnit tests? If so, the JUnit Cookbook is a great starting page.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
Chinni Bujji
Ranch Hand

Joined: Jan 31, 2007
Posts: 60
No I am not allowed to use any of those like junit or anything

just write normal test cases
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 30356
    
150

Chinni,
It sounds like you aren't trying to write code then; just a logical test case. A test case is a list of steps for how to reproduce a scenario of using the application. The idea is to be as detailed as possible so someone can follow those instructions later. For example, provide all inputs and steps that you need to follow.

If your organization has a template, you can use that. If not, you can just use a list in Word or Excel.
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
Originally posted by Chinni Bujji:
No I am not allowed to use any of those like junit or anything

just write normal test cases

Can you define "normal test case" for us? Are you talking about documenting a manually executed test case (why would you say "java test case" if this is the case?) or perhaps about writing executable unit tests without using third party libraries such as JUnit?


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