@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();
}