Uploaded image for project: 'Seam 2'
  1. Seam 2
  2. JBSEAM-3957

FacesRequest in SeamTest doesnt work with different paths than root

    Details

    • Estimated Difficulty:
      Medium

      Description

      Im developing a Use Case with SeamTest.

      This example works great:

      @Test
      public void testCreateChiefProfileEmptyFields() throws Exception{
      new FacesRequest("/createChiefProfile.xhtml")

      { ..... }
      }

      This code doesnt work ( doesnt call invokeApplication, renderResponse, etc ), and approves test because doesnt invoke any methods:

      @Test
      public void testCreateChiefProfileEmptyFields() throws Exception{
      new FacesRequest("/pages/publicArea/profiles/chiefs/createChiefProfile.xhtml") { ..... }

      }

      Of course, I've verified several times:

      1) /pages/publicArea/profiles/chiefs/createChiefProfile.xhtml is correct

      2) Both files are exactly the same

      Comment:

      Method skipToRender in AbstractSeamTest returns different values in both cases:

      private boolean skipToRender()

      { return FacesContext.getCurrentInstance().getRenderResponse() || FacesContext.getCurrentInstance().getResponseComplete(); }

      With "/createChiefProfile.xhtml" , FacesContext.getCurrentInstance().getResponseComplete(); returns false, and with
      /pages/publicArea/profiles/chiefs/createChiefProfile.xhtm returns true.

      You can test this failure moving some page of Seam Test from web content root directory to another location

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                norman.richards Norman Richards
                Reporter:
                demostenes1509 Maximiliano Carrizo
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: