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

Reply via email to