2 Replies Latest reply on Nov 4, 2011 12:42 PM by Serkan Eskici

    SeamTest for "Download"-Bean

    Tilman Keskinöz Newbie

      Hello,


      I am using a DownloadBean quite similar to


      http://seamframework.org/Documentation/HowToUploadAndDownloadFilesInSeam


      Now i want to write a SeamTest for this, but failed.


      1. Attempt


      new FacesRequest("/foo.xhtml"){
                               @Override
                               protected void beforeRequest(){
                                    setParameter("attachmentId", "1");
                               }
                               @Override
                               protected void invokeApplication() throws Exception {
                                    invokeMethod("#{attachment.download(1)}");
                               }
      



      This fails in the following line
      response.getOutputStream(); which returns null.


      Any idea why this fails?


      2. Attempt:


      I tried to use the ResourceRequest class.
      Here i have been stuck at the beginning:


      new ResourceRequest(sharedEnvironment, Method.GET, path) {
      



      I tried various values /, the foo.xhtml filename and the URL displayed in the Browser (foo.seam).
      All of them returning 404.


      Any ideas what to try here?
      How to call the attachment.download method via the Resourcerequest