Didn't see that. I might use it. But I don't actually know quite what the
MultipartRequestHandler does, so I'm not sure how to mock it :)

I figured the ServletUnit framework would teach me.

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

?
----- 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