Issue 97 in json-simple: Building 1.1.1 with java-1.8.0 tests fail - hash not matching?

10 views
Skip to first unread message

json-...@googlecode.com

unread,
Jul 21, 2014, 6:59:10 AM7/21/14
to json-...@googlegroups.com
Status: New
Owner: ----
Labels: Type-Defect Priority-Medium

New issue 97 by s.tray...@gmail.com: Building 1.1.1 with java-1.8.0 tests
fail - hash not matching?
http://code.google.com/p/json-simple/issues/detail?id=97



Hi,

Building json_simple 1.1.1 with

java-1.8.0-openjdk

maven-3.2.2

The tests unfortunately fail, I've attached the full build log


======array1==========
["abc\u0010a\/",123,222.123,true]
======obj1 with array1===========
{"name":"fang","weight":60.21,"array1":["abc\u0010a\/",123,222.123,true],"age":27,"is_developer":true}
Tests run: 2, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.165 sec
<<< FAILURE! - in org.json.simple.Test
testEncode(org.json.simple.Test) Time elapsed: 0.036 sec <<< FAILURE!
junit.framework.ComparisonFailure:
expected:<{"[array1":["abc\u0010a\/",123,222.123,true],"weight":60.21,"age":27,"name":"fang"],"is_developer":true...>
but
was:<{"[name":"fang","weight":60.21,"array1":["abc\u0010a\/",123,222.123,true],"age":27],"is_developer":true...>
at junit.framework.Assert.assertEquals(Assert.java:100)
at junit.framework.Assert.assertEquals(Assert.java:107)
at junit.framework.TestCase.assertEquals(TestCase.java:269)
at org.json.simple.Test.testEncode(Test.java:320)
Running org.json.simple.parser.YylexTest
"\/"
"abc\/\r\b\n\t\f\\"
[

{
^M}
^H^L{
error:Unexpected character ) at position 0.
{a : b}
error:Unexpected character (a) at position 1.
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.006 sec -
in org.json.simple.parser.YylexTest


Attachments:
build.log 236 KB

--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings

json-...@googlecode.com

unread,
Jul 21, 2014, 8:15:08 AM7/21/14
to json-...@googlegroups.com
Updates:
Status: Accepted

Comment #1 on issue 97 by fangyid...@gmail.com: Building 1.1.1 with
java-1.8.0 tests fail - hash not matching?
http://code.google.com/p/json-simple/issues/detail?id=97

The order of the hash in Java 8 changes, so the expect value doesn't match
the result: it's not a problem of this library, but a problem of the test
case. Just comment out the codes in JUnit test case and it should work.

Will fix the test case to avoid confusion. Thank you for reporting this
issue.

json-...@googlecode.com

unread,
Jul 25, 2014, 8:14:19 PM7/25/14
to json-...@googlegroups.com
Updates:
Status: Fixed

Comment #2 on issue 97 by fangyid...@gmail.com: Building 1.1.1 with
java-1.8.0 tests fail - hash not matching?
http://code.google.com/p/json-simple/issues/detail?id=97

Updated codes in SVN. To push it to maven repo.
Reply all
Reply to author
Forward
0 new messages