RE: StrutsTestCase, jUnit and file upload

2012-04-26 Thread Steve Higham
True (proxy.execute ().equals ("expected action result"); Note that the calls to the action are generated internally. You don't need any request.setParameter (...) calls. Cheers, Steve -Original Message- From: Steve Higham [mailto:st...@sjlt.co.uk] Sent: 25 April 2012 11:

Re: StrutsTestCase, jUnit and file upload

2012-04-25 Thread Chris Pratt
First of all, I assume you're trying to test your own code, not the framework. With that in mind, by the time the file gets to your action, it's just a series of parameters (which could be slightly different depending on which underlying Multipart support you are using). So, my suggestion would be

Re: StrutsTestCase, jUnit and file upload

2012-04-25 Thread Gabriel Belingueres
Coincidentally, yesterday I was struggling with testing a file upload. I was not using S2 as web framework but I was using Commons Fileupload, which IIRC is the default S2 upload component. I must say that my first strategy was trying to use Spring's MockMultipartHttpServletRequest and MockMultipa

StrutsTestCase, jUnit and file upload

2012-04-25 Thread Steve Higham
I'm currently using StrutsTestCase and jUnit to component test my Actions within the Struts context using a Mockito mock as my Model. This is working fine. I can call request.setParamater ("paramName", "paramValue") from the test class and, when executed, Struts will call the corresponding setP