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

    SeamTest for "Download"-Bean

    Tilman Keskinöz Newbie


      I am using a DownloadBean quite similar to


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

      1. Attempt

      new FacesRequest("/foo.xhtml"){
                               protected void beforeRequest(){
                                    setParameter("attachmentId", "1");
                               protected void invokeApplication() throws Exception {

      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