Uploaded image for project: 'Arquillian'
  1. Arquillian
  2. ARQ-930

Warp JSF: Support for describing tested JSF/XHTML pages in JavaDoc and using ShrinkWrap Descriptor

XMLWordPrintable

    • Icon: Feature Request Feature Request
    • Resolution: Unresolved
    • Icon: Major Major
    • warp_1_next
    • None
    • Extension - Warp
    • None

      Ultimately, we should be able to use following methods to describe resources as JSF/XHTML pages:

      • in javadoc
      • using ShrinkWrap asset
      • using ShrinkWrap Descriptor for given format
      • referencing external/classpath file

      JavaDoc:

      /**
       * @resource index.xhtml
       *
       *     <h:commandLink action="list" />
       *
       * @resource list.xhtml
       * 
       *     <rich:list value="#{...}">
       */
      @Test
      public void myTest() {
          ...
      }
      

      The conflicts of same files between tests needs to be solved.

      In JSF, we can leverage own Facelet factory to register XHTMLs for each test specifically.

      The comments (JavaDoc) can be pre-processed by APT compiler (integrated to JDK >6).


      ShrinkWrap asset:

      TestAutocompleteBehaviors.java:

      FaceletAsset p = new FaceletAsset();
      
      p.body("<h:form id='form'>");
      p.body("    <r:autocomplete id='autocomplete' autocompleteList='#{autocompleteBean.suggestions}'>");
      p.body("        <r:ajax event='blur' listener='#{autocompleteBean.actionListener}' />");
      p.body("    </r:autocomplete>");
      p.body("</h:form>");
      
      archive.addAsWebResource(p, "index.xhtml");
      

      ShrinkWrap Descriptor:

      Descriptors.create(RichFacesDescriptor.class)
          .autocomplete()
              .id("autocomplete")
              .autocompleteList("#{autocompleteBean.suggestions}")
              .behavior()
                  .ajax()
                      .event("blur")
                      .listener("#{autocompleteBean.actionListener}");
      

      referencing external file:

      ShrinkWrap.create(WebArchive.class).addWebAppResource("index.xhtml")
      

      note that the API is simplified from the version using addWebResource(File file, String path)

            Unassigned Unassigned
            lfryc Lukáš Fryč (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: