fixed case-sensitive file names in unit tests for Bugzilla 47520

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@794621 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Yegor Kozlov 2009-07-16 10:44:01 +00:00
parent 13898bc29c
commit 0662f7e862
3 changed files with 12 additions and 4 deletions

View File

@ -43,7 +43,7 @@ public class TestXSSFExportToXML extends TestCase{
public void testExportToXML() throws Exception{
XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook("CustomXmlMappings.xlsx");
XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook("CustomXMLMappings.xlsx");

View File

@ -36,7 +36,7 @@ public class TestMapInfo extends TestCase {
public void testMapInfoExists() throws Exception {
XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook("CustomXmlMappings.xlsx");
XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook("CustomXMLMappings.xlsx");
MapInfo mapInfo = null;
SingleXmlCells singleXMLCells = null;

View File

@ -77,7 +77,15 @@ public final class HSSFTestDataSamples {
throw new RuntimeException("Sample file '" + sampleFileName
+ "' not found in data dir '" + _resolvedDataDir.getAbsolutePath() + "'");
}
// System.out.println("opening " + f.getAbsolutePath());
try {
if(!sampleFileName.equals(f.getCanonicalFile().getName())){
throw new RuntimeException("File name is case-sensitive: requested '" + sampleFileName
+ "' but actual file is '" + f.getCanonicalFile().getName() + "'");
}
} catch (IOException e){
throw new RuntimeException(e);
}
try {
return new FileInputStream(f);
} catch (FileNotFoundException e) {