Investigation shows that ChoiceFormatTest fails because of the same
reason as DecimalFormatTest. ChoiceFormat uses DecimalFormat to parse
template passed. And the template contains "1.0<is 1+", so that
DecimalFormat stops parsing when it encounters '.' because dot is not
decimal separator in Russian locale. This is definitely not what was
expected.

--
Alexey A. Ivanov
Intel Middleware Product Division


>-----Original Message-----
>From: Ivanov, Alexey A [mailto:[EMAIL PROTECTED]
>Sent: Thursday, July 20, 2006 3:02 PM
>To: harmony-dev@incubator.apache.org
>Subject: RE: [continuum] BUILD FAILURE: Classlib/win.ia32 Build/Test
>
>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.
>
>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.m
b
>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_parseLj
a
>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_setDeci
m
>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_setMaxi
m
>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_setMini
m
>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_setMini
m
>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_toPatter
n
>(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]

---------------------------------------------------------------------
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