Since HashMap does not guarantee ordering, this test is not guaranteed to pass, ie the test is faulty and it needs to be fixed. The result from IBM JDK is also correct. An easy fix for the test case would be to test for both sequences of hash-map.
Can you please open a jira ?

-Thejas



On 8/16/11 7:56 PM, lulynn_2008 wrote:
  Hello,
I runTestDataModel test case with IBM JDK, and got the following error:
Testcase: testTupleToString took 0.002 sec
         FAILED
toString expected:<...ad a little 
lamb)},[[hello#world,goodbye#all]],42,5000000000,3.14...>  but was:<...ad a little 
lamb)},[[goodbye#all,hello#world]],42,5000000000,3.14...>
junit.framework.ComparisonFailure: toString expected:<...ad a little 
lamb)},[[hello#world,goodbye#all]],42,5000000000,3.14...>  but was:<...ad a little 
lamb)},[[goodbye#all,hello#world]],42,5000000000,3.14...>
         at 
org.apache.pig.test.TestDataModel.testTupleToString(TestDataModel.java:269)
This is because IBM HashMap.toString() output different with SUN 
HashMap.toString(). My question is:
Should the output must be the one expected?
Are the output expected based on SUN JDK?
Does the failed test case mean pig-0.8.1 can not work with IBM JDk?
Thank you.




Reply via email to