Just remembered struts2 isn't a servlet. I just wanted a quick and easy way of giving my action a real multipart request wrapper to run against. So tomorrow I guess I'll have to check out the MockMultipartRequestWrapper.

Thanks
Adam

Martin Gainty on 31/03/08 20:55, wrote:
Have you looked at using Mock classes of MockHttpServletRequest(),
MockHttpServletResponse(), MockServletContext()
from
org.apache.struts2.ServletActionContextTest.java

?
Martin
----- Original Message -----
From: "Adam Hardy" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <user@struts.apache.org>
Sent: Monday, March 31, 2008 12:04 PM
Subject: testing file uploads


I need to test an action that is getting uploaded files and piping them
straight
into Strings. I don't want to save actual files on server, so I'll get the
multipart request wrapper directly.

MultiPartRequestWrapper multiWrapper =
     (MultiPartRequestWrapper) ServletActionContext.getRequest()

I'm thinking of using HttpUnit and ServletUnit to set this stuff up. Has
anyone
set up Struts2 with ServletUnit?

By the way, has anyone used Mockito yet, the new mocking framework?
http://code.google.com/p/mockito/


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to