0 Replies Latest reply on Jul 28, 2011 10:58 AM by dele

    JSFUNIT - assertTrue fails due to facelets composite component?

    dele

      In my form I have a field named statusCodeField which has its REQUIRED attribute set to TRUE.  statusCodeField was created by a

      facelets composite component.  When I manually test the field via a browser, the field's REQUIRED attribute always has a value of

      TRUE.  But when I test the field via JSFUNIT i.e. assertTrue(statusCodeField.isRequired()); the test fails. Basically,
      AssertionFailedError is thrown and comes back with the value of null.   According to the api null means "... the cause is nonexistent

      or unknown..."

       

      After debugging the form with <ui:debug hotkey="K" rendered="#{initParam['facelets.DEVELOPMENT']}"/> I found out the following:

       

      1.  In the Component Tree, statusCodeField REQUIRED attribute had the value of #{cc.attrs.fieldRequired} i.e. required="#

      {cc.attrs.fieldRequired}"

       

      2.  In the Extended Component Tree, statusCodeField REQUIRED attribute had the value of true i.e. required="true"

       

      As you can see, it seems that JSFUNIT is not able to derive the actual value from #{cc.attrs.fieldRequired}.

       

      Can anyone please suggest how I can relolve this.  For example is there a way of pointing JSFUNIT to the Extended Component Tree?

       

      Thanks.