Uploaded image for project: 'MyFaces Test'
  1. MyFaces Test
  2. MYFACESTEST-52

ValueExpression mocks cannot return types for null references

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.0.4
    • Component/s: Mock Objects
    • Labels:
      None

      Description

      For example, MyFaces cannot deduce the proper converter for a given UIComponent if the target of its 'value' binding is null. Delegating to ELResolver.getType() fixes this.

        Issue Links

          Activity

          Hide
          mbenson Matt Benson added a comment - - edited

          (includes changes from MYFACESTEST-51 patch)

          Show
          mbenson Matt Benson added a comment - - edited (includes changes from MYFACESTEST-51 patch)
          Hide
          rdebusscher Rudy De Busscher added a comment -

          Isn't it easier to just return the expectedType passed in as constructor parameter?

          Show
          rdebusscher Rudy De Busscher added a comment - Isn't it easier to just return the expectedType passed in as constructor parameter?
          Hide
          mbenson Matt Benson added a comment -

          Easier, yes. Fully correct, no. Once again, this touches on the concept of "when does the mock framework become a full-fledged implementation of unified EL?" but I don't think we've reached that point yet. With both of us fully aware that I am working against extval's tests, when I return expectedType from MockValueExpression.getValue() I still can't pass all the tests while using the built-in MockApplicationFactory.

          Show
          mbenson Matt Benson added a comment - Easier, yes. Fully correct, no. Once again, this touches on the concept of "when does the mock framework become a full-fledged implementation of unified EL?" but I don't think we've reached that point yet. With both of us fully aware that I am working against extval's tests, when I return expectedType from MockValueExpression.getValue() I still can't pass all the tests while using the built-in MockApplicationFactory.
          Hide
          rdebusscher Rudy De Busscher added a comment -

          Modified the submitted patch code so that the proposed code is only run when getValue() returns null. Otherwise, there are scenarios where a concrete result (like String.class) is lost (return of Object.class). See org.apache.myfaces.test.el.MockValueExpressionTest#testGetType

          Show
          rdebusscher Rudy De Busscher added a comment - Modified the submitted patch code so that the proposed code is only run when getValue() returns null. Otherwise, there are scenarios where a concrete result (like String.class) is lost (return of Object.class). See org.apache.myfaces.test.el.MockValueExpressionTest#testGetType

            People

            • Assignee:
              rdebusscher Rudy De Busscher
              Reporter:
              mbenson Matt Benson
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development