Package org.geotools.data.directory

Examples of org.geotools.data.directory.DirectoryTypeCache


    public void testInitialization() throws Exception {
        copyShapefiles("shapes/archsites.shp");
        File f = copyShapefiles("shapes/bugsites.shp");
        tempDir = f.getParentFile();
       
        DirectoryTypeCache cache = new DirectoryTypeCache(tempDir, getFileStoreFactory());
        System.out.println(cache.getTypeNames());
        assertEquals(2, cache.getTypeNames().size());
        assertTrue(cache.getTypeNames().contains("archsites"));
        assertTrue(cache.getTypeNames().contains("bugsites"));
        cache.dispose();
    }
View Full Code Here


   
    @Test
    public void testAddNewDataStore() throws Exception {
        File f = copyShapefiles("shapes/bugsites.shp");
        tempDir = f.getParentFile();
        DirectoryTypeCache cache = new DirectoryTypeCache(tempDir, getFileStoreFactory());
       
        assertEquals(1, cache.getTypeNames().size());
        assertTrue(cache.getTypeNames().contains("bugsites"));
       
        // give the os some time, the directory last modification
        // time has a os specific time resolution
        Thread.sleep(DELAY);
        copyShapefiles("shapes/archsites.shp");
        assertEquals(2, cache.getTypeNames().size());
        assertTrue(cache.getTypeNames().contains("bugsites"));
        assertTrue(cache.getTypeNames().contains("archsites"));
        cache.dispose();
    }
View Full Code Here

    @Test
    public void testRemoveDataStore() throws Exception {
        File f = copyShapefiles("shapes/bugsites.shp");
        copyShapefiles("shapes/archsites.shp");
        tempDir = f.getParentFile();
        DirectoryTypeCache cache = new DirectoryTypeCache(tempDir, getFileStoreFactory());
       
        assertEquals(2, cache.getTypeNames().size());
        assertTrue(cache.getTypeNames().contains("bugsites"));
        assertTrue(cache.getTypeNames().contains("archsites"));
       
        // give the os some time, the directory last modification
        // time has a os specific time resolution
        Thread.sleep(DELAY);
        assertTrue(new File(tempDir, "archsites.shp").delete());
        assertTrue(new File(tempDir, "archsites.dbf").delete());
        assertTrue(new File(tempDir, "archsites.shx").delete());
        System.out.println(Arrays.asList(tempDir.listFiles()));
        assertEquals(1, cache.getTypeNames().size());
        assertTrue(cache.getTypeNames().contains("bugsites"));
        cache.dispose();
    }
View Full Code Here

    @Test
    public void testRemoveType() throws Exception {
        File f = copyShapefiles("shapes/bugsites.shp");
        copyShapefiles("shapes/archsites.shp");
        tempDir = f.getParentFile();
        DirectoryTypeCache cache = new DirectoryTypeCache(tempDir, getFileStoreFactory());
        assertEquals(2, cache.getTypeNames().size());
        assertTrue(cache.getTypeNames().contains("archsites"));
        assertTrue(cache.getTypeNames().contains("bugsites"));
       
        // give the os some time, the directory last modification
        // time has a os specific time resolution
        Thread.sleep(DELAY);
        assertTrue(new File(tempDir, "archsites.shp").delete());
        assertEquals(1, cache.getTypeNames().size());
        assertTrue(cache.getTypeNames().contains("bugsites"));
        cache.dispose();
    }
View Full Code Here

   
    @Test
    public void testAddType() throws Exception {
        File f = copyShapefiles("shapes/bugsites.shp");
        tempDir = f.getParentFile();
        DirectoryTypeCache cache = new DirectoryTypeCache(tempDir, getFileStoreFactory());
        assertEquals(1, cache.getTypeNames().size());
        assertTrue(cache.getTypeNames().contains("bugsites"));
       
        // give the os some time, the directory last modification
        // time has a os specific time resolution
        Thread.sleep(DELAY);
        copyShapefiles("shapes/archsites.shp");
        assertEquals(2, cache.getTypeNames().size());
        assertTrue(cache.getTypeNames().contains("bugsites"));
        assertTrue(cache.getTypeNames().contains("archsites"));
        cache.dispose();
    }
View Full Code Here

TOP

Related Classes of org.geotools.data.directory.DirectoryTypeCache

Copyright © 2018 www.massapicom. 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.