Uploaded image for project: 'Tapestry'
  1. Tapestry
  2. TAPESTRY-1028

Unit tests using JSONObject.toString are fragile & may break in different environments.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 4.1
    • 4.1.1
    • None
    • None
    • Windows XP, JDK 1.5.0_06

    Description

      JSONObject.toString writes out its contents by iterating thru the keys of its internal HashMap. However the HashMap class makes no guarantees about the ordering of iterators, so the keys + values may be written out in any order.

      The trouble is that the unit tests compare JSONObject.toString to hardcoded strings. If the iteration order happens to match the test string then all is well. If it doesn't match then the tests fail, even tho the functionality being tested is working correctly.

      Attachments

        1. TAP-1028.patch
          16 kB
          Ben Sommerville

        Activity

          People

            jkuhnert Jesse Kuhnert
            bpsommerville Ben Sommerville
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: