Uploaded image for project: 'Wicket'
  1. Wicket
  2. WICKET-5837

JUnit tests may fail because of AbstractDefaultAjaxBehavior

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 7.0.0-M5, 6.19.0
    • 6.20.0, 7.0.0-M6
    • wicket

    Description

      Because JSONObject is used in the method org.apache.wicket.ajax.AbstractDefaultAjaxBehavior.renderAjaxAttributes(Component, AjaxRequestAttributes)
      which internally uses a HashMap to store the key value pairs - see org.apache.wicket.ajax.json.JSONObject.JSONObject() - it is not ensured the attributes rendered in a specific order. This can cause the unit tests to pass in one run and fail in the next run.

      One suggestion would be to switch the HashMap and replace it with at LinkedHashMap to preserve the insertion order.

      See stack trace in comment.

      Attachments

        Activity

          People

            bitstorm Andrea Del Bene
            klopfdreh Tobias Soloschenko
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: