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

Unable to call setValue of ValueExpression in test

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • None
    • None
    • None
    • See attached JUnit test case which fails with myfaces-test20-1.0.0-SNAPSHOT
      Tested with Mojarra-2.0.2

    Description

      Components tested inside a test case inherited from AbstractJsfTestCase are not able to do following:

      ELContext elContext = facesContext.getELContext();
      ValueExpression ve = application.getExpressionFactory().createValueExpression(elContext, "#

      {foo}

      ", String.class);
      ve.setValue(elContext, "BAR");

      The error is caused by the FacesResourceBundleELResolver inside the setValue method, where it tries to get a ResourceBundle from MockApplication12 for the given ValueExpression. Unfortunately the MockApplication12 getResourceBundle method throws a MissingResourceException instead of returning null.

      Please apply attached patch to the code base.

      Attachments

        1. MockApplication12.patch
          0.8 kB
          Christoph Göldner
        2. ValueExpressionTest.java
          1 kB
          Christoph Göldner

        Activity

          People

            jakobkorherr Jakob Korherr
            goeldner Christoph Göldner
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: