ShpFilesLockingTest fails on Windows
------------------------------------

                 Key: GEOT-2671
                 URL: http://jira.codehaus.org/browse/GEOT-2671
             Project: GeoTools
          Issue Type: Bug
    Affects Versions: 2.6-M2
            Reporter: Ben Caradoc-Davies
            Priority: Blocker


ShpFilesLockingTest fails on Windows because it makes assumptions about URL -> 
File -> URI roundtripping that apparently do not hold on Windows. Both 
testAcquireReadFile() and testAcquireWriteFile() hae an identical failure.
http://hudson.opengeo.org/win32/job/GeoTools-trunk/19/

http://hudson.opengeo.org/win32/job/GeoTools-trunk/org.geotools$gt-shapefile/19/testReport/org.geotools.data.shapefile/ShpFilesLockingTest/testAcquireReadFile/
{code}
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)
{code}

Offending code:

{code}
        String path = "somefile.shp";
        shpFiles = new ShpFiles("file://"+path);
        File file = shpFiles.acquireReadFile(SHP, this);
        assertEquals(path, file.getPath());
{code}

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?


-- 
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

        

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Geotools-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-devel

Reply via email to