[
https://issues.apache.org/jira/browse/SHINDIG-1838?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13430366#comment-13430366
]
Ryan Baxter commented on SHINDIG-1838:
--------------------------------------
I am surprised this doesn't fail in the java 6 build either....
JSON makes no promises about the order of the attributes in the object so
comparing 2 JSON strings is unreliable as the order of the attributes may be
different but in all actuallity the objects are the same. I know we have run
into these problems elsewhere as well and I thought we had a helper method some
where but I can't find it right now. What if we just compared the JSON objects
instead of the strings?
> RenderingGadgetRewriterTest.xhrWrapperConfigurationInjected fails in Java 5
> builds
> ----------------------------------------------------------------------------------
>
> Key: SHINDIG-1838
> URL: https://issues.apache.org/jira/browse/SHINDIG-1838
> Project: Shindig
> Issue Type: Bug
> Components: Java
> Affects Versions: 2.5.0-beta3
> Environment: builds.apache.org ubuntu executors. Java 5.
> Reporter: Stanton Sievers
> Priority: Minor
> Labels: junit, test
>
> One test case is failing when building Shindig against Java 5. The issue
> seems to simply be a poor equality check of JSON objects. The attributes are
> in a different order in the Java 5 results, causing the compare to fail.
> org.apache.shindig.gadgets.render.RenderingGadgetRewriterTest.xhrWrapperConfigurationInjected
> Error Message
> No shindig.xhrwrapper.oauthTokenName configuration present in rewritten HTML.
> expected:<...bar/baz.html","oauth[Service":"serviceName","oauthTokenName":"token]Name"}>
> but
> was:<...bar/baz.html","oauth[TokenName":"tokenName","oauthService":"service]Name"}>
> Stacktrace
> org.junit.ComparisonFailure: No shindig.xhrwrapper.oauthTokenName
> configuration present in rewritten HTML.
> expected:<...bar/baz.html","oauth[Service":"serviceName","oauthTokenName":"token]Name"}>
> but
> was:<...bar/baz.html","oauth[TokenName":"tokenName","oauthService":"service]Name"}>
> at org.junit.Assert.assertEquals(Assert.java:125)
> at
> org.apache.shindig.gadgets.render.RenderingGadgetRewriterTest.assertXhrConfigContains(RenderingGadgetRewriterTest.java:933)
> at
> org.apache.shindig.gadgets.render.RenderingGadgetRewriterTest.checkXhrWrapperConfigurationInjection(RenderingGadgetRewriterTest.java:918)
> at
> org.apache.shindig.gadgets.render.RenderingGadgetRewriterTest.xhrWrapperConfigurationInjected(RenderingGadgetRewriterTest.java:872)
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira