harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Richard Liang <richard.lian...@gmail.com>
Subject Re: [build] status
Date Tue, 18 Jul 2006 10:34:51 GMT

Richard Liang wrote:
> Hello Tim,
> I'm looking at this issue :-)
> Tim Ellison wrote:
>> (1) Linux build/tests are passing again, but for some reason the
>> 'BUILD SUCCESSFUL' note didn't go to the commit list?
>> (2) Windows build/test is still failing with:
>> Wrong full date pattern expected:<...full...> but was:<...long...>
>> junit.framework.ComparisonFailure: Wrong full date pattern
>> expected:<...full...> but was:<...long...> at
>> org.apache.harmony.text.tests.java.text.MessageFormatTest.test_applyPatternLjava_lang_String(MessageFormatTest.java:244)

>> at java.lang.reflect.AccessibleObject.invokeV(AccessibleObject.java:205)
Hello Tim,

This is another locale-dependent  test case. I will provide a patch to 
fix this issue.

Let me describe the test case details: ;-)

The failed test code is:

        (Line1) MessageFormat format = new MessageFormat("test");
        (Line2) format.applyPattern("{0, date, full}");
        (Line3) assertTrue("Wrong full date format", format.getFormats()[0]
        (Line4) assertEquals("Wrong full date pattern",
                "{0,date,full}", format.toPattern());

Line1, Create an instance of MessageFormat
Line2, Set the pattern used by the "format" which will create a date 
formatter with a FULL style pattern
Line3. assert the operation in Line2 is correct.
Line4. assert pattern of the "format" is equal to the previous one. This 
line fails if the platform default locale is en_UK.

The reason is: In en_UK, a FULL style date formatter is the same as a 
LONG style date formatter. So the return value of format.toPattern() 
maybe "{0,date,long}", and according to the spec of 
MessageFormat.toPattern() "...The string is constructed from internal 
information and therefore *does not necessarily equal* the previously 
applied pattern." So I think it's a bug of the test case.

Best regards,
>> Regards,
>> Tim

Richard Liang
China Software Development Lab, IBM 

Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
For additional commands, e-mail: harmony-dev-help@incubator.apache.org

View raw message