Leonardo Rangel Augusto created PIG-3309:
--------------------------------------------

             Summary: TestJsonLoaderStorage fails with IBM JDK 6/7
                 Key: PIG-3309
                 URL: https://issues.apache.org/jira/browse/PIG-3309
             Project: Pig
          Issue Type: Improvement
          Components: build
    Affects Versions: 0.11.1
         Environment: IBM J9 VM 1.6.0 SR13 FP1; IBM J9 VM 1.7.0 SR4 FP1
            Reporter: Leonardo Rangel Augusto
            Priority: Minor
             Fix For: 0.11.2


TestJsonStorageLoader fails due to small differences in the way HashMaps are 
printed out. The HashMap specification 
(http://docs.oracle.com/javase/1.5.0/docs/api/java/util/HashMap.html) mentions 
that "This class makes no guarantees as to the order of the map; in particular, 
it does not guarantee that the order will remain constant over time.", so PIG 
testcases should not rely on the order in which the HashMap items are printed 
out.

testJsonLoaderStorage1 explicitly does this comparison:

Testcase: testJsonLoaderStorage1 took 2.25 sec
        FAILED
expected:<...3":"c","key2":"b","key1":"a"}}
{"a0":2,"a1":[{"a10":6,"a11":"cat"},{"a10":7,"a11":"dog"},{"a10":8,"a11":"pig"}],"a2":{"a20":2.3,"a21":"moon"},"a3":{"key4":"value4","key1":"value1...>
 but was:<...1":"a","key2":"b","key3":"c"}}
{"a0":2,"a1":[{"a10":6,"a11":"cat"},{"a10":7,"a11":"dog"},{"a10":8,"a11":"pig"}],"a2":{"a20":2.3,"a21":"moon"},"a3":{"key1":"value1","key4":"value4...>
junit.framework.ComparisonFailure: expected:<...3":"c","key2":"b","key1":"a"}}
{"a0":2,"a1":[{"a10":6,"a11":"cat"},{"a10":7,"a11":"dog"},{"a10":8,"a11":"pig"}],"a2":{"a20":2.3,"a21":"moon"},"a3":{"key4":"value4","key1":"value1...>
 but was:<...1":"a","key2":"b","key3":"c"}}
{"a0":2,"a1":[{"a10":6,"a11":"cat"},{"a10":7,"a11":"dog"},{"a10":8,"a11":"pig"}],"a2":{"a20":2.3,"a21":"moon"},"a3":{"key1":"value1","key4":"value4...>
        at 
org.apache.pig.test.TestJsonLoaderStorage.testJsonLoaderStorage1(TestJsonLoaderStorage.java:63)



--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to