File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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 Head First Android 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
author & internet detective

Joined: May 26, 2003
Posts: 32304

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.

[OCA 8 book] [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
I agree. Here's the link:
subject: how to test struts action class
It's not a secret anymore!