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 Junit doubt Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Testing
Bookmark "Junit doubt" Watch "Junit doubt" New topic
Author

Junit doubt

vasanth raman
Greenhorn

Joined: Aug 13, 2009
Posts: 24
how to write a junit test for this method

public void method(String s1,Sample s,Vector vv)
{
str=s1;
s=s3;
vec=vv
}
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

I wouldn't. But the second line almost certainly isn't doing what you think it is.

There's no need to test getters and setters if that is their only functionality.
 
Consider Paul's rocket mass heater.
 
subject: Junit doubt