Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.2 Final
    • Fix Version/s: None
    • Labels:
      None
    • Environment:

      Operating System: All
      Platform: All

      Description

      The TestCases below fail in jxpath 1.2 RC1. Note that the locale on the JXPathContext is correctly set to
      Locale.US, but the tests find the default locale (of my computer) de_DE!

      Testcase: testFormatNumberFunction(org.apache.commons.jxpath.ri.compiler.CoreFunctionTest):
      FAILED
      Evaluating <format-number(123456789, '#.000000000')> expected:<123456789.000000000> but
      was:<123456789>
      junit.framework.AssertionFailedError: Evaluating <format-number(123456789, '#.000000000')>
      expected:<123456789.000000000> but was:<123456789>
      at org.apache.commons.jxpath.JXPathTestCase.assertXPathValue(JXPathTestCase.java:52)
      at
      org.apache.commons.jxpath.ri.compiler.CoreFunctionTest.testFormatNumberFunction(CoreFunctionTes
      t.java:153)

      Testcase: testAttributeLang(org.apache.commons.jxpath.ri.model.beans.BeanModelTest): FAILED
      Evaluating <@xml:lang> expected:<en-US> but was:<de-DE>
      junit.framework.AssertionFailedError: Evaluating <@xml:lang> expected:<en-US> but was:<de-DE>
      at org.apache.commons.jxpath.JXPathTestCase.assertXPathValue(JXPathTestCase.java:52)
      at
      org.apache.commons.jxpath.ri.model.BeanModelTestCase.testAttributeLang(BeanModelTestCase.java:
      605)

      Testcase: testLang(org.apache.commons.jxpath.ri.model.dom.DOMModelTest): Caused an ERROR
      No value for xpath: //product/price:sale[lang('en')]/saleEnds
      org.apache.commons.jxpath.JXPathException: No value for xpath: //product/price:sale[lang('en')]/
      saleEnds
      at
      org.apache.commons.jxpath.ri.JXPathContextReferenceImpl.getValue(JXPathContextReferenceImpl.java:
      344)
      at
      org.apache.commons.jxpath.ri.JXPathContextReferenceImpl.getValue(JXPathContextReferenceImpl.java:
      280)
      at org.apache.commons.jxpath.JXPathTestCase.assertXPathValue(JXPathTestCase.java:51)
      at org.apache.commons.jxpath.ri.model.XMLModelTestCase.testLang(XMLModelTestCase.java:698)

      Testcase: testAttributeLang(org.apache.commons.jxpath.ri.model.dynabeans.DynaBeanModelTest):
      FAILED
      Evaluating <@xml:lang> expected:<en-US> but was:<de-DE>
      junit.framework.AssertionFailedError: Evaluating <@xml:lang> expected:<en-US> but was:<de-DE>
      at org.apache.commons.jxpath.JXPathTestCase.assertXPathValue(JXPathTestCase.java:52)
      at
      org.apache.commons.jxpath.ri.model.BeanModelTestCase.testAttributeLang(BeanModelTestCase.java:
      604)

      Testcase: testLang(org.apache.commons.jxpath.ri.model.jdom.JDOMModelTest): Caused an ERROR
      No value for xpath: //product/price:sale[lang('en')]/saleEnds
      org.apache.commons.jxpath.JXPathException: No value for xpath: //product/price:sale[lang('en')]/
      saleEnds
      at
      org.apache.commons.jxpath.ri.JXPathContextReferenceImpl.getValue(JXPathContextReferenceImpl.java:
      344)
      at
      org.apache.commons.jxpath.ri.JXPathContextReferenceImpl.getValue(JXPathContextReferenceImpl.java:
      280)
      at org.apache.commons.jxpath.JXPathTestCase.assertXPathValue(JXPathTestCase.java:51)
      at org.apache.commons.jxpath.ri.model.XMLModelTestCase.testLang(XMLModelTestCase.java:698)

        Activity

        Hide
        Dmitri Plotnikov added a comment -

        Thanks for catching this. I have made test cases Locale-independent.

        Show
        Dmitri Plotnikov added a comment - Thanks for catching this. I have made test cases Locale-independent.

          People

          • Assignee:
            Unassigned
            Reporter:
            Simon Raess
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development