This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
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

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Engineering » Testing
Bookmark "how to test struts action class" Watch "how to test struts action class" New topic

how to test struts action class

sush dod

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?


Jeanne Boyarsky
internet detective

Joined: May 26, 2003
Posts: 30130

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
jQuery in Action, 2nd edition
subject: how to test struts action class
Similar Threads
Handling a post request using Sockets
display image from Action class?? Please help
Junit for struts FormFile
where is the action class in JSF??
Export file unit test case for struts2 action