You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Tobias Soloschenko (JIRA)" <ji...@apache.org> on 2015/02/14 14:56:11 UTC

[jira] [Updated] (WICKET-5837) JUnit tests may fail because of AbstractDefaultAjaxBehavior

     [ https://issues.apache.org/jira/browse/WICKET-5837?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Tobias Soloschenko updated WICKET-5837:
---------------------------------------
    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.

  was:
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. 


> JUnit tests may fail because of AbstractDefaultAjaxBehavior
> -----------------------------------------------------------
>
>                 Key: WICKET-5837
>                 URL: https://issues.apache.org/jira/browse/WICKET-5837
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 6.20.0, 7.0.0-M6
>            Reporter: Tobias Soloschenko
>              Labels: test
>
> 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.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)