public void testCaseFile() throws Exception {
Map<ShpFileType, File> files = createFiles("testCaseFile", ShpFileType.values(), true);
String fileName = files.get(SHP).getPath();
fileName = fileName.substring(0, fileName.length()-4)+".shp";
ShpFiles shpFiles = new ShpFiles(fileName);
BasicShpFileWriter requestor = new BasicShpFileWriter("testCaseFile");
URL shpURL = shpFiles.acquireRead(SHP, requestor);
URL dbfURL = shpFiles.acquireRead(DBF, requestor);
URL shxURL = shpFiles.acquireRead(SHX, requestor);
try{
assertEquals(files.get(SHP).toURI().toURL().toExternalForm(), shpURL.toExternalForm());
assertEquals(files.get(DBF).toURI().toURL().toExternalForm(), dbfURL.toExternalForm());
assertEquals(files.get(SHX).toURI().toURL().toExternalForm(), shxURL.toExternalForm());
}finally{
shpFiles.unlockRead(shpURL, requestor);
shpFiles.unlockRead(dbfURL, requestor);
shpFiles.unlockRead(shxURL, requestor);
}
}