Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 2.6-M2
-
Fix Version/s: 2.7-RC1
-
Component/s: shapefile plugin
-
Labels:None
Description
ShpFilesLockingTest fails on Windows because it makes assumptions about URL -> File -> URI roundtripping that apparently do not hold on Windows. Both testAcquireReadFile() and testAcquireWriteFile() have an identical failure.
http://hudson.opengeo.org/win32/job/GeoTools-trunk/19/
junit.framework.ComparisonFailure: null expected:<[]somefile.shp> but was:<[\\]somefile.shp>
at junit.framework.Assert.assertEquals(Assert.java:81)
at junit.framework.Assert.assertEquals(Assert.java:87)
at org.geotools.data.shapefile.ShpFilesLockingTest.testAcquireReadFile(ShpFilesLockingTest.java:59)
Offending code:
String path = "somefile.shp";
shpFiles = new ShpFiles("file://"+path);
File file = shpFiles.acquireReadFile(SHP, this);
assertEquals(path, file.getPath());
There is an identical failure in testAcquireWriteFile().
I am not sure how to fix this, and even if I did, I do not have a Windows box on which to test the fix. Even passing this through DataUtilities.urlToFile I don't think will fix it. I suspect the Win32 URI will be file:////somefile.shp with path //somefile.shp, because of Windows' love of putting // at the beginning of every absolute UNC filename, while on Linux it will be file://somefile.shp with path somefile.shp .
What is this test meant to do?