Examples of numberOfLocks()


Examples of org.geotools.data.shapefile.files.ShpFiles.numberOfLocks()

        ShpFiles shpFiles = new ShpFiles(new URL("http://blah/blah.shp"));
        try{
            shpFiles.getInputStream(SHP, this);
            fail("maybe test is bad?  We want an exception here");
        }catch(Throwable e){
            assertEquals(0, shpFiles.numberOfLocks());
        }
    }

    @Test
    public void testExceptionGetOutputStream() throws Exception {
View Full Code Here

Examples of org.geotools.data.shapefile.files.ShpFiles.numberOfLocks()

        ShpFiles shpFiles = new ShpFiles(new URL("http://blah/blah.shp"));
        try{
            shpFiles.getOutputStream(SHP, this);
            fail("maybe test is bad?  We want an exception here");
        }catch(Throwable e){
            assertEquals(0, shpFiles.numberOfLocks());
        }
    }

    @Test
    public void testExceptionGetWriteChannel() throws Exception {
View Full Code Here

Examples of org.geotools.data.shapefile.files.ShpFiles.numberOfLocks()

        ShpFiles shpFiles = new ShpFiles(new URL("http://blah/blah.shp"));
        try{
            shpFiles.getWriteChannel(SHP, this);
            fail("maybe test is bad?  We want an exception here");
        }catch(Throwable e){
            assertEquals(0, shpFiles.numberOfLocks());
        }
    }

    @Test
    public void testExceptionGetReadChannel() throws Exception {
View Full Code Here

Examples of org.geotools.data.shapefile.files.ShpFiles.numberOfLocks()

        ShpFiles shpFiles = new ShpFiles(new URL("http://blah/blah.shp"));
        try{
            shpFiles.getReadChannel(SHP, this);
            fail("maybe test is bad?  We want an exception here");
        }catch(Throwable e){
            assertEquals(0, shpFiles.numberOfLocks());
        }
    }
   
    @Test
    public void testGetInputStream() throws IOException {
View Full Code Here

Examples of org.geotools.data.shapefile.files.ShpFiles.numberOfLocks()

       
        assertFalse(files.isLocal());
       
        ReadableByteChannel read = files.getReadChannel(SHP, this);
       
        assertEquals(1, files.numberOfLocks());
       
        read.close();
       
        assertEquals(0, files.numberOfLocks());
    }
View Full Code Here

Examples of org.geotools.data.shapefile.files.ShpFiles.numberOfLocks()

       
        assertEquals(1, files.numberOfLocks());
       
        read.close();
       
        assertEquals(0, files.numberOfLocks());
    }
   
    private void doRead(ShpFileType shpFileType) throws IOException {
        ReadableByteChannel in = files.getReadChannel(shpFileType, this);
        assertEquals(1, files.numberOfLocks());
View Full Code Here

Examples of org.geotools.data.shapefile.files.ShpFiles.numberOfLocks()

        shpFiles = new ShpFiles( new File( path ));

        File file = shpFiles.acquireReadFile(SHP, this);
        // under windows the two paths can be just different in terms of case..
        assertEquals( new File(path).getCanonicalPath().toLowerCase(), file.getPath().toLowerCase());
        assertEquals(1, shpFiles.numberOfLocks());
       
        shpFiles.unlockRead(file, this);
        shpFiles.dispose();
    }
    @Test
View Full Code Here

Examples of org.geotools.data.shapefile.files.ShpFiles.numberOfLocks()

        shpFiles = new ShpFiles( new File( path ));

        File file = shpFiles.acquireWriteFile(SHP, this);
        // under windows the two paths can be just different in terms of case..
        assertEquals(new File( path ).getCanonicalPath().toLowerCase(), file.getPath().toLowerCase());
        assertEquals(1, shpFiles.numberOfLocks());
       
        shpFiles.unlockWrite(file, this);
        assertEquals(0, shpFiles.numberOfLocks());
        shpFiles.dispose();
    }
View Full Code Here

Examples of org.geotools.data.shapefile.files.ShpFiles.numberOfLocks()

        // under windows the two paths can be just different in terms of case..
        assertEquals(new File( path ).getCanonicalPath().toLowerCase(), file.getPath().toLowerCase());
        assertEquals(1, shpFiles.numberOfLocks());
       
        shpFiles.unlockWrite(file, this);
        assertEquals(0, shpFiles.numberOfLocks());
        shpFiles.dispose();
    }

    @Test
    public void testAcquireRead1() throws Throwable {
View Full Code Here

Examples of org.geotools.data.shapefile.files.ShpFiles.numberOfLocks()

    public void testAcquireRead1() throws Throwable {
        ShpFiles shpFiles = new ShpFiles("http://somefile.com/shp.shp");

        URL url = shpFiles.acquireRead(DBF, this);
        assertEquals("http://somefile.com/shp.dbf", url.toExternalForm());
        assertEquals(1, shpFiles.numberOfLocks());
        FileWriter testWriter = new FileWriter() {

            public String id() {
                return "Other";
            }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.