Uploaded image for project: 'Commons JXPath'
  1. Commons JXPath
  2. JXPATH-27

Locale related TestCases fail

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 1.2 Final
    • None
    • None
    • Operating System: All
      Platform: All

    • 30133

    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)

      Attachments

        Activity

          People

            Unassigned Unassigned
            cocoa Simon Raess
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: