>-----Original Message-----
>From: Paulex Yang [mailto:[EMAIL PROTECTED]
>Sent: Thursday, July 20, 2006 4:17 PM
>To: harmony-dev@incubator.apache.org
>Subject: Re: [continuum] BUILD FAILURE: Classlib/win.ia32 Build/Test
>
>Ivanov, Alexey A wrote:
>> Hi all.
>>
>>
>>> BTW, my default locale is Russian
>>>
>>
>> That's the reason. DecimalFormatTest is locale-dependent, but the
test
>> logic doesn't take it into account. In Russian locale, comma is used
as
>> decimal separator but not dot. And it is the reason why some tests
fail.
>>
>> I see two ways to resolve the problem:
>> 1. Make tests locale-independent by explicitly specifying
>> DecimalFormatSymbols.
>> 2. Fetch these symbols from the DecimalFormat object, and modify the
>> expected values using these data.
>>
>3. Specify a locale to the DecimalFormat in the test, should be similar
>with option 1, actually I suspect they are both necessary, because
>either locale setting or DecimalFormatSymbols setting should be part of
>DecimalFormat logic.

This option is similar to the first one. And this option is not worth
because any user may change their preferences as opposed to the default
values. For example, I can change decimal separator used in US or UK
locale to comma like in Russian. After that change the tests mentioned
below will fail, the reason being the same as they fail now when run in
Russian locale.

Since it is logic that we want to test, setting DecimalFormatSymbols
explicitly is the right way to do it. This way tests will not depend on
locale data (which might be different from the default values).


I tried to fix DecimalFormatTest using this approach and faced with bug
in DecimalFormat implementation. I filed JIRA issue for that:
https://issues.apache.org/jira/browse/HARMONY-965


Thanks,
Alexey.

>> I prefer the first approach since this ensures we test the underlying
>> logic. [1]
>>
>> I can prepare patch if nobody objects.
>>
>>
>> As for ChoiceFormatTest failure, there seems to be a bug in
>> ChoiceFormatter which can't parse negative numbers.
>>
>>
>> [1]
>>
http://mail-archives.apache.org/mod_mbox/incubator-harmony-dev/200607.mb
>> ox/[EMAIL PROTECTED]
>>
>> --
>> Alexey A. Ivanov
>> Intel Middleware Product Division
>>
>>
>>
>>> -----Original Message-----
>>> From: Alexei Zakharov [mailto:[EMAIL PROTECTED]
>>> Sent: Tuesday, July 18, 2006 4:36 PM
>>> To: harmony-dev@incubator.apache.org
>>> Subject: Re: [continuum] BUILD FAILURE: Classlib/win.ia32 Build/Test
>>>
>>> BTW, my default locale is Russian
>>>
>>> 2006/7/18, Alexei Zakharov <[EMAIL PROTECTED]>:
>>>
>>>> Sure,
>>>>
>>>> DecimalFormatTest:
>>>> ================
>>>> Testcase: test_parseLjava_lang_String_Ljava_text_ParsePosition took
0
>>>>
>> sec
>>
>>>> FAILED
>>>> null
>>>> junit.framework.AssertionFailedError
>>>> at
>>>>
>>>
org.apache.harmony.text.tests.java.text.DecimalFormatTest.test_parseLja
>>>
>> va_l
>>
>>> ang_String_Ljava_text_ParsePosition(DecimalFormatTest.java:66)
>>>
>>>> at
>>>>
>> java.lang.reflect.AccessibleObject.invokeV(AccessibleObject.java:205)
>>
>>>> Testcase: test_setDecimalSeparatorAlwaysShownZ took 0 sec
>>>> FAILED
>>>> Wrong set result expected:<....> but was:<...,>
>>>> junit.framework.ComparisonFailure: Wrong set result expected:<....>
>>>> but was:<...,>
>>>> at
>>>>
>>>
org.apache.harmony.text.tests.java.text.DecimalFormatTest.test_setDecim
>>>
>> alSe
>>
>>> paratorAlwaysShownZ(DecimalFormatTest.java:1361)
>>>
>>>> at
>>>>
>> java.lang.reflect.AccessibleObject.invokeV(AccessibleObject.java:205)
>>
>>>> Testcase: test_setMaximumFractionDigitsI took 0 sec
>>>> FAILED
>>>> Wrong maximum expected:<.......> but was:<...,...>
>>>> junit.framework.ComparisonFailure: Wrong maximum expected:<.......>
>>>> but was:<...,...>
>>>> at
>>>>
>>>
org.apache.harmony.text.tests.java.text.DecimalFormatTest.test_setMaxim
>>>
>> umFr
>>
>>> actionDigitsI(DecimalFormatTest.java:1410)
>>>
>>>> at
>>>>
>> java.lang.reflect.AccessibleObject.invokeV(AccessibleObject.java:205)
>>
>>>> Testcase: test_setMinimumFractionDigitsI took 0,016 sec
>>>> FAILED
>>>> Wrong minimum expected:<.......> but was:<...,...>
>>>> junit.framework.ComparisonFailure: Wrong minimum expected:<.......>
>>>> but was:<...,...>
>>>> at
>>>>
>>>
org.apache.harmony.text.tests.java.text.DecimalFormatTest.test_setMinim
>>>
>> umFr
>>
>>> actionDigitsI(DecimalFormatTest.java:1436)
>>>
>>>> at
>>>>
>> java.lang.reflect.AccessibleObject.invokeV(AccessibleObject.java:205)
>>
>>>> Testcase: test_setMinimumIntegerDigitsI took 0 sec
>>>> FAILED
>>>> Incorrect integer expected:<.......> but was:<...,...>
>>>> junit.framework.ComparisonFailure: Incorrect integer
>>>> expected:<.......> but was:<...,...>
>>>> at
>>>>
>>>
org.apache.harmony.text.tests.java.text.DecimalFormatTest.test_setMinim
>>>
>> umIn
>>
>>> tegerDigitsI(DecimalFormatTest.java:1452)
>>>
>>>> at
>>>>
>> java.lang.reflect.AccessibleObject.invokeV(AccessibleObject.java:205)
>>
>>>> ChoiceFormatTest:
>>>> ===============
>>>> Testcase: test_toPattern took 0,016 sec
>>>> Caused an ERROR
>>>> null
>>>> java.lang.IllegalArgumentException
>>>> at java.text.ChoiceFormat.applyPattern(ChoiceFormat.java:126)
>>>> at java.text.ChoiceFormat.<init>(ChoiceFormat.java:65)
>>>> at
>>>>
>>>
org.apache.harmony.text.tests.java.text.ChoiceFormatTest.test_toPattern
>>>
>> (Cho
>>
>>> iceFormatTest.java:421)
>>>
>>>> at
>>>>
>> java.lang.reflect.AccessibleObject.invokeV(AccessibleObject.java:205)
>>
>>>> Does this make sense?
>>>>
>>>> Regards,
>>>>
>>>> 2006/7/18, Tim Ellison <[EMAIL PROTECTED]>:
>>>>
>>>>> Can you send details (e.g. a walkback) from the failing tests?
>>>>>
>>>>> Thanks
>>>>> Tim
>>>>>
>>>>> Alexei Zakharov wrote:
>>>>>
>>>>>> Are you talking about HARMONY-910? I've applied it and
>>>>>> MessageFormatTest is ok now (thanks, Richard!) But
>>>>>>
>> ChoiceFormatTest
>>
>>>>>> and DecimalFormatTest continue failing.
>>>>>>
>>>>>> 2006/7/18, Geir Magnusson Jr <[EMAIL PROTECTED]>:
>>>>>>
>>>>>>> Read back to the [build] status thread.... I think that Richard
>>>>>>>
>> has
>>
>>> the
>>>
>>>>>>> fix done...
>>>>>>>
>>>>>>> Alexei Zakharov wrote:
>>>>>>>
>>>>>>>> Nathan,
>>>>>>>>
>>>> <SNIP>
>>>>
>>>> --
>>>> Alexei Zakharov,
>>>> Intel Middleware Product Division
>>>>
>>>>
>>> --
>>> Alexei Zakharov,
>>> Intel Middleware Product Division
>>>
>>>
---------------------------------------------------------------------
>>> Terms of use : http://incubator.apache.org/harmony/mailing.html
>>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>>> For additional commands, e-mail:
[EMAIL PROTECTED]
>>>
>>
>> ---------------------------------------------------------------------
>> Terms of use : http://incubator.apache.org/harmony/mailing.html
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail:
[EMAIL PROTECTED]
>>
>>
>>
>
>
>--
>Paulex Yang
>China Software Development Lab
>IBM
>
>
>
>---------------------------------------------------------------------
>Terms of use : http://incubator.apache.org/harmony/mailing.html
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]


--
Alexey A. Ivanov
Intel Middleware Product Division

---------------------------------------------------------------------
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to