From eda8d9631c316fcc1ff9f2e28887ea6a53995ef9 Mon Sep 17 00:00:00 2001 From: Yegor Kozlov Date: Thu, 16 Jul 2009 10:44:01 +0000 Subject: [PATCH] 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 --- .../poi/xssf/extractor/TestXSSFExportToXML.java | 2 +- .../org/apache/poi/xssf/model/TestMapInfo.java | 2 +- .../org/apache/poi/hssf/HSSFTestDataSamples.java | 12 ++++++++++-- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/ooxml/testcases/org/apache/poi/xssf/extractor/TestXSSFExportToXML.java b/src/ooxml/testcases/org/apache/poi/xssf/extractor/TestXSSFExportToXML.java index 960f078ee2..ab74042927 100755 --- a/src/ooxml/testcases/org/apache/poi/xssf/extractor/TestXSSFExportToXML.java +++ b/src/ooxml/testcases/org/apache/poi/xssf/extractor/TestXSSFExportToXML.java @@ -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"); diff --git a/src/ooxml/testcases/org/apache/poi/xssf/model/TestMapInfo.java b/src/ooxml/testcases/org/apache/poi/xssf/model/TestMapInfo.java index 465a5beba2..e10711e696 100755 --- a/src/ooxml/testcases/org/apache/poi/xssf/model/TestMapInfo.java +++ b/src/ooxml/testcases/org/apache/poi/xssf/model/TestMapInfo.java @@ -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; diff --git a/src/testcases/org/apache/poi/hssf/HSSFTestDataSamples.java b/src/testcases/org/apache/poi/hssf/HSSFTestDataSamples.java index 97eefa8826..113329265f 100644 --- a/src/testcases/org/apache/poi/hssf/HSSFTestDataSamples.java +++ b/src/testcases/org/apache/poi/hssf/HSSFTestDataSamples.java @@ -77,8 +77,16 @@ public final class HSSFTestDataSamples { throw new RuntimeException("Sample file '" + sampleFileName + "' not found in data dir '" + _resolvedDataDir.getAbsolutePath() + "'"); } -// System.out.println("opening " + f.getAbsolutePath()); - try { + 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) { throw new RuntimeException(e); -- 2.39.5