[Geoserver-devel] [jira] (GEOS-5879) KML TimeStamp date-month swap

Ben Caradoc-Davies created BugGEOS-5879
KML TimeStamp date-month swap

Issue Type:

BugBug

Assignee:

Andrea Aime

Components:

WMS

Created:

08/Jul/13 2:06 AM

Description:

Building the new kml module in a non-POSIX locale fails because day and month are swapped in KML timestamps in a POSIX locale (which is what the broken KMLTest expects).

This passes:
LC_ALL=C mvn -o -Dtest=KMLTest test

Otherwise with non-US UTF-8 locale this fails:
mvn -o -Dtest=KMLTest test

Looks like Jenkins and Hudson helpfully set C/POSIX locale, hiding this failure.

Failure looks like this:

Failed tests: testTimeTemplate(org.geoserver.kml.KMLTest): expected:<2002-[02-1]2T00:00:00Z> but was:<2002-[12-0]2T00:00:00Z>
testTimeInvervalTemplate(org.geoserver.kml.KMLTest): expected:<2002-[02-1]2T00:00:00Z> but was:<2002-[12-0]2T00:00:00Z>

So the test is expecting “2002-02-12T00:00:00Z”, but looking in Others.properties reveals 2002-12-02; the month and date are swapped!!!

It looks like the problem is that FeatureTemplate forces US date format “MM/dd/yyyy”, but PlacemarkTimeDecoratorFactory.PlacemarkTimeDecoratorFactory handles dates differently, so a date passed into a string and then re-encoded gets its day and month swapped. The result is correct in a non-POSIX locale, but KMLTest then fails because it expects the swapped values.

Project:

GeoServer

Priority:

CriticalCritical

Reporter:

Ben Caradoc-Davies

This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: [http://www.atlassian.com/software/jira](http://www.atlassian.com/software/jira)