You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@poi.apache.org by bu...@apache.org on 2010/04/20 14:59:17 UTC

DO NOT REPLY [Bug 49138] Unit tests fail in Polish locale.

https://issues.apache.org/bugzilla/show_bug.cgi?id=49138

Yegor Kozlov <ye...@dinom.ru> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED

--- Comment #1 from Yegor Kozlov <ye...@dinom.ru> 2010-04-20 08:59:13 EDT ---
Thanks for the patch. I applied in r935896 with minor tweaks.

(1) PackagePropertiesPart.(get|set)DateValue should work symmetrically. Your
code suggests setting time zone only in the setter, I added it in the getter
too.

Also, the correct name of the time zone should be UTC, not GMT. The OOXML spec
Part 2 refers to the W3C Note "Date and Time Formats",
http://www.w3.org/TR/1998/NOTE-datetime-19980827 which says that Times are
expressed in UTC (Coordinated Universal Time), with a special UTC designator
("Z"). 

(2) TestHSSFDataFormatter.testGetFormattedCellValueHSSFCell() passed in Polish
but failed in Russian locale. It turned out that the code should assert the
correct form of month (long 'MMMM' or short 'MMM') as in the original Excel
format: 

        String fmt = cell.getCellStyle().getDataFormatString();
        //assert the correct month form, as in the original Excel format
        String monthPtrn = fmt.indexOf("mmmm") != -1 ? "MMMM" : "MMM";

        // this line is intended to compute how "July" would look like in the
current locale
        String jul = new SimpleDateFormat(monthPtrn).format(new
GregorianCalendar(2010,6,15).getTime());
    assertTrue( fmtval.indexOf(jul) > -1);

I ran tests for the following locales and all of them passed OK:

 -Duser.language=en -Duser.country=US
 -Duser.language=pl -Duser.country=POL
 -Duser.language=ru -Duser.country=RUS
 -Duser.language=de -Duser.country=DE


Regards,
Yegor

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org