aspose file tools*
The moose likes Struts and the fly likes How to easily test a Struts Action? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "How to easily test a Struts Action?" Watch "How to easily test a Struts Action?" New topic
Author

How to easily test a Struts Action?

gao zhixin
Ranch Hand

Joined: Jan 18, 2006
Posts: 42
Now I'm working with struts, and I want to test my action class, but I need to mock a HttpRequest object, a HttpResponse object, a ActionForm object, and a ActionMapping object, it's too difficult for me to test. Is there anything more easy?
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24187
    
  34

I dunno... let's go over to the Struts forum and ask over there (I'll move this thread for you.)


[Jess in Action][AskingGoodQuestions]
alan wamser
Ranch Hand

Joined: Jan 30, 2006
Posts: 41
What do you mean by mock? Why not just download tomcat and use it to test your action?

http://localhost/webapp/action.do
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
The Apache Cactus is a test framework made specifically for testing Web applications. It builds on JUnit and works great for unit testing Struts applications.

Here's the link:

http://jakarta.apache.org/cactus/
[ January 30, 2006: Message edited by: Merrill Higginson ]

Merrill
Consultant, Sima Solutions
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to easily test a Struts Action?