Build failure on Windows caused by unsafe File path manipulation in KMLMapTransformer
-------------------------------------------------------------------------------------
Key: GEOS-4004
URL: http://jira.codehaus.org/browse/GEOS-4004
Project: GeoServer
Issue Type: Bug
Components: WMS
Reporter: Ben Caradoc-Davies
Assignee: Andrea Aime
Priority: Blocker
The underlying problem is in KMLMapTransformer at line 699:
{code}
iconHref = ResponseUtils.buildURL(mapContext.getRequest().getBaseUrl(),
"styles/" + file.getPath(), null, URLType.RESOURCE);
{code}
You just can't do this and expect code to be portable, because file.getPath() depends on the default platform path separator.
Xiangtan Lin's original report (an internal review of my fix for GEOS-3995):
Failed tests:
testExternalGraphicSubdir(org.vfny.geoserver.wms.responses.map.kml.KMLTransfor
merTest)
testExternalGraphicSubdir(org.vfny.geoserver.wms.responses.map.kml.KMLTransformerTest) Time elapsed: 0.031 sec <<< FAILURE!
junit.framework.ComparisonFailure: expected:<...rver/styles/graphics[/]bridgesubdir.png> but was:<...rver/styles/graphics[\]bridgesubdir.png>
at junit.framework.Assert.assertEquals(Assert.java:81)
at junit.framework.Assert.assertEquals(Assert.java:87)
at org.custommonkey.xmlunit.XMLAssert.assertXpathEvaluatesTo(XMLAssert.java:858)
at org.vfny.geoserver.wms.responses.map.kml.KMLTransformerTest.testExternalGraphicSubdir(KMLTransformerTest.java:139)
Best regards,
Xiangtan
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira