wood burning stoves 2.0*
The moose likes Testing and the fly likes how to test struts action class Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Testing
Bookmark "how to test struts action class" Watch "how to test struts action class" New topic
Author

how to test struts action class

sush dod
Greenhorn

Joined: Nov 26, 2005
Posts: 4
Hi All,
i am trying to write a test case for a struts action call.
in the action call i am trying to send a file on the response output stream.
when i get the output stream using response.getOutputstream i get a object of ServletOurtputStream.
which is a abstract class..
i then write a byte stream on the output stream and fluch it to close
i am confused as to how to write a test case.
can sombody help me here?
any example?

regards,

Sush
Jeanne Boyarsky
author & internet detective
Marshal

Joined: May 26, 2003
Posts: 30957
    
158

Sush,
The first thing to decide is if you want to write a unit test (with mock objects) to test the action class directly or an integration test through the GUI. I recommend a unit test.


[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
 
 
subject: how to test struts action class