[
https://issues.apache.org/jira/browse/WICKET-5837?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14322210#comment-14322210
]
ASF GitHub Bot commented on WICKET-5837:
----------------------------------------
Github user klopfdreh commented on a diff in the pull request:
https://github.com/apache/wicket/pull/90#discussion_r24726639
--- Diff:
wicket-core/src/test/java/org/apache/wicket/markup/html/form/upload/MultiFileUploadFieldTest.java
---
@@ -63,13 +64,16 @@ protected void onSubmit()
for (int i = 1; i < 2; i++)
{
FileUpload fileUpload = uploads.get(i);
-
assertEquals(MultiFileUploadFieldTest.class.getSimpleName()+i+".txt",
fileUpload.getClientFileName());
+
assertEquals(MultiFileUploadFieldTest.class.getSimpleName() + (i - 1) + ".txt",
--- End diff --
I run the test with i-1 and it was success, but maybe the code at this
place changed a bit. So if it passing revert it.
Thanks a lot!
> 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: 7.0.0-M5, 6.19.0
> Reporter: Tobias Soloschenko
> Assignee: Andrea Del Bene
> 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)