Yeah this does not correctly. This is really a BUG I made a post on this a while ago http://www.nabble.com/MockRoundtrip-and-%3Cstripes%3Afile---to16314703.html#a16316312
STS-265 is related, the patch there includes something that should fix this bug. A small workaround is to modify file bean and add a string constructor, or you might be able to subclass. -----Original Message----- From: S.L. [mailto:[email protected]] Sent: Monday, February 09, 2009 7:34 PM To: [email protected] Subject: [Stripes-users] <stripes:file> file uploading (e.g. filebean) & mockroundtrip? Hi, I'm using <stripes:file> for uploading file(s) - works great. My problem is that I'm not clear how to integrate this into my junit tests, which use MockRoundTrip. My actionbean class is something like this: MyActionBean implements ActionBean { /** The new entry's file attachments */ private List<FileBean> newAttachments = new ArrayList<FileBean>(); /** * Getter for the attached file(s)' filebeans * @return the filebeans for the attached file(s), if any */ public List<FileBean> getNewAttachments() { return newAttachments; } /** * Setter for the attached file(s). * @param newAttachments filebeans representing the attached file(s). */ public void setNewAttachments(List<FileBean> newAttachments) { this.newAttachments = newAttachments; } // details omitted for brevity ... } and my jsp page is something like: <stripes:file name="newAttachments[0]" id="attachmentID"/> <stripes:file name="newAttachments[1]" id="attachmentID"/> etc. I've tried MockRoundTrip.setParameter("newAttachments[0]", "file.txt") (and various other permutations/variations of this theme). My list of FileBean objects on my action bean class always seems to be empty. Anyone have an example of how to test FileBean / file uploads with MockRoundTrip? Thanks, Steve ------------------------------------------------------------------------------ Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM) software. With Adobe AIR, Ajax developers can use existing skills and code to build responsive, highly engaging applications that combine the power of local resources and data with the reach of the web. Download the Adobe AIR SDK and Ajax docs to start building applications today-http://p.sf.net/sfu/adobe-com _______________________________________________ Stripes-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/stripes-users ------------------------------------------------------------------------------ Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM) software. With Adobe AIR, Ajax developers can use existing skills and code to build responsive, highly engaging applications that combine the power of local resources and data with the reach of the web. Download the Adobe AIR SDK and Ajax docs to start building applications today-http://p.sf.net/sfu/adobe-com _______________________________________________ Stripes-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/stripes-users
