KML TimeStamp date-month swap in non-POSIX locale

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-2T00:00:00Z>
testTimeInvervalTemplate(org.geoserver.kml.KMLTest): expected:<2002-

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 <b>correct</b> in a non-POSIX locale, but KMLTest then fails because it expects the swapped values.

Environment

None

Status

Assignee

Andrea Aime

Reporter

codehaus

Triage

Fix versions

Affects versions

Components

Priority

High
Configure